From 9369697ded5c2f6e7d487ad09e79fc4c748ec076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20N=C3=BCtzi?= Date: Wed, 26 Nov 2025 15:00:11 +0100 Subject: [PATCH] fix: only run podman-runner test on x86_64-linux --- .../continuous-integration/gitlab-runner/runner.md | 6 +++--- nixos/modules/services/misc/gitlab.md | 4 ++-- nixos/tests/gitlab/runner.nix | 12 ++++++++---- nixos/tests/gitlab/runner/podman-runner/default.nix | 2 +- .../gitlab/runner/podman-runner/scripts/prebuild.nix | 2 +- nixos/tests/gitlab/runner_test.py | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/continuous-integration/gitlab-runner/runner.md b/nixos/modules/services/continuous-integration/gitlab-runner/runner.md index b927bd99e54b..8b4267f06d9e 100644 --- a/nixos/modules/services/continuous-integration/gitlab-runner/runner.md +++ b/nixos/modules/services/continuous-integration/gitlab-runner/runner.md @@ -33,10 +33,10 @@ features: - `local/ubuntu`: An image based on Ubuntu with a Nix installation (variable `ubuntuImage`). - `local/nix`: An image based on Nix which only comes with `nix` - installed(variable `nixImage`). + installed (variable `nixImage`). **Images for VM Setup**: - - `local/nix-daemon-image`: An image with with a Nix daemon which is + - `local/nix-daemon-image`: An image with a Nix daemon which is used to share the `/nix/store` across jobs (variable `nixDaemonImage`). - `local/podman-daemon-image`: An image with a `podman` running as a daemon which is used to run `podman` inside the above job containers images @@ -70,7 +70,7 @@ features: - The job containers do **not** mount the `podman` socket from the host (NixOS VM) mounted for security reasons. - **Note:**: Building container images with `buildah` (stripped + **Note:** Building container images with `buildah` (stripped `podman` for building images) inside a job which runs `alpineImage` is still possible. diff --git a/nixos/modules/services/misc/gitlab.md b/nixos/modules/services/misc/gitlab.md index 589407cc0b39..50ea3b042bc5 100644 --- a/nixos/modules/services/misc/gitlab.md +++ b/nixos/modules/services/misc/gitlab.md @@ -159,10 +159,10 @@ features: - `local/ubuntu`: An image based on Ubuntu with a Nix installation (variable `ubuntuImage`). - `local/nix`: An image based on Nix which only comes with `nix` - installed(variable `nixImage`). + installed (variable `nixImage`). **Images for VM Setup**: - - `local/nix-daemon-image`: An image with with a Nix daemon which is + - `local/nix-daemon-image`: An image with a Nix daemon which is used to share the `/nix/store` across jobs (variable `nixDaemonImage`). - `local/podman-daemon-image`: An image with a `podman` running as a daemon which is used to run `podman` inside the above job containers images diff --git a/nixos/tests/gitlab/runner.nix b/nixos/tests/gitlab/runner.nix index f0ae33771cfd..8a97bea4b596 100644 --- a/nixos/tests/gitlab/runner.nix +++ b/nixos/tests/gitlab/runner.nix @@ -57,10 +57,14 @@ in (import ./runner/shell-runner.nix { runnerConfig = runnerConfigs.shell; }) - (import ./runner/podman-runner { - runnerConfig = runnerConfigs.shell; - }) - ]; + ] + # Only enable the podman runner on x86_64 + # cause of built images. + ++ (lib.optional pkgs.stdenv.buildPlatform.isx86_64 ( + import ./runner/podman-runner { + runnerConfig = runnerConfigs.podman; + } + )); virtualisation = { diskSize = 10000; diff --git a/nixos/tests/gitlab/runner/podman-runner/default.nix b/nixos/tests/gitlab/runner/podman-runner/default.nix index d634974154e0..75487a1333c0 100644 --- a/nixos/tests/gitlab/runner/podman-runner/default.nix +++ b/nixos/tests/gitlab/runner/podman-runner/default.nix @@ -39,7 +39,7 @@ # you can run `cd tools/nix/vm && just vm::status` # to get some information about the # running stuff. -# - You can clean all logs with `journalclt --vacuume-time=1s` +# - You can clean all logs with `journalctl --vacuum-time=1s` # - Also you can run `btop` on the machine to inspect the performance. # # TODO: use `.execConfig` on `gitlab-runner.service` created diff --git a/nixos/tests/gitlab/runner/podman-runner/scripts/prebuild.nix b/nixos/tests/gitlab/runner/podman-runner/scripts/prebuild.nix index e5cc500b8426..8071acd438fe 100644 --- a/nixos/tests/gitlab/runner/podman-runner/scripts/prebuild.nix +++ b/nixos/tests/gitlab/runner/podman-runner/scripts/prebuild.nix @@ -56,7 +56,7 @@ writeShellScriptBin "gitlab-runner-pre-build-script" function setup_pipeline_scratch_dir() { scratch_dir="/scratch/$CI_PIPELINE_ID" - echo "Create scrtach directory for pipeline: $scratch_dir" + echo "Create scratch directory for pipeline: $scratch_dir" mkdir -p "$scratch_dir" || { echo "Could not create scratch dir '$scratch_dir'." >&2 exit 1 diff --git a/nixos/tests/gitlab/runner_test.py b/nixos/tests/gitlab/runner_test.py index fa4446414a0c..adc98e363915 100644 --- a/nixos/tests/gitlab/runner_test.py +++ b/nixos/tests/gitlab/runner_test.py @@ -101,7 +101,7 @@ def test_register_runner(name: str, tokenFile: str): obj = json.loads(resp) r.id = obj["id"] r.token = obj["token"] - print("==> Registered runner '{r.id}' with token '{r.token}'.") + print(f"==> Registered runner '{r.id}' with token '{r.token}'.") # Push the token to the runner machine. print("==> Push runner token to machine.")