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

Question: Is it possible to configure labels for all services? #67

Open
camjackson opened this issue Jun 28, 2017 · 4 comments
Open

Question: Is it possible to configure labels for all services? #67

camjackson opened this issue Jun 28, 2017 · 4 comments

Comments

@camjackson
Copy link
Contributor

All of my containers will have the same values for these config items:

  • io.fdy.cage.srcdir
  • io.fdy.cage.shell
  • io.fdy.cage.test

Is there somewhere I can configure these so that it will apply to all services?

@camjackson camjackson changed the title Question: Is it possible to provide a common label value? Question: Is it possible to provide common labels configuration? Jun 28, 2017
@camjackson camjackson changed the title Question: Is it possible to provide common labels configuration? Question: Is it possible to configure labels for all services? Jun 28, 2017
@emk
Copy link
Contributor

emk commented Jun 28, 2017

That's an excellent question! And no, I don't think we ever added support for that.

Part of the issue here is that we try to add as few extensions to docker-compose.yml as possible, which makes it hard to do things like this. We were thinking of implementing something like extends for these cases, but then Docker removed support for that in newer versions of the format.

We have a similar problem with .metadata.yml files.

At some point, we might need to bite the bullet and add non-compatible extensions to docker-compose.yml. We've been trying to avoid this, but there may be no better choice. :-(

@camjackson
Copy link
Contributor Author

Thanks for the quick response!

If you don't want to pollute the pod files with non-docker-compose stuff, another solution might be to put it in /config/project.yml? Or maybe a file like /config/defaults.yml? And then allow a structure like:

defaults:
  srcdir: /app
  shell: bash
  test: yarn test

@emk
Copy link
Contributor

emk commented Jun 30, 2017

Yeah, it would be really easy to implement something like this, but the hard part is doing it in a way that doesn't feel gross and ad hoc. I think that we really need to decide how much we're going to rely on docker-compose.yml, and whether we're willing to "officially" extend that format in a systematic way.

I wish I had a quicker answer, but I'd rather get this right. All my instincts say that it would be far too easy to add cruft here, and we probably want a more general solution.

@camjackson
Copy link
Contributor Author

That sounds very wise. There are enough developer tools already where features feel bolted on, rather than thoroughly designed.

It feels like there a few different directions. If you keep it the same as docker-compose.yml, then people can always paste in their ports/environment/working_dir/command config from an existing file and know it will work without having to go and look up the Cage documentation. Which is awesome. But then you'll probably often feel limited with things like this issue.

You could say it's docker-compose.yml + some of your own extensions, but then it goes from "oh it's just docker compose" to "it's a very leaky abstraction over docker compose".

The more extreme option would be to design a totally custom format, but that's probably a lot of work to design+implement+document, and raises the barrier to learning the tool.

Tough call! 🤔

@emk emk self-assigned this Jul 22, 2017
@emk emk removed their assignment Jan 26, 2020
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

No branches or pull requests

2 participants