I have a following
- label: ":docker: Prepare"
command: bundle install
- wait: ~
- name: ":rubocop: Rubocop"
- bundle exec rubocop -A -f emacs -o rubocop.txt
In first step I am pulling all the images and installing gems.
And on second step I am expecting that I will not need to install gems again because of volume added
/tmp/asd/bundle/:/usr/local/bundle/ but it happens that files outside in the host are not being synced inside the docker.
Could you please help, maybe I am doing something wrong?
Or meaybe there is a better approach on how to not run bundle install on every step?
Hey @bgr11n (Bohdan assuming!)
Thanks for reaching out to us, hope you are well
An interesting use case - and can see the volume mount use case in this situation. Since there isn’t node affinity used in this case for the two steps, the host directory could well be on a completely different host on the second step than on the first.
Since you’d need these run on the same host (ala agent), node affinity should help in this case (i.e run these 2 jobs on the agent that performed the
Hi @james.s, thank you for your reply!
Maybe there could be some other ways to do it? Because from docs looks like it may bring some performance issues and in my real pipeline I will have about 4 steps like this.
Also I have a question regarding docker-compose. I have a postgres and redis services defined in docker-compose.yml does this mean that on every step (from example above) I need to seed DB?
Or maybe there is a better way how to run efficiently different steps inside same docker-compose config?
Maybe it would be better to run those step within group step?
I was thinking about using artifacts and then download them on others steps, but to be honest it looks like it was not deisgned for this.
As @james.s mentioned, node affinity is the way to go here. One consideration you could make would be to run multiple agents on the same host, so that you aren’t tying up resources on a single job, and target agents on that host where the volume mounts will persist.
Regarding your docker-compose question, if you are tearing down your dependencies after each step, then you’ll need to re-seed after each one. Configuring your pipeline to seed the DB and then tear it down after running the steps needed would most likely be the way to go.
group steps are only a visual grouping of the steps in the Buildkite UI, they don’t affect the behaviour of the steps within the group.
Re: Artifacts - that’s absolutely the way they are intended to be used! If there are artifacts you want to use in between steps, then uploading them from one step and downloading in a subsequent step is the intended purpose
Hope that helps!
@jeremy Got it, thank you!