Skip to content
Snippets Groups Projects

Native Step Runner Integration for Docker Executor

Merged Axel von Bertoldi requested to merge avonbertoldi/47414/steps-integration-docker into main
2 unresolved threads
1 file
+ 37
0
Compare changes
  • Side-by-side
  • Inline
+ 37
0
@@ -1145,3 +1145,40 @@ section.
In [GitLab Runner 12.9 and later](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1042),
you can use [services](https://docs.gitlab.com/ee/ci/services/) by
enabling [a network for each job](#create-a-network-for-each-job).
## Native Steps Integration
As of version `v17.6.0`, the Docker executor supports executing [CI Steps](https://docs.gitlab.com/ee/ci/steps/)
natively via the `gRPC` API provided by [`step-runner`](https://gitlab.com/gitlab-org/step-runner).
To enable this mode of execution, in addition to specifying CI jobs using the `run` keyword instead of the legacy
`script` keyword, you must enable the feature flag `FF_USE_NATIVE_STEPS`. This can be done at the job or pipeline level.
```yaml
step job:
stage: test
variables:
FF_USE_NATIVE_STEPS: true
image:
name: registry.gitlab.com/gitlab-org/step-runner:v0
run:
- name: step1
script: pwd
- name: step2
script: env
- name: step3
script: ls -Rlah --ignore .git ../
```
### Limitations
- The build image must include a `step-runner` binary in $PATH. This can be achieved by either
1. Creating your own custom build image and including the `step-runner` binary in it.
2. Using the `registry.gitlab.com/gitlab-org/step-runner:v0` image if it also includes the dependencies you need to
run your job.
Note that this is temporary, and in the future we will inject a `step-runner` binary into whatever build image is
specified.
- Running a step that runs a docker container is subject to the same configuration and limitations as legacy `scripts`.
Namely, you must use
[docker-in-docker](https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/docs/executors/docker.md?ref_type=heads#use-docker-in-docker-with-privileged-mode).
- Running [`Github Actions`](https://gitlab.com/components/actionrunner) currently does not work.
Loading