Merge lp:~abentley/juju-ci-tools/hammer-time-job into lp:juju-ci-tools

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 1956
Proposed branch: lp:~abentley/juju-ci-tools/hammer-time-job
Merge into: lp:juju-ci-tools
Diff against target: 49 lines (+45/-0)
1 file modified
hammer-time-job.bash (+45/-0)
To merge this branch: bzr merge lp:~abentley/juju-ci-tools/hammer-time-job
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+321090@code.launchpad.net

Commit message

Convert hammer-time job to a script.

Description of the change

This branch provides the hammer-time job as a script.

This makes it easier to maintain multiple hammer-time jobs, e.g. for different substrates.

It uses a netrc file for curl, which I just introduced into cloud-city.

To post a comment you must log in.
1960. By Aaron Bentley

Fix summary.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'hammer-time-job.bash'
2--- hammer-time-job.bash 1970-01-01 00:00:00 +0000
3+++ hammer-time-job.bash 2017-03-27 16:21:56 +0000
4@@ -0,0 +1,45 @@
5+#!/bin/bash
6+# Required env vars:
7+# PATH must include juju-ci-tools (for s3ci, jujuci, deploy_job)
8+# JUJU_HOME must be the path to cloud-city
9+# JUJU_REPOSITORY must be a path providing dummy-source and dummy-sink
10+# HAMMER_TIME must be a path to the hammer-time binary.
11+# base_config is the environment to use as the base config.
12+# revision_build is the revision build to test.
13+# action_count is the number of actions the plan should perform
14+# JOB_NAME and WORKSPACE should be as provided by Jenkins
15+#
16+# Optional:
17+# replay_build_number The number of a previous build to replay.
18+set -eu
19+export ARTIFACTS=$WORKSPACE/artifacts
20+export ARTIFACT_URL=http://juju-ci.vapour.ws/job/$JOB_NAME/\
21+$replay_build_number/artifact/artifacts/plan.yaml
22+export MODEL_NAME=$JOB_NAME
23+export DATA_DIR=$JUJU_HOME/jes-homes/$MODEL_NAME
24+export PLAN=$ARTIFACTS/plan.yaml
25+set -x
26+s3ci.py get-summary $revision_build $base_config
27+jujuci.py -v setup-workspace $WORKSPACE
28+if [ -n "${replay_build_number-}" ]; then
29+ curl --netrc-file $JUJU_HOME/juju-qa-ci.netrc $ARTIFACT_URL -o $PLAN
30+fi
31+export JUJU_BIN=$(s3ci.py get-juju-bin $revision_build $WORKSPACE)
32+set +e
33+timeout 30m bash <<"EOT"
34+set -eux
35+deploy_job.py $base_config $JUJU_BIN $ARTIFACTS $MODEL_NAME \
36+ --series xenial --agent-stream=revision-build-$revision_build --timeout 600 \
37+ --keep-env
38+cd $HOME/hammer-dir/hammer-time
39+if [ -z "${replay_build_number-}" ]; then
40+ $HAMMER_TIME run-random $PLAN --juju-data $DATA_DIR --juju-bin $JUJU_BIN \
41+ --action-count $action_count
42+else
43+ $HAMMER_TIME replay $PLAN --juju-data $DATA_DIR --juju-bin $JUJU_BIN
44+fi
45+EOT
46+EXIT_STATUS=$?
47+set -e
48+JUJU_DATA=$DATA_DIR juju kill-controller $MODEL_NAME --yes
49+exit $EXIT_STATUS

Subscribers

People subscribed via source and target branches