-
Notifications
You must be signed in to change notification settings - Fork 1
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
Define a config format #1
Comments
Wow, you've been really busy! Quite a lot to look at. We'll be having a look over the next couple of days. |
Just an FYI, as noted by @vizowl who pays attention to these things. Docker One new component is Docker compose, which holds out the fabled "just a
My guess is that this will help with the build step. Not much on On 9 December 2014 at 09:32, Joel notifications@github.com wrote:
Edward Abraham |
Thanks! I saw that announcement and will want to try and keep things consistent with what they come up with. Ideally I can drop out some of the config, but I'm not sure if they'll provide what I'd see as the ideal CI for multi container applications. Basically, I want to point Baleen at a git repo, have it read the config and be able to go fetch and build the rest of the docker containers in your stack (including versioning dependencies, which I haven't seen mentioned in I also kind of want to keep most of the configuration separate. So each git repo defines how to build, test, and deploy the containers it builds. The overall stack architecture would only be defined in as much as it's needed for testing the container. |
@vizowl and I have been having a discussion, and have got to here, Chris will have a go at translating your example into this format. Your build, pre_test, tests, and artefacts steps would all have this same structure. We are imagining a more generic structure, specifying dependencies. Each label at the top level in the yaml file defines conditions that must be satisfied. If these conditions are not met, then the command is run in the image, once the dependencies are satisfied. # All fields optional. The label is a name, that is used to refer to that dependency
LABEL:
conditions: [false] #define questions that are satisfied if they return true (0)
- conditions schema
image: [host] #the host
cmd: [default] #the default command in a docker image
- command schema
wait: [0] #wait seconds before testing the condition
depends: #list of labels |
Looking forward to hearing further suggestions. The definition will probably remain pluggable depending on what people need. For my initial work we'll just support using a fig file to run a test command in a container, so they'd be a single "Action" for "fig up". Any new definition plugin will ultimately have to convert their actions into the underlying data model Baleen understands (Actions, ExpectedActionOutputs etc.). I'm attempting to tidy the data model a bit to make it easier to add new types of actions in future and will see if I can remove the db persistence around project actions. If the actions are defined in a static file, then we should be able to parse that whenever we need it. I've already configured Projects to generate a project-specific ssh key and clone a repo, and moved the existing remotely executed ssh commands to their own Action type: |
# maybe could define a namespace for container names
# in this case awesomeapp
# realised that conditions are actually optional - no conditions means that command
# is always run
rabbitmq:
conditions:
container: awesomeapp-rabbitmq
cmd:
docker_build_and_run: containers/rabbitmq
couchdb:
conditions:
container: awesomeapp-couchdb
cmd:
docker_build_and_run: containers/couchdb
db:
conditions:
container: awesomeapp-db
cmd:
docker_fetch_and_run: postgres
appimage:
conditions:
image: awesomeapp
cmd:
docker_build: app
pretest:
cmd:
shell: cleandb_and_load_fixtures.sh
depends:
- db
tests:
cmd:
container:
image: awesomeapp
name: awesomeapp-tests
links:
- "awesome-db:db"
- "awesome-rabbitmq:rabbitmq"
- "awesome-couchdb:couchdb"
ports:
- "8000:8000"
env:
- TEST: 1
volumes:
- /data
cmd: run_tests.sh
depends:
- pretest
- couchdb
- rabbitmq
- appimage
coverage:
# since we want coverage to run everytime we ask for it would be easiest to not define
# any conditions and I don't think we actually need to list the coverage outputs here
# as it seems that is really for the web front end. However if it turns out we did need
# to define the conditions then we could define an 'always' flag
cmd:
container:
image: awesomeapp
volumes:
- "$PWD/testdata:/data"
volumes_from:
- awesomeapp-tests # need logic to determine that awesomeapp-tests is not used after this and then delete it so that tests runs again
cmd: collect_coverage.sh
depends:
- tests
deploy:
cmd:
container:
image: awesomeapp
env:
- "SECRETS:SNEAKY_STUFF"
depends:
- appimage
- db
- rabbitmq
- couchdb
|
A few other thoughts I had along the way
|
In terms of how this would be used I would image a set of tasks along the lines of git pull &&
baleen coverage &&
baleen staginghost deploy |
Cool thanks. I think furthering this discussion might be easier to have in person one lunchtime or after work.
Responding to your four points:
A couple of things about the direction we wanted to head: The depends:
rabbitmq:
src: "git@github.com:docker-systems/rabbitmq.git"
minhash: "deedbeef" This would automatically use the I didn't have any specific plans to make baleen a deployment tool as suggested in your last comment. We also wanted coverage and other build artifacts in the configuration because I don't want this to be a python specific system (indeed, it'd be mostly useless to us if it was!) Having said that, I'm keen to make this a collaborative project that can be useful for more than just how one team does things :-) |
Chatted with @holic and found that for our needs we'd probably be able to get away with using a Fig will also resolve environment variables from the host, so we can still keep credentials separate: docker/compose#297 This doesn't need negate the need for a file describing the build's other metadata (including the links to other repos with dependent projects to build) |
I've implemented a |
The text was updated successfully, but these errors were encountered: