From be6ada0e45287be2ac5129475d661960b750a059 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 17 Dec 2018 16:00:11 +0100 Subject: [PATCH] ceph-ansible-pipeline: refact ceph-ansible pipeline corresponding ceph-ansible pull-request: ceph/ceph-ansible#3364 - reintroduce ubuntu testing - rename all scenario Signed-off-by: Guillaume Abrioux --- .../definitions/ceph-ansible-pipeline.yml | 42 +++--- .../config/definitions/ceph-ansible-prs.yml | 124 ++++++++++++++++++ scripts/build_utils.sh | 12 +- 3 files changed, 156 insertions(+), 22 deletions(-) diff --git a/ceph-ansible-pipeline/config/definitions/ceph-ansible-pipeline.yml b/ceph-ansible-pipeline/config/definitions/ceph-ansible-pipeline.yml index d09d0302..bda951dc 100644 --- a/ceph-ansible-pipeline/config/definitions/ceph-ansible-pipeline.yml +++ b/ceph-ansible-pipeline/config/definitions/ceph-ansible-pipeline.yml @@ -69,9 +69,9 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-add_osds' + - name: 'ceph-ansible-prs-dev-centos-non_container-add_osds' current-parameters: true - - name: 'ceph-ansible-prs-dev-add_osds_container' + - name: 'ceph-ansible-prs-dev-centos-container-add_osds' current-parameters: true - conditional-step: condition-kind: shell @@ -138,7 +138,7 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-purge_cluster_container' + - name: 'ceph-ansible-prs-dev-centos-container-purge' current-parameters: true - conditional-step: condition-kind: shell @@ -157,7 +157,7 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-purge_cluster_non_container' + - name: 'ceph-ansible-prs-dev-centos-non_container-purge' current-parameters: true - conditional-step: condition-kind: shell @@ -214,9 +214,9 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-update_cluster' + - name: 'ceph-ansible-prs-dev-centos-non_container-update' current-parameters: true - - name: 'ceph-ansible-prs-dev-update_docker_cluster' + - name: 'ceph-ansible-prs-dev-centos-container-update' current-parameters: true - conditional-step: condition-kind: shell @@ -256,9 +256,9 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-shrink_mon' + - name: 'ceph-ansible-prs-dev-centos-non_container-shrink_mon' current-parameters: true - - name: 'ceph-ansible-prs-dev-shrink_mon_container' + - name: 'ceph-ansible-prs-dev-centos-container-shrink_mon' current-parameters: true - conditional-step: condition-kind: shell @@ -298,9 +298,9 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-shrink_osd' + - name: 'ceph-ansible-prs-dev-centos-non_container-shrink_osd' current-parameters: true - - name: 'ceph-ansible-prs-dev-shrink_osd_container' + - name: 'ceph-ansible-prs-dev-centos-container-shrink_osd' current-parameters: true - conditional-step: condition-kind: shell @@ -424,17 +424,17 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-lvm_osds' + - name: 'ceph-ansible-prs-dev-centos-non_container-lvm_osds' current-parameters: true - - name: 'ceph-ansible-prs-dev-lvm_osds_container' + - name: 'ceph-ansible-prs-dev-centos-container-lvm_osds' current-parameters: true - - name: 'ceph-ansible-prs-dev-bluestore_lvm_osds' + - name: 'ceph-ansible-prs-dev-centos-non_container-bluestore_lvm_osds' current-parameters: true - - name: 'ceph-ansible-prs-dev-bluestore_lvm_osds_container' + - name: 'ceph-ansible-prs-dev-centos-container-bluestore_lvm_osds' current-parameters: true - - name: 'ceph-ansible-prs-dev-lvm_batch' + - name: 'ceph-ansible-prs-dev-centos-non_container-lvm_batch' current-parameters: true - - name: 'ceph-ansible-prs-dev-lvm_batch_container' + - name: 'ceph-ansible-prs-dev-centos-container-lvm_batch' current-parameters: true - name: 'ceph-ansible-prs-dev-lvm_auto_discovery' current-parameters: true @@ -478,9 +478,9 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-rgw_multisite' + - name: 'ceph-ansible-prs-dev-centos-non_container-rgw_multisite' current-parameters: true - - name: 'ceph-ansible-prs-dev-rgw_multisite_container' + - name: 'ceph-ansible-prs-dev-centos-container-rgw_multisite' current-parameters: true - conditional-step: condition-kind: shell @@ -509,11 +509,11 @@ condition: SUCCESSFUL execution-type: PARALLEL projects: - - name: 'ceph-ansible-prs-dev-centos7_cluster' + - name: 'ceph-ansible-prs-dev-centos-non_container-all_daemons' current-parameters: true - - name: 'ceph-ansible-prs-dev-docker_cluster' + - name: 'ceph-ansible-prs-dev-centos-container-all_daemons' current-parameters: true - - name: 'ceph-ansible-prs-dev-docker_cluster_collocation' + - name: 'ceph-ansible-prs-dev-centos-container-collocation' current-parameters: true # - name: 'ceph-ansible-prs-dev-container_podman' # current-parameters: true diff --git a/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml b/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml index 25478a52..69027c22 100644 --- a/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml +++ b/ceph-ansible-prs/config/definitions/ceph-ansible-prs.yml @@ -1,3 +1,127 @@ +# new jobs definitions for ceph-ansible scenario refact (see: https://github.com/ceph/ceph-ansible/pull/3364) +- project: + name: ceph-ansible-prs-pipeline-dev + slave_labels: 'vagrant && libvirt && smithi' + release: + - dev + distribution: + - centos + - ubuntu + deployment: + - container + - non_container + scenario: + - all_daemons + - cluster + - collocation + - update + - bluestore_lvm_osds + - lvm_osds + - shrink_mon + - shrink_osd + - lvm_batch + - add_osds + - rgw_multisite + - purge + jobs: + - 'ceph-ansible-prs-pipeline-dev' + +- job-template: + name: 'ceph-ansible-prs-{release}-{distribution}-{deployment}-{scenario}' + id: 'ceph-ansible-prs-pipeline-dev' + node: '{slave_labels}' + concurrent: true + defaults: global + display-name: 'ceph-ansible: Pull Requests [{release}-{distribution}-{deployment}-{scenario}]' + quiet-period: 5 + block-downstream: false + block-upstream: false + retry-count: 3 + properties: + - github: + url: https://github.com/ceph/ceph-ansible + - build-discarder: + days-to-keep: 90 + num-to-keep: -1 + artifact-days-to-keep: -1 + artifact-num-to-keep: -1 + + parameters: + - string: + name: sha1 + description: "A pull request ID, like 'origin/pr/72/head'" + + triggers: + - github-pull-request: + cancel-builds-on-update: true + allow-whitelist-orgs-as-admins: true + org-list: + - ceph + skip-build-phrase: '^jenkins do not test.*|.*\[skip ci\].*' + trigger-phrase: '^jenkins test {release}-{distribution}-{deployment}-{scenario}|jenkins test all.*' + only-trigger-phrase: true + github-hooks: true + permit-all: true + auto-close-on-fail: false + status-context: "Testing: {release}-{distribution}-{deployment}-{scenario}" + started-status: "Running: {release}-{distribution}-{deployment}-{scenario}" + success-status: "OK - {release}-{distribution}-{deployment}-{scenario}" + failure-status: "FAIL - {release}-{distribution}-{deployment}-{scenario}" + + scm: + - git: + url: https://github.com/ceph/ceph-ansible.git + branches: + - ${{sha1}} + refspec: +refs/pull/*:refs/remotes/origin/pr/* + browser: auto + timeout: 20 + skip-tag: true + wipe-workspace: false + + builders: + - inject: + properties-content: | + SCENARIO={scenario} + DEPLOYMENT={deployment} + DISTRIBUTION={distribution} + RELEASE={release} + - conditional-step: + condition-kind: shell + condition-command: | + #!/bin/bash + # Returns 1 if only .rst and README files were modified + echo "Checking if only rst and READMEs were modified" + git diff --name-only $(git show HEAD | grep Merge | head -n 1 | cut -d ':' -f2) | grep -v '\.rst\|README' + if [ $? -eq 1 ]; then + echo "Only docs were modified. Skipping the rest of the job." + exit 1 + fi + on-evaluation-failure: dont-run + steps: + - shell: + !include-raw-escape: + - ../../../scripts/build_utils.sh + - ../../build/build + + publishers: + - postbuildscript: + builders: + - role: SLAVE + build-on: + - FAILURE + - ABORTED + build-steps: + - shell: + !include-raw-escape: + - ../../../scripts/build_utils.sh + - ../../build/teardown + + - archive: + artifacts: 'logs/**' + allow-empty: true + latest-only: false + ## tests that will auto start for every PR created and run on smithi or ovh ## ## NOTE: When adding a new scenario to this project you must also add it to diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index c25d7d07..04977905 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -740,8 +740,18 @@ if [ -n "$release" ]; then else TOX_RUN_ENV=("CEPH_STABLE_RELEASE=$RELEASE" "${TOX_RUN_ENV[@]}") fi + +function build_job_name() { + local job_name=$1 + shift + for item in "$@"; do + job_name="${job_name}-${item}" + done + echo "${job_name}" +} + # shellcheck disable=SC2116 -if ! eval "$(echo "${TOX_RUN_ENV[@]}")" "$VENV"/tox -rv -e="$RELEASE"-"$SCENARIO" --workdir="$WORKDIR" -- --provider=libvirt; then echo "ERROR: Job didn't complete successfully or got stuck for more than 3h." +if ! eval "$(echo "${TOX_RUN_ENV[@]}")" "$VENV"/tox -rv -e="$(build_job_name $RELEASE $DISTRIBUTION $DEPLOYMENT $SCENARIO)" -- --provider=libvirt; then echo "ERROR: Job didn't complete successfully or got stuck for more than 3h." exit 1 fi } -- 2.39.5