]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pull-requests: convert job to run make check in a container
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 12 Mar 2025 20:37:19 +0000 (16:37 -0400)
committerJohn Mulligan <phlogistonjohn@asynchrono.us>
Wed, 1 Oct 2025 20:05:03 +0000 (16:05 -0400)
Convert the test script to run make check using the
build-with-container.py tool. Converts env vars that were directly
passed to the script to use a env file.
Updates the timeout to 4hour (to match the arm64 job) and avoid timeouts.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
ceph-pull-requests/build/build

index edb3ebb05ed962b081c500d99b91ad47ca95cfba..92f18bd82e7478129bcdf1bce8fbbafe2bc4bfa1 100644 (file)
@@ -9,9 +9,48 @@ if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true || "$GHA_ONLY" == true ||
     exit 0
 fi
 
-export NPROC=$(nproc)
-export WITH_CRIMSON=true
-export WITH_RBD_RWL=true
-timeout 3h ./run-make-check.sh
+NPROC=$(nproc)
+NPMCACHE=${HOME}/npmcache
+cat >.env <<EOF
+NPROC=${NPROC}
+MAX_PARALLEL_JOBS=${NPROC}
+WITH_CRIMSON=true
+WITH_RBD_RWL=true
+JENKINS_HOME=${JENKINS_HOME}
+REWRITE_COVERAGE_ROOTDIR=${PWD}/src/pybind/mgr/dashboard/frontend
+EOF
+# TODO: enable (read-only?) sccache support
+npm_cache_info() {
+    echo '===== npm cache info ======='
+    du -sh "${NPMCACHE}" || echo "${NPMCACHE} not present"
+    echo '============================'
+}
+bwc() {
+    # specify timeout in hours for $1
+    local timeout=$(($1*60*60))
+    shift
+    ./src/script/build-with-container.py \
+        -d "${DISTRO_BASE:-jammy}" \
+        --env-file="${PWD}/.env" \
+        --current-branch="${GIT_BRANCH:-main}" \
+        -t+amd64 \
+        --npm-cache-path="${NPMCACHE}" \
+        -x"--timeout=${timeout}" \
+        "${@}"
+}
+
+npm_cache_info
+bwc 1 -e configure
+# try to pre-load the npm cache so that it doesn't fail during the normal build
+# step
+for i in {0..5}; do
+    bwc 1 -e custom -- \
+        cmake --build build -t mgr-dashboard-frontend-deps && break
+    echo "Warning: Attempt $((i+1)) to cache npm packages failed."
+    sleep $((10 + 30 * i))
+done
+npm_cache_info
+bwc 4 -e tests
+npm_cache_info
 sleep 5
 ps -ef | grep -v jnlp | grep ceph || true