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.
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.