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 29, 2024
2 parents 3dd953c + 09084da commit 62a936a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,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

0 comments on commit 62a936a

Please sign in to comment.