From 92dec80dd46750f13ead2da5b59ed56cf8f755c8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 15 Nov 2023 11:38:02 -0800 Subject: [PATCH 1/3] .github/workflows/docker.yml: Replace use of pkill (not present e.g. on debian-sid-minimal) --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index be3e784d87c..57323273bed 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -230,7 +230,7 @@ jobs: if: inputs.free_disk_space - name: Configure and build Sage distribution within a Docker container run: | - (sleep ${{ inputs.timeout }}; for id in $(docker ps -q); do docker exec $id pkill make; done) & + (sleep ${{ inputs.timeout }}; for id in $(docker ps -q); do docker exec $id find /proc -maxdepth 2 -name cmdline -exec sh -c "grep -l [m][a][k][e] {} | cut -d/ -f3 | xargs --no-run-if-empty kill" \;; done) & set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg NUMPROC=4 --build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;" - name: Copy logs from the Docker image or build container run: | From f64f98c09756f4e4cf9bf7632bacc3c8fd5b7191 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 15 Nov 2023 13:09:51 -0800 Subject: [PATCH 2/3] .github/workflows/docker.yml: Use bash instead of sh --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 57323273bed..12d6976d022 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -230,7 +230,7 @@ jobs: if: inputs.free_disk_space - name: Configure and build Sage distribution within a Docker container run: | - (sleep ${{ inputs.timeout }}; for id in $(docker ps -q); do docker exec $id find /proc -maxdepth 2 -name cmdline -exec sh -c "grep -l [m][a][k][e] {} | cut -d/ -f3 | xargs --no-run-if-empty kill" \;; done) & + (sleep ${{ inputs.timeout }}; for id in $(docker ps -q); do docker exec $id find /proc -maxdepth 2 -name cmdline -exec bash -c "grep -l [m][a][k][e] {} | cut -d/ -f3 | xargs --no-run-if-empty kill" \;; done) & set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg NUMPROC=4 --build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;" - name: Copy logs from the Docker image or build container run: | From 09084da9da7f0a87c85254c28c5dbdb99a62580d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 16 Nov 2023 08:43:08 -0800 Subject: [PATCH 3/3] .github/workflows/docker.yml: Add documentation --- .github/workflows/docker.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 12d6976d022..2d13873dc60 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -229,6 +229,15 @@ jobs: df -h if: inputs.free_disk_space - name: Configure and build Sage distribution within a Docker container + # The first command below is a self-destruct sequence, + # which preempts the GitHub Actions 6-hour job cancellation. + # + # Using "docker exec", we enter the temporary containers used by + # "docker build" and kill the "make" processes of the Sage distribution. + # + # The arcane "find" command is a replacement for "pkill make", + # which we use because pkill is not installed in the "minimal" package + # configuration on many platforms. run: | (sleep ${{ inputs.timeout }}; for id in $(docker ps -q); do docker exec $id find /proc -maxdepth 2 -name cmdline -exec bash -c "grep -l [m][a][k][e] {} | cut -d/ -f3 | xargs --no-run-if-empty kill" \;; done) & set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg NUMPROC=4 --build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"