-
Notifications
You must be signed in to change notification settings - Fork 61
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
Share config between containers... #18
Comments
Sorry for the late reply, I'm super-busy at the moment ... Interesting thoughts! I have thought about adding the concept of environments (e.g. run containers with different parameters in different contexts such as development or production). Maybe that would address some of the issues that you face. For example, you could have a "dev" environment, which brings up the container to execute the tasks. Overall, I'd really like to keep Crane as simple as possible. Templating sounds tempting, but I think it's too much. At least not right now with very little use cases that definitely need it. I'm very sceptical of early abstractions/features and think that most of the time, repeating things is not as bad as most devs think. It's cheap, and only when it really hurts it makes sense to abstract it. So. Overall, I like 1) and 2) most. Not sure if the Go YAML parser can handle it, but if it can, that's really nice! Didn't know YAML can do that.
Then, we could add a flag to crane to bring up just one environment, e.g. What do you think? Also, you're idea to push containers to a registry sounds great! I've created a new issue for it: #19 |
I think this is the way to go, with a minor modification. So the final manifest would look like this:
|
The groups are implemented in fe60f4d. |
Would like your input on this:
I have a django app deployed with crane. So, one container runs the django app and another the webserver (nginx), etc. The django app has various environment variables specified in the crane manifest file. Sometimes, hopefully in development rather than production, someone has a need to execute various tasks associated with the app, like
manage.py shell
ormanage.py schemamigration
to create a new migration, etc. These commands can be run in a separate container, but should have the same environment as the appserver itself. Three possible approaches are:manage.py
commands they want). But, yaml has a way to share a node (search for 'repeated nodes' in http://jessenoller.com/blog/2009/04/13/yaml-aint-markup-language-completely-different, for example). So, could use that and I expect the go yaml parser would handle it. Then, the only thing to add to crane (I think) would be a feature to run or not run a specific container from within the manifest. That is, normally you'd want to bring up the appserver and the webserver, but not the shell. But, once in a while you'd want to just run the shell.I'm somewhat inclined toward 2, even though i wouldn't be surprised to want templating at some point anyway :)
Thoughts/suggestions?
Oh, another use case that's occurred to me, but i don't yet need, is I expect to want to use crane to build images and push them to a docker registry. I can easily imagine wanting to choose between multiple registries without having to edit the manifest file (ie to change the tag given to the image). One registry might be local to my computer, another might be for the team. Potentially this could be done using an environment variable in the value of the image name. Adding a push command to crane would certainly be pretty simple. Anyway, i think this use case is handled pretty easily without affecting the choices above.
The text was updated successfully, but these errors were encountered: