Skip to content

Commit

Permalink
Merge branch 'docker_build_strip_timestamp' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Aug 18, 2024
2 parents 7df4c82 + 07ecb86 commit 409644c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,16 @@ jobs:
# 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.
#
# The "sed" command strips away timestamps from "docker build" (buildkit)
# such as "#25 1211.0" at the beginning of each line. The timestamps are
# redundant because GH Actions provides timestamps for each line already.
# Stripping the timestamps from the beginnings of lines also allows
# GitHub Actions to recognize workflow commands such as ::error etc.
#
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=9 --build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=5\"" 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::|;"
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg NUMPROC=9 --build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=5\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed -E --unbuffered "s/^#[0-9]+ [0-9]+[.][0-9]+ //;/^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: |
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"
Expand Down

0 comments on commit 409644c

Please sign in to comment.