Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Are docker images in services pulled at the beginning of a step?

Nick Reilingh
Contributor
October 19, 2021

I have a pipeline where in step 1, I build and deploy a docker container image to a private Google Cloud registry, updating the `:latest` tag. Then in step 2, I use a service based on the `:latest` tag for that very same image.

Does Pipelines guarantee that a custom service image tag will be pulled and instantiated for a step only after previous steps have completed?

Depending on the design of Pipelines, it's plausible that it could pull and run all services in parallel when a pipeline executes instead of accounting for the possibility that a step could alter a service for a later step. I'm not sure the documentation is clear on this particular point.

Haven't tested this for myself yet, but hopefully the question is interesting to others.

1 answer

1 accepted

1 vote
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2021

Hi @Nick Reilingh

Thank you for reaching out to the community.

Yes, Docker images in services YAML configuration will be pulled at the beginning of a step.
The way how Pipelines spin up a step container is that it will first look for services configuration (in your step config) and create containers for each of those services. Once done, Pipelines will then link those services containers to your step container.
Once the entire Pipelines step is done running, all services containers including the step container will be terminated.

Your Pipelines configuration with building GCR is suitable for multi-steps as Step 1 should finish first before executing Step 2.

About your question, if Pipelines guarantee that a service image tag will be pulled and instantiated for a step only after previous steps have been completed, this is guaranteed while using the multi-steps configuration in your YAML file.

For the services running in parallel, it shouldn't alter your services containers for later steps as they're executed separately in each of your steps.
Hence, services in Step 1 should not alter or persist in Step 2.

Hope it helps and please don't hesitate to let me know if you have further questions that I can help with.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events