diff --git a/playbooks/wheel-cache/post-base.yaml b/playbooks/wheel-cache/post-base.yaml index 36dd3c09..3815526a 100644 --- a/playbooks/wheel-cache/post-base.yaml +++ b/playbooks/wheel-cache/post-base.yaml @@ -6,7 +6,18 @@ state: directory delegate_to: localhost - - name: Collect build logs + - name: Compress build logs + archive: + dest: '~/logs/build-logs.tar.bz2' + path: '~/logs/build' + format: bz2 + + - name: Remove uncompressed logs + file: + state: absent + path: '~/logs/build' + + - name: Collect final logs synchronize: dest: "{{ zuul.executor.log_root }}/{{ wheel_python }}" mode: pull diff --git a/roles/build-wheel-cache/files/wheel-build.sh b/roles/build-wheel-cache/files/wheel-build.sh index d02d33d7..d8608bdc 100755 --- a/roles/build-wheel-cache/files/wheel-build.sh +++ b/roles/build-wheel-cache/files/wheel-build.sh @@ -12,9 +12,20 @@ FAIL_LOG=${LOGS}/failed.txt mkdir -p ${LOGS} rm -rf ${LOGS}/* +# output everything to a logfile incase we are killed in flight +exec 1> ${LOGS}/wheel-build.sh.log +exec 2>&1 + # Extract and iterate over all the branch names. -BRANCHES=`git --git-dir=$WORKING_DIR/.git branch -a | grep '^ stable' | \ - grep -Ev '(newton)'` +if [[ $(uname -m) != 'x86_64' ]]; then + # Because arm64 has so many more wheels to make, we limit to just the latest + # two branches. + BRANCHES=$(git --git-dir=$WORKING_DIR/.git branch -a | grep '^ stable' | \ + tail -2) +else + BRANCHES=$(git --git-dir=$WORKING_DIR/.git branch -a | grep '^ stable' | \ + grep -Ev '(newton)') +fi for BRANCH in master $BRANCHES; do git --git-dir=$WORKING_DIR/.git show $BRANCH:upper-constraints.txt \ 2>/dev/null > /tmp/upper-constraints.txt || true @@ -51,9 +62,9 @@ for BRANCH in master $BRANCHES; do # file keeps an overview of all run jobs, which we can probe to # find failed jobs. cat /tmp/upper-constraints.txt | \ - parallel --files --progress --joblog ${LOGS}/$SHORT_BRANCH-job.log \ + parallel --files --joblog ${LOGS}/$SHORT_BRANCH-job.log \ --results ${LOGS}/build/$SHORT_BRANCH \ - build_env/bin/pip --verbose --exists-action=i wheel \ + build_env/bin/pip --exists-action=i wheel \ -c /tmp/upper-constraints.txt \ -w $WHEELHOUSE_DIR {} set -e @@ -82,16 +93,6 @@ if [ -f ${FAIL_LOG} ]; then cat ${FAIL_LOG} fi -# XXX This does make a lot of log files; about 80mb after compression. -# In theory we could correlate just the failed logs and keep those -# from the failure logs above. This is currently (2017-01) left as an -# exercise for when the job is stable :) bz2 gave about 20% -# improvement over gzip in testing. -pushd ${LOGS} -tar zcvf build-logs.tar.gz ./build -rm -rf ./build -popd - # Set the final exit status to 1 if remove-wheels.txt is empty so the # job will fail. if [ ! -s ${LOGS}/remove-wheels.txt ]; then