From 75472c29bba8bc771c172e6d4dd1249e7ba2ef5f Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 19 Mar 2026 16:51:38 -0400 Subject: [PATCH 1/3] ceph-pr-api: update to run in a container (via bwc) Update the ceph-pr-api tests so that the build and tests that this job runs are done so inside a container. The build task is updated to be more similar to how builds are typically done now for 'make check', with a few tweaks. Then for running the tests we reuse the build container image created for the build, install a few extra (ephemeral) dependencies in it and then fire off the dashboard script that runs the api tests. Signed-off-by: John Mulligan --- ceph-pr-api/build/api | 35 +++++++++++++++++-- ceph-pr-api/build/build | 22 ++++++++---- .../config/definitions/ceph-pr-api.yml | 2 +- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/ceph-pr-api/build/api b/ceph-pr-api/build/api index a2af5a640..af040eea9 100644 --- a/ceph-pr-api/build/api +++ b/ceph-pr-api/build/api @@ -1,3 +1,34 @@ #!/bin/bash -e -cd src/pybind/mgr/dashboard -timeout 7200 ./run-backend-api-tests.sh + +NPMCACHE=${HOME}/npmcache +export NPMCACHE # used by bwc function (silence shellcheck warning) +CB_SCRIPT_DIR=../../../scripts +INNER_SCRIPT_DIR=build.scripts + +# this script needs to be run inside the build image rather than +# on the build host. So create an intermediate location for scripts +# that bootstrap the test env than can be executed by a bwc custom +# command. +mkdir -p "${INNER_SCRIPT_DIR}" +cp "${CB_SCRIPT_DIR}/dashboard/install-backend-api-test-deps.sh" \ + "${INNER_SCRIPT_DIR}" +chmod +x "${INNER_SCRIPT_DIR}/install-backend-api-test-deps.sh" + +# TODO: either we have this hack or we update the dashboard script +# and the things it calss to avoid a bunch of hardcoded sudo calls. +# For now, this is the easier choice. +cat > "${INNER_SCRIPT_DIR}/install-fake-sudo.sh" < /usr/local/bin/sudo +echo 'exec "\$@"' >> /usr/local/bin/sudo +chmod +x /usr/local/bin/sudo +EOF +chmod +x "${INNER_SCRIPT_DIR}/install-fake-sudo.sh" + +bwc 2 -e custom -- \ + "./${INNER_SCRIPT_DIR}/install-backend-api-test-deps.sh" \ + '&&' "./${INNER_SCRIPT_DIR}/install-fake-sudo.sh" \ + '&&' sudo ls \ + '&&' cd src/pybind/mgr/dashboard \ + '&&' ./run-backend-api-tests.sh diff --git a/ceph-pr-api/build/build b/ceph-pr-api/build/build index 44b81dcd7..f9017e27e 100644 --- a/ceph-pr-api/build/build +++ b/ceph-pr-api/build/build @@ -14,12 +14,20 @@ if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true || "$GHA_ONLY" == true ]]; exit 0 fi -n_build_jobs=$(get_nr_build_jobs) -n_test_jobs=$(($(nproc) / 4)) -export CHECK_MAKEOPTS="-j${n_test_jobs} -N -Q" -export BUILD_MAKEOPTS="-j${n_build_jobs}" -export FOR_MAKE_CHECK=1 -timeout 2h ./src/script/run-make.sh \ - --cmake-args '-DWITH_TESTS=OFF -DENABLE_GIT_VERSION=OFF' +NPROC=$(nproc) +NPMCACHE=${HOME}/npmcache +export NPMCACHE # used by bwc function (silence shellcheck warning) +cat >.env < Date: Thu, 19 Mar 2026 18:16:19 -0400 Subject: [PATCH 2/3] xxx Signed-off-by: John Mulligan --- ceph-pr-api/build/api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceph-pr-api/build/api b/ceph-pr-api/build/api index af040eea9..9d978e044 100644 --- a/ceph-pr-api/build/api +++ b/ceph-pr-api/build/api @@ -2,7 +2,7 @@ NPMCACHE=${HOME}/npmcache export NPMCACHE # used by bwc function (silence shellcheck warning) -CB_SCRIPT_DIR=../../../scripts +CB_SCRIPT_DIR=../../scripts INNER_SCRIPT_DIR=build.scripts # this script needs to be run inside the build image rather than From a3d660f535a2a00d5b60d708a41a10c93ea67f2b Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Fri, 20 Mar 2026 12:49:38 -0400 Subject: [PATCH 3/3] xxx: workaround Signed-off-by: John Mulligan --- ceph-pr-api/build/api | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ceph-pr-api/build/api b/ceph-pr-api/build/api index 9d978e044..07f2f7bf2 100644 --- a/ceph-pr-api/build/api +++ b/ceph-pr-api/build/api @@ -10,8 +10,16 @@ INNER_SCRIPT_DIR=build.scripts # that bootstrap the test env than can be executed by a bwc custom # command. mkdir -p "${INNER_SCRIPT_DIR}" -cp "${CB_SCRIPT_DIR}/dashboard/install-backend-api-test-deps.sh" \ - "${INNER_SCRIPT_DIR}" +# XXX: It can't find the other script?? +cat > "${INNER_SCRIPT_DIR}/install-backend-api-test-deps.sh" <