Make artifacts from child pipeline accessible from parent pipeline
Proposal
I have a use case for infrastructure CI/CD in which I have to generate artifacts for a number of infrastructure instances in parallel. Each one runs its own build process and generates artifacts in an artifact folder "build". The build process is CPU intensive and for optimum performance I started experimenting with dynamic parent child pipelines to split the build jobs across multiple runners in the pool. The number of infrastructure instances is only known at run time as it is processed from the configuration files dynamically, hence the dynamic pipelines. In my example, the "prepare-build" job generates the child pipeline YAML file dynamically with the required jobs to build the artifacts for each infrastructure instance. See image below:
As a result of the execution, all child pipeline have generated a build artifact under folder "build", each one with each config files, and exported with a specific artifact name. However, these artifacts are not visible on the parent pipeline. The next pipeline stage "report" is supposed to inspect all previous build artifacts and generate some sort of report with them. Ideally it would be really convenient to tell Gitlab CI that I want to pull the child artifacts and optionally merge the artifacts from the child pipelines so that the result is a single build artifact that I can process. Example of child artifacts:
Parent pipeline:
child_1:
build/artifact1
child2:
build/artifact2
child3:
build/artifact3
Ideally I would like to see these artifacts in the parent pipeline as:
build/
artifact1
artifact2
artifact3
This is exactly the case if I run the build process sequentially, but then I rely on a single runner to do all the job. I could use multi-threading, but if the jobs are CPU intensive, the runner might struggle. Ideally I would like to split between runners instead of multi-threading.
Proposal
- Make artifacts from child pipelines accessible in the archive of the parent pipeline
- Make artifacts from child pipelines accessible to later jobs in the parent pipeline
- Roll up artifacts using
expose_as
keyword to parent pipeline MR- UI may be something like