Forums

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

Can parallel steps inherit the state of the previous step?

AS October 29, 2021

Im struggling with using steps to persist information/state.


I had assumed the parallel steps inherit their container from the previous step. This is correct, I can not get it to work.
If this, isnt correct doest that mean parallel steps, are meant to have lots of duplicate code (for example installing packages, and prepring envs to run tests etc..)

My current approach to have the first step run an ansible playbook - which provisions the container in pipeline similar to our local dev, and production envs.
Part of that process is configuring the mysql DB and downloading some dummy data for it to use, while also installing some other libs (awscli for example)
Finally it installs poetry so I can test our packages in this env, against the DB, before deployment.


But when ever the next steps (in parallel) "poetry is not found".
I added the artifacts: dist/** - from seeing an example elsewhere about preserving whats installed to the next steps, but that didnt work.
Have I miss understood the purpose of parallel steps here?

1 answer

0 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 2, 2021

Hi, @AS

Thank you for reaching out to Atlassian Community!

First, I would like to explain how containers work. Your assumption was:

I had assumed the parallel steps inherit their container from the previous step.

Actually, for every step in the YAML file, a Docker container starts. The repo is cloned in that container, and then the script commands are executed. Then, the container gets destroyed. For the next step, a new container will start. So, if you install some tools in one step, they won’t be available in the next step. If you generate files in one step, they will only be available in the next steps if you define them as artifacts.

You mentioned parallel steps. Artifacts defined in a certain parallel step are not available in steps of the same parallel set. Only in subsequent steps that are not part of the parallel set.

I don’t know how this tool (Poetry) is installed, and whether simply defining as artifacts certain directories it generates will make it available in the next steps or not. So, if you could let us know how you do the installation, we can check this further.

Looking forward to hearing from you. 

Kind regards,
Caroline 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events