Skip to content

Commit

Permalink
sagemathgh-36726: CI Linux: Replace use of pkill
Browse files Browse the repository at this point in the history
Follow-up after:
- sagemath#36670

This is working well, for example see https://github.com/mkoeppe/sage/ac
tions/runs/6874334523/job/18695809308#step:11:5345, making it possible
to obtain the image of the hanging build - https://github.com/mkoeppe/sa
ge/actions/runs/6874334523/job/18695809308#step:15:25

However, `pkill` is not present on many of our `-minimal` configurations
(which test our documented minimal build prerequisites). For example
`debian-sid-minimal`, as seen in https://github.com/mkoeppe/sage/actions
/runs/6874334523/job/18695811066#step:11:2262, rendering the mechanism
ineffective there. (Neither are `ps` and `killall`.)

Examples:
- `docker run -it ghcr.io/sagemath/sage/sage-debian-bookworm-minimal-
with-system-packages:dev bash -c "command -v pkill" `
- `docker run -it ghcr.io/sagemath/sage/sage-fedora-38-minimal-with-
system-packages:dev bash -c "command -v pkill"`
- whereas `docker run -it ghcr.io/sagemath/sage/sage-fedora-38-standard-
with-system-packages:dev bash -c "command -v pkill" ` -->
`/usr/bin/pkill`.

We replace `pkill` by more primitive means.

Test run (with timeout set to ~11 minutes for testing purposes): https:/
/github.com/mkoeppe/sage/actions/runs/6883232154/job/18723359505#step:15
:25

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

URL: sagemath#36726
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Nathan Dunfield, William Stein
  • Loading branch information
Release Manager committed Jan 24, 2024
2 parents 0940183 + 09084da commit 8050f00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,17 @@ 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 pkill make; 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: |
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=c72fc2006b1702e74f38c480b0376e3e6c8a5758
md5=a650e8682fe75708f679eabe918d2aa7
cksum=785462498
sha1=8124eeddb2d440bd40f9656a8f69ce53175a4706
md5=db7e8fb79c8cd9a69e8cc6865e43add9
cksum=719116257
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
919b021b0c103e4fb798cc784218015e0a515510
0c16f847a4db786d105c48e79bf3bc3fe07d82fc

0 comments on commit 8050f00

Please sign in to comment.