Skip to content
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

Merged
merged 1 commit into from
Nov 22, 2023
Merged

dockercompose: support compose profiles #6261

merged 1 commit into from
Nov 22, 2023

Conversation

coldfgirl
Copy link
Contributor

@coldfgirl coldfgirl commented Nov 19, 2023

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 and v1.18.4 is most likely compose-spec/compose-go#359.

@coldfgirl coldfgirl marked this pull request as ready for review November 20, 2023 05:02
@@ -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
Copy link
Member

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?

Copy link
Contributor Author

@coldfgirl coldfgirl Nov 20, 2023

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 😅

Copy link
Contributor Author

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.

Copy link
Member

@nicks nicks left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants