diff options
author | Fatih Degirmenci <fdegir@gmail.com> | 2018-03-12 20:31:13 +0100 |
---|---|---|
committer | Fatih Degirmenci <fdegir@gmail.com> | 2018-03-14 20:48:13 +0100 |
commit | 5d96264c472215f346e4e7cf44ba3ea6a51d76d6 (patch) | |
tree | 85ec89e30e47efac14fd244d62d54eb426dc507b /jjb | |
parent | d0d69375892fbdd3280c7f23ec146f9e62c034f2 (diff) |
xci: Create post merge jobs to promote scenarios
This change lays down the basic job structure for post merge promotion
jobs. The job structure will be
- a top level multijob job that is scenario specific and can not run
concurrently. This job runs distro deploy and test jobs for all the
distros in the first phase concurrently, followed by a common promote job.
- the deploy and test jobs are same as the xci-verify jobs except the
trigger. They are triggered by top level multijob.
- the promote job is run once all the deploy & test phase jobs successfully
completed, uploading promotion metadata to artifacts.opnfv.org.
The builders except set-scenario are left empty in order to try the basic
job setup first. Followup changes will get real things in.
Once the basics are in place, the first promotion will be done using functest
healthcheck and then we will start working on gating scenarios for promotion
using functest smoke and perhaps feature test cases.
Change-Id: Ib91ffe0f3003b86841a62537c52fde176cafa70f
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/xci/xci-merge-jobs.yml | 273 | ||||
-rwxr-xr-x | jjb/xci/xci-set-scenario.sh | 21 | ||||
-rw-r--r-- | jjb/xci/xci-verify-jobs.yml | 2 |
3 files changed, 226 insertions, 70 deletions
diff --git a/jjb/xci/xci-merge-jobs.yml b/jjb/xci/xci-merge-jobs.yml index 92eea190f..8a3a7cfbc 100644 --- a/jjb/xci/xci-merge-jobs.yml +++ b/jjb/xci/xci-merge-jobs.yml @@ -2,6 +2,7 @@ - project: name: 'opnfv-xci-merge' + project: releng-xci # ------------------------------- # branches # ------------------------------- @@ -19,34 +20,35 @@ - opensuse: disabled: false # ------------------------------- + # scenarios + # ------------------------------- + scenario: + - 'os-odl-sfc': + project: sfc + # ------------------------------- # type # ------------------------------- type: - virtual # ------------------------------- - # patch verification phases + # postmerge promotion phases # ------------------------------- phase: - 'deploy' - 'healthcheck' - - 'promote' - # ------------------------------- - # scenarios - # ------------------------------- - scenario: - - 'os-odl-sfc': - project: sfc # ------------------------------- # jobs # ------------------------------- jobs: - - 'xci-{scenario}-{type}-{distro}-merge-{stream}' - - 'xci-{phase}-{type}-{distro}-merge-{stream}' + - 'xci-{scenario}-{type}-merge-{stream}' + - 'xci-{scenario}-{type}-promote-merge-{stream}' + - 'xci-merge-{distro}-{type}-{stream}' + - 'xci-merge-{distro}-{phase}-{type}-{stream}' # ------------------------------- # job templates # ------------------------------- - job-template: - name: 'xci-{scenario}-{type}-{distro}-merge-{stream}' + name: 'xci-{scenario}-{type}-merge-{stream}' project-type: multijob @@ -56,22 +58,6 @@ properties: - logrotate-default - - build-blocker: - use-build-blocker: true - blocking-jobs: - - 'xci-verify-{distro}-.*' - - 'xci-.*-{distro}-merge-.*' - - 'openstack-bifrost-verify-{distro}-.*' - - 'xci-osa-verify-{distro}-.*' - - 'xci-osa-periodic-{distro}-.*' - - 'xci-(os|k8s).*?-virtual-{distro}-.*' - block-level: 'NODE' - - throttle: - max-per-node: 2 - max-total: 10 - categories: - - xci-verify-virtual - option: category wrappers: - ssh-agent-wrapper @@ -80,12 +66,7 @@ - fix-workspace-permissions scm: - - git: - credentials-id: '$SSH_CREDENTIAL_ID' - url: 'https://gerrit.opnfv.org/gerrit/releng-xci' - branches: - - 'origin/master' - timeout: 15 + - git-scm-gerrit triggers: - gerrit: @@ -109,14 +90,14 @@ parameters: - project-parameter: - project: '{obj:project}' + project: $GERRIT_PROJECT branch: '{branch}' - label: name: SLAVE_LABEL default: 'xci-virtual' - string: - name: DEPLOY_SCENARIO - default: '{scenario}' + name: DISTRO + default: 'all' - string: name: CLEAN_DIB_IMAGES default: 'true' @@ -127,18 +108,139 @@ builders: - description-setter: - description: "Built on $NODE_NAME" + description: "Node: $NODE_NAME" + - 'xci-merge-set-scenario-macro' + - multijob: + name: deploy and test + condition: SUCCESSFUL + projects: + - name: 'xci-merge-opensuse-{type}-{stream}' + current-parameters: false + predefined-parameters: | + DISTRO=opensuse + CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + GERRIT_PROJECT=$GERRIT_PROJECT + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + - name: 'xci-merge-ubuntu-{type}-{stream}' + current-parameters: false + predefined-parameters: | + DISTRO=ubuntu + CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + GERRIT_PROJECT=$GERRIT_PROJECT + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + - name: 'xci-merge-centos-{type}-{stream}' + current-parameters: false + predefined-parameters: | + DISTRO=centos + CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + GERRIT_PROJECT=$GERRIT_PROJECT + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: true + - inject: + properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties" + - multijob: + name: promote + condition: SUCCESSFUL + projects: + - name: 'xci-{scenario}-{type}-promote-merge-{stream}' + current-parameters: true + predefined-parameters: | + GERRIT_PROJECT=$GERRIT_PROJECT + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: true + kill-phase-on: NEVER + abort-all-job: true + +- job-template: + name: 'xci-merge-{distro}-{type}-{stream}' + + project-type: multijob + + disabled: '{obj:disabled}' + + concurrent: true + + properties: + - logrotate-default + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'xci-verify-{distro}-.*' + - 'xci-merge-{distro}-.*' + - 'openstack-bifrost-verify-{distro}-.*' + - 'xci-osa-verify-{distro}-.*' + - 'xci-osa-periodic-{distro}-.*' + block-level: 'NODE' + - throttle: + max-per-node: 1 + max-total: 3 + categories: + - xci-verify-virtual + option: category + + wrappers: + - ssh-agent-wrapper + - build-timeout: + timeout: 240 + - fix-workspace-permissions + + scm: + - git-scm-gerrit + + parameters: + - project-parameter: + project: $GERRIT_PROJECT + branch: '{branch}' + - label: + name: SLAVE_LABEL + default: 'xci-virtual' + - string: + name: DISTRO + default: '{distro}' + - string: + name: CLEAN_DIB_IMAGES + default: 'true' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + + builders: + - 'xci-merge-set-scenario-macro' + - inject: + properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties" + - description-setter: + description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME" - multijob: name: deploy condition: SUCCESSFUL projects: - - name: 'xci-deploy-{type}-{distro}-merge-{stream}' + - name: 'xci-merge-{distro}-deploy-{type}-{stream}' current-parameters: true predefined-parameters: | - PROJECT=$PROJECT DISTRO={distro} - DEPLOY_SCENARIO={scenario} CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + GERRIT_PROJECT=$GERRIT_PROJECT GERRIT_BRANCH=$GERRIT_BRANCH GERRIT_REFSPEC=$GERRIT_REFSPEC GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER @@ -150,19 +252,18 @@ name: healthcheck condition: SUCCESSFUL projects: - - name: 'xci-healthcheck-{type}-{distro}-merge-{stream}' + - name: 'xci-merge-{distro}-healthcheck-{type}-{stream}' current-parameters: true predefined-parameters: | - PROJECT=$PROJECT DISTRO={distro} - DEPLOY_SCENARIO={scenario} CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES - FUNCTEST_MODE=tier - FUNCTEST_TIER=healthcheck + GERRIT_PROJECT=$GERRIT_PROJECT GERRIT_BRANCH=$GERRIT_BRANCH GERRIT_REFSPEC=$GERRIT_REFSPEC GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck node-parameters: true kill-phase-on: NEVER abort-all-job: true @@ -176,7 +277,7 @@ !include-raw: ./xci-cleanup.sh - job-template: - name: 'xci-{phase}-{type}-{distro}-merge-{stream}' + name: 'xci-merge-{distro}-{phase}-{type}-{stream}' disabled: false @@ -196,14 +297,11 @@ parameters: - string: name: PROJECT - default: 'releng-xci' + default: $GERRIT_PROJECT - string: name: DISTRO default: 'ubuntu' - string: - name: DEPLOY_SCENARIO - default: 'os-nosdn-nofeature-noha' - - string: name: FUNCTEST_MODE default: 'tier' - string: @@ -219,51 +317,90 @@ name: OPNFV_RELENG_DEV_PATH default: $WORKSPACE/ - string: - name: INSTALLER_TYPE - default: 'osa' - - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' wrappers: + - inject: + properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties" - ssh-agent-wrapper - build-timeout: timeout: 240 - fix-workspace-permissions scm: - - git: - credentials-id: '$SSH_CREDENTIAL_ID' - url: 'https://gerrit.opnfv.org/gerrit/releng-xci' - branches: - - 'origin/master' - timeout: 15 + - git-scm-gerrit builders: - description-setter: - description: "Built on $NODE_NAME" + description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME" - 'xci-merge-{phase}-macro' +- job-template: + name: 'xci-{scenario}-{type}-promote-merge-{stream}' + + disabled: false + + concurrent: false + + properties: + - logrotate-default + + parameters: + - string: + name: PROJECT + default: $GERRIT_PROJECT + - string: + name: DISTRO + default: 'all' + - string: + name: OPNFV_RELENG_DEV_PATH + default: $WORKSPACE/ + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + + wrappers: + - inject: + properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties" + - ssh-agent-wrapper + - build-timeout: + timeout: 240 + - fix-workspace-permissions + + builders: + - description-setter: + description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME" + - 'xci-merge-promote-macro' + # ------------------------------- # builder macros # ------------------------------- - builder: - name: 'xci-merge-deploy-macro' + name: 'xci-merge-set-scenario-macro' builders: - shell: - !include-raw: ./xci-start-new-vm.sh - - shell: - !include-raw: ./xci-start-deployment.sh + !include-raw: ./xci-set-scenario.sh + +- builder: + name: 'xci-merge-deploy-macro' + builders: + - shell: | + #!/bin/bash + echo "Hello World" - builder: name: 'xci-merge-healthcheck-macro' builders: - - shell: - !include-raw: ./xci-run-functest.sh + - shell: | + #!/bin/bash + echo "Hello World" - builder: name: 'xci-merge-promote-macro' builders: - - shell: - !include-raw: ./xci-promote.sh + - shell: | + #!/bin/bash + echo "Hello World" diff --git a/jjb/xci/xci-set-scenario.sh b/jjb/xci/xci-set-scenario.sh index 62b26c019..c602957a9 100755 --- a/jjb/xci/xci-set-scenario.sh +++ b/jjb/xci/xci-set-scenario.sh @@ -108,6 +108,12 @@ function determine_generic_scenario() { ;; esac done + + # extract releng-xci sha + RELENG_XCI_SHA=$(cd $WORKSPACE && git rev-parse HEAD) + + # extract scenario sha which is same as releng-xci sha for generic scenarios + SCENARIO_SHA=$RELENG_XCI_SHA } # This function determines the impacted external scenario by processing the Gerrit @@ -134,6 +140,12 @@ function determine_external_scenario() { # process the diff to find out what scenario(s) are impacted - there should only be 1 DEPLOY_SCENARIO+=$(git diff HEAD^..HEAD --name-only | grep scenarios | awk -F '[/|/]' '{print $2}' | uniq) + + # extract releng-xci sha + RELENG_XCI_SHA=$(cd $WORKSPACE && git rev-parse HEAD) + + # extract scenario sha + SCENARIO_SHA=$(cd $WORK_DIRECTORY/$GERRIT_PROJECT && git rev-parse HEAD) } echo "Determining the impacted scenario" @@ -179,9 +191,16 @@ esac # save the installer and scenario names into java properties file # so they can be injected to downstream jobs via envInject -echo "Recording the installer '$INSTALLER_TYPE' and scenario '${DEPLOY_SCENARIO[0]}' for downstream jobs" +echo "Recording the installer '$INSTALLER_TYPE' and scenario '${DEPLOY_SCENARIO[0]}' and SHAs for downstream jobs" echo "INSTALLER_TYPE=$INSTALLER_TYPE" > $WORK_DIRECTORY/scenario.properties echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties +echo "RELENG_XCI_SHA=$RELENG_XCI_SHA" >> $WORK_DIRECTORY/scenario.properties +echo "SCENARIO_SHA=$SCENARIO_SHA" >> $WORK_DIRECTORY/scenario.properties + +# skip scenario support check if the job is promotion job +if [[ "$JOB_NAME" =~ (os|k8) ]]; then + exit 0 +fi # skip the deployment if the scenario is not supported on this distro OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml diff --git a/jjb/xci/xci-verify-jobs.yml b/jjb/xci/xci-verify-jobs.yml index 4c9ff9e69..383af2f71 100644 --- a/jjb/xci/xci-verify-jobs.yml +++ b/jjb/xci/xci-verify-jobs.yml @@ -66,7 +66,7 @@ use-build-blocker: true blocking-jobs: - 'xci-verify-{distro}-.*' - - 'xci-.*-{distro}-merge-.*' + - 'xci-merge-{distro}-.*' - 'openstack-bifrost-verify-{distro}-.*' - 'xci-osa-verify-{distro}-.*' - 'xci-osa-periodic-{distro}-.*' |