project-config/jenkins/jobs/wheel-mirror.yaml
Ian Wienand 8928d5f626 Run wheel build jobs in parallel and keep logs
Even after increasing the build-time to 180 minutes with
Idc1d53d1e73b4a9eb13f258f4a4d5627ec3cf300 it's not enough to avoid
timeouts.  I did a manual run and it took 214 minutes on the centos
builder.

We can parallelise builds.  The "parallel" program provides us with
plenty of useful help in this regard.  As described in the comments,
this will run ncpu jobs (4 on our builders) and capture and store the
logs for each individual job.  A test run on the centos build host was
reduced to ~1 hour.

The job output is particularly handy because we can do a little work
to make an easy-to-parse failure log.  This job is a little weird
because failures aren't hard -- we can still release everything we did
manage to build.  Initially this overview log file will enable a 3rd
party monitor that can alert interested people when failing builds
occur.

We store the build logs as a .tar.bz2 bundle as described, but the
smaller files are copied directly.

Change-Id: Ifec15f71cc3530d47da4f3304d3fe094d77e0980
Depends-On: I9635721a4f8d718ad402d23600840f091267952c
2017-01-24 17:10:42 +11:00

91 lines
2.3 KiB
YAML

- builder:
name: wheel-build
builders:
- shell: |
#!/bin/bash -xe
# Generate the AFS Slug from the host system.
source /usr/local/jenkins/slave_scripts/afs-slug.sh
AFS_DIR=/afs/.openstack.org/mirror/wheel/$AFS_SLUG/
WHEEL_DIR=/opt/wheel/workspace
# Delete any previous build directory
rm -rf $WHEEL_DIR
mkdir $WHEEL_DIR
# Build the wheels into staging directory
echo "Building wheels"
/usr/local/jenkins/slave_scripts/wheel-build.sh $WHEEL_DIR {python}
# Get an afs token and copy the wheels to AFS
echo "Obtaining token and copying wheels to AFS"
k5start -t -f /etc/wheel.keytab \
service/wheel \
-- timeout -k 2m 30m \
/usr/local/jenkins/slave_scripts/wheel-copy.sh $WHEEL_DIR $AFS_DIR
# Get an afs token and rebuild the mirror index.html
echo "Obtaining token and rebuilding mirror index."
k5start -t -f /etc/wheel.keytab \
service/wheel \
-- timeout -k 2m 30m \
/usr/local/jenkins/slave_scripts/wheel-index.sh $AFS_DIR
echo "Done."
- builder:
name: afs-release
builders:
- shell: |
#!/bin/bash -xe
echo "Releasing afs volume {volume}."
k5start -t -f /etc/afsadmin.keytab service/afsadmin -- \
vos release -v {volume}
echo "Done."
- job-template:
name: 'wheel-build-{node_arch}-{python}'
node: 'wheel-mirror-{node_arch}'
wrappers:
- build-timeout:
timeout: 180
- timestamps
builders:
- revoke-sudo
- link-logs
- net-info
- zuul-clone:
project: openstack/requirements
- wheel-build:
python: "{python}"
publishers:
- devstack-logs
- console-log
- job-template:
# mirror_arch must be 9 characters or less.
name: 'wheel-release-{mirror_arch}'
node: release
wrappers:
- build-timeout:
timeout: 90
- timestamps
builders:
- revoke-sudo
- link-logs
- net-info
- afs-release:
# This variable must never exceed 22 characters.
volume: 'mirror.wheel.{mirror_arch}'
publishers:
- console-log