Skip to content

Control start of services through feature flag

Tom Cannaerts requested to merge TomCan1/gitlab-runner:delayed-services into main

What does this MR do?

This MR introduces a feature flag that allows services in the docker executor to be started just before the "step_script" stage of the build, as opposed to the default "Prepare" phase.

Why was this MR needed?

When services start, they currently start with an empty or outdated volume (before git fetch/checkout, cache and artifacts). This prevents pipelines from using images that require the content of the repository to properly start. A noteable use case for this is web testing where the services that make up the environment require more configuration than what is possible through environment variables. Think Apache config files, Varnish VCL files, SOLR schema files, certificates files, ... or even just a NodeJS application you're trying to test with the standard Node image.

What's the best way to test this MR?

Create a stage with a service that will print the contents of the build directory upon start. The toggle the feature flag to confirm that when enabled, the project source code is there.

What are the relevant issue numbers?

Oldest issue I could find: #6392 More recent with same question: #27058

Status

Need help with tests

Edited by Tom Cannaerts

Merge request reports