-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dockercompose: support compose profiles #6261
Conversation
Signed-off-by: robin <[email protected]>
@@ -57,12 +57,14 @@ func (dcm dcResourceMap) ServiceCount() int { | |||
func (s *tiltfileState) dockerCompose(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) { | |||
var configPaths starlark.Value | |||
var projectName string | |||
var profiles value.StringOrStringList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this PR, the default behavior is always "no profiles". is that right?
maybe the default behavior should be "read the profiles from the COMPOSE_PROFILES env var"
what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it depends on how much tilt wants the local environment to colour what tilt does versus what is defined in a Tiltfile
. I'm not super familiar with the project so I don't know how much or if this already happens. From my perspective though the usage of COMPOSE_PROFILES
or the --profile
argument can be options of docker compose but not necessarily of tilt.
For my own setup I find value in the straightforwardness of my full definition being inside the Tiltfile
. I think this also works especially well for when I have multiple docker-compose.yml
files and I want to be intentional about which services I need from each.
I have to say though that the setup I'm using is relatively simplistic so if there are arguments for using the COMPOSE_PROFILES
environment variable I probably wouldn't have run into them anyways 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I forgot, to answer your question: it is correct that the default behaviour is no profiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
ok. this is a good start. let me ask the docker-compose people what they think about making it use the COMPOSE_PROFILES env var
Adds support for compose profiles to both provide a solution for #6250 and to improve the integration with docker compose.
The PR which changed the previous functionality from compose-go between
v1.6.0
andv1.18.4
is most likely compose-spec/compose-go#359.