From: mei mei Date: Fri, 16 Mar 2018 03:52:01 +0000 (+0000) Subject: Merge "Change the path of images from pre_config/ to images/" X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=releng.git;a=commitdiff_plain;h=abd754f9358035062d977c46b4e9e0a171cf5261;hp=9dfd371891f1aff6198b8c88b15ebe241c921e24 Merge "Change the path of images from pre_config/ to images/" --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..07b28be4b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "jjb/global-jjb"] + path = jjb/global-jjb + url = https://github.com/lfit/releng-global-jjb diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index b8ae75a1f..123db3e85 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -31,7 +31,9 @@ elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then fi # Dev or RPM/ISO build -if [[ "$ARTIFACT_VERSION" =~ dev ]]; then +# For upstream deployments we currently only use git repo and not RPM +# Need to decide after Fraser if we want to use RPM or not for upstream +if [[ "$ARTIFACT_VERSION" =~ dev || "$DEPLOY_SCENARIO" =~ "upstream" ]]; then # Settings for deploying from git workspace DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy" NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network" @@ -134,6 +136,11 @@ else DEPLOY_CMD="${DEPLOY_CMD} -i ${INVENTORY_FILE}" fi +if [[ "$DEPLOY_SCENARIO" =~ "upstream" ]]; then + echo "Upstream deployment detected" + DEPLOY_CMD="${DEPLOY_CMD} --upstream" +fi + if [ "$IPV6_FLAG" == "True" ]; then NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_v6.yaml" elif echo ${DEPLOY_SCENARIO} | grep fdio; then diff --git a/jjb/apex/apex-download-artifact.sh b/jjb/apex/apex-download-artifact.sh index 68baf59da..c12406cdb 100755 --- a/jjb/apex/apex-download-artifact.sh +++ b/jjb/apex/apex-download-artifact.sh @@ -10,7 +10,10 @@ echo [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY -if [[ "$ARTIFACT_VERSION" =~ dev ]]; then +# if upstream we do not need to download anything +if [[ "$DEPLOY_SCENARIO" =~ upstream ]]; then + echo "Upstream deployment detected, skipping download artifact" +elif [[ "$ARTIFACT_VERSION" =~ dev ]]; then # dev build GERRIT_PATCHSET_NUMBER=$(echo $GERRIT_REFSPEC | grep -Eo '[0-9]+$') export OPNFV_ARTIFACT_VERSION="dev${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}" diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index cf29b928c..e19a90e94 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -530,7 +530,7 @@ abort-all-job: false git-revision: false - multijob: - name: Dovetail + name: Dovetail-proposed_tests condition: ALWAYS projects: - name: 'dovetail-apex-baremetal-proposed_tests-{scenario_stream}' @@ -539,7 +539,22 @@ predefined-parameters: DEPLOY_SCENARIO=$DEPLOY_SCENARIO kill-phase-on: NEVER - enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/" + enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/ + && $BUILD_NUMBER % 2 == 1" + abort-all-job: false + git-revision: false + - multijob: + name: Dovetail-default + condition: ALWAYS + projects: + - name: 'dovetail-apex-baremetal-default-{scenario_stream}' + node-parameters: true + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + kill-phase-on: NEVER + enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/ + && $BUILD_NUMBER % 2 == 0" abort-all-job: false git-revision: false - multijob: diff --git a/jjb/apex/apex.yml.j2 b/jjb/apex/apex.yml.j2 index ab65c4e2b..ecc6f270c 100644 --- a/jjb/apex/apex.yml.j2 +++ b/jjb/apex/apex.yml.j2 @@ -408,7 +408,7 @@ abort-all-job: false git-revision: false - multijob: - name: Dovetail + name: Dovetail-proposed_tests condition: ALWAYS projects: - name: 'dovetail-apex-baremetal-proposed_tests-{scenario_stream}' @@ -417,7 +417,22 @@ predefined-parameters: DEPLOY_SCENARIO=$DEPLOY_SCENARIO kill-phase-on: NEVER - enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/" + enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/ + && $BUILD_NUMBER % 2 == 1" + abort-all-job: false + git-revision: false + - multijob: + name: Dovetail-default + condition: ALWAYS + projects: + - name: 'dovetail-apex-baremetal-default-{scenario_stream}' + node-parameters: true + current-parameters: false + predefined-parameters: + DEPLOY_SCENARIO=$DEPLOY_SCENARIO + kill-phase-on: NEVER + enable-condition: "def m = '$DEPLOY_SCENARIO' ==~ /os-(nosdn-nofeature|odl-bgpvpn)-ha/ + && $BUILD_NUMBER % 2 == 0" abort-all-job: false git-revision: false - multijob: diff --git a/jjb/container4nfv/yardstick-arm64.yml b/jjb/container4nfv/yardstick-arm64.yml index bd1d8aa85..03c68738a 100644 --- a/jjb/container4nfv/yardstick-arm64.yml +++ b/jjb/container4nfv/yardstick-arm64.yml @@ -5,7 +5,7 @@ - project: name: yardstick-arm64 - project: '{name}' + project: 'yardstick' # ------------------------------- # BRANCH ANCHORS diff --git a/jjb/daisy4nfv/daisy-daily-jobs.yml b/jjb/daisy4nfv/daisy-daily-jobs.yml index a9a0da2ee..453451f52 100644 --- a/jjb/daisy4nfv/daisy-daily-jobs.yml +++ b/jjb/daisy4nfv/daisy-daily-jobs.yml @@ -190,8 +190,10 @@ - build-blocker: use-build-blocker: true blocking-jobs: - - 'daisy.*-deploy-({pod})?-daily-.*' - 'daisy-kolla-build-.*' + - '{installer}-daily-(build|deploy|test)-(euphrates|master)' + - '{installer}-.*-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)' + - '(functest|yardstick)-{installer}-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)' block-level: 'NODE' parameters: @@ -333,7 +335,7 @@ - trigger: name: 'daisy-os-nosdn-ovs_dpdk-noha-zte-pod9-daily-master-trigger' triggers: - - timed: '0 10 * * *' + - timed: '0 10,20 * * *' # Basic HA Scenarios - trigger: name: 'daisy-os-nosdn-nofeature-ha-zte-pod9-daily-master-trigger' diff --git a/jjb/daisy4nfv/daisy-project-jobs.yml b/jjb/daisy4nfv/daisy-project-jobs.yml index 006153f6f..c4edd7738 100644 --- a/jjb/daisy4nfv/daisy-project-jobs.yml +++ b/jjb/daisy4nfv/daisy-project-jobs.yml @@ -215,6 +215,13 @@ enabled: true max-total: 6 option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - '{installer}-daily-(build|deploy|test)-(euphrates|master)' + - '{installer}-.*-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)' + - '(functest|yardstick)-{installer}-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)' + block-level: 'NODE' scm: - git-scm diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index ba76b8abb..8c04ffd53 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -19,7 +19,7 @@ installer: - 'apex' - 'fuel' - # - 'joid' + - 'daisy' arch: - 'x86_64' @@ -29,19 +29,17 @@ - 'sample' - 'congress' - task: - - verify: - auto-trigger-name: 'doctor-verify' - exclude: - installer: 'apex' arch: 'aarch64' + - installer: 'daisy' + arch: 'aarch64' jobs: - 'doctor-verify-{stream}' - 'doctor-verify-unit-test-{stream}' - - 'doctor-{task}-{inspector}-{stream}' - - 'doctor-{task}-{installer}-{inspector}-{arch}-{stream}' + - 'doctor-verify-{inspector}-{stream}' + - 'doctor-verify-{installer}-{inspector}-{arch}-{stream}' - job-template: name: 'doctor-verify-{stream}' @@ -76,6 +74,7 @@ file-paths: - compare-type: ANT pattern: 'doctor_tests/**' + builders: - shell: | #!/bin/bash @@ -117,16 +116,17 @@ - 'doctor-verify-unit-test-publishers-macro' - job-template: - name: 'doctor-{task}-{inspector}-{stream}' + name: 'doctor-verify-{inspector}-{stream}' disabled: '{obj:disabled}' project-type: 'multijob' scm: - git-scm-gerrit triggers: - - '{auto-trigger-name}': + - 'doctor-verify': project: '{project}' branch: '{branch}' files: 'doctor_tests/**' + builders: - shell: | #!/bin/bash @@ -137,7 +137,7 @@ name: 'doctor-verify-apex-inspector' execution-type: PARALLEL projects: - - name: 'doctor-{task}-apex-{inspector}-x86_64-{stream}' + - name: 'doctor-verify-apex-{inspector}-x86_64-{stream}' predefined-parameters: | PROJECT=$PROJECT GERRIT_BRANCH=$GERRIT_BRANCH @@ -151,7 +151,7 @@ name: 'doctor-verify-fuel-inspector' execution-type: PARALLEL projects: - - name: 'doctor-{task}-fuel-{inspector}-x86_64-{stream}' + - name: 'doctor-verify-fuel-{inspector}-x86_64-{stream}' predefined-parameters: | PROJECT=$PROJECT GERRIT_BRANCH=$GERRIT_BRANCH @@ -165,7 +165,20 @@ name: 'doctor-verify-fuel-inspector' execution-type: PARALLEL projects: - - name: 'doctor-{task}-fuel-{inspector}-aarch64-{stream}' + - name: 'doctor-verify-fuel-{inspector}-aarch64-{stream}' + predefined-parameters: | + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + kill-phase-on: FAILURE + current-parameters: true + git-revision: true + - multijob: + name: 'doctor-verify-daisy-inspector' + execution-type: PARALLEL + projects: + - name: 'doctor-verify-daisy-{inspector}-x86_64-{stream}' predefined-parameters: | PROJECT=$PROJECT GERRIT_BRANCH=$GERRIT_BRANCH @@ -177,7 +190,7 @@ git-revision: true - job-template: - name: 'doctor-{task}-{installer}-{inspector}-{arch}-{stream}' + name: 'doctor-verify-{installer}-{inspector}-{arch}-{stream}' disabled: '{obj:disabled}' node: 'doctor-{installer}-{arch}' wrappers: diff --git a/jjb/global-jjb b/jjb/global-jjb new file mode 160000 index 000000000..779110b5c --- /dev/null +++ b/jjb/global-jjb @@ -0,0 +1 @@ +Subproject commit 779110b5cd63f3eabb63598a1be79d9b9ba85464 diff --git a/jjb/global/slave-params.yml b/jjb/global/slave-params.yml index 86b369bcd..6171a6abd 100644 --- a/jjb/global/slave-params.yml +++ b/jjb/global/slave-params.yml @@ -983,6 +983,7 @@ - 'doctor-fuel-x86_64' - 'doctor-fuel-aarch64' - 'doctor-joid-x86_64' + - 'doctor-daisy-x86_64' - 'not-specified' default-slaves: - 'not-specified' 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,13 +297,10 @@ 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' @@ -218,52 +316,91 @@ - string: 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-run-functest.sh b/jjb/xci/xci-run-functest.sh index 60b48cf7f..1f616de1f 100755 --- a/jjb/xci/xci-run-functest.sh +++ b/jjb/xci/xci-run-functest.sh @@ -51,7 +51,7 @@ if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENT exit 0 fi -ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci/xci && PATH=/home/devuser/.local/bin:$PATH ansible-playbook -i installer/osa/files/$XCI_FLAVOR/inventory playbooks/prepare-functest.yml" +ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "cd /root/releng-xci/xci/playbooks && ansible-playbook -i inventory prepare-functest.yml" echo "Running functest" ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm_opnfv "/root/run-functest.sh" echo "Functest log" 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..d78dc82d9 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}-.*' @@ -110,6 +110,12 @@ forbidden-file-paths: - compare-type: ANT pattern: 'xci/scripts/vm/**' + - compare-type: ANT + pattern: 'docs/**' + - compare-type: ANT + pattern: 'prototypes/**' + - compare-type: ANT + pattern: 'upstream/**' - project-compare-type: 'REG_EXP' project-pattern: 'sfc|sdnvpn' branches: diff --git a/modules/opnfv/deployment/compass/adapter_container.py b/modules/opnfv/deployment/compass/adapter_container.py new file mode 100644 index 000000000..1713fe274 --- /dev/null +++ b/modules/opnfv/deployment/compass/adapter_container.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python + +# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + +from opnfv.deployment import manager +from opnfv.utils import opnfv_logger as logger +from opnfv.utils import ssh_utils + +import yaml +import os + +logger = logger.Logger(__name__).getLogger() + + +class ContainerizedCompassAdapter(): + + def __init__(self, installer_ip, installer_user, pkey_file): + + self.installer = 'compass' + self.installer_ip = installer_ip + self.installer_user = installer_user + self.pkey_file = pkey_file + self.DST_PATH_UC = "/tmp/openstack_user_config.yml" + self.nodes = [] + self.ROLES = {} + + if pkey_file is not None and not os.path.isfile(pkey_file): + raise Exception( + 'The private key file %s does not exist!' % pkey_file) + + def _find_nodes(self, file): + nodes = file['compute_hosts'] + for compute in nodes: + self.ROLES[compute] = 'compute' + controllers = file['haproxy_hosts'] + for controller in controllers: + nodes[controller] = controllers[controller] + self.ROLES[controller] = 'controller' + return nodes + + def _process_nodes(self, raw_nodes): + nodes = [] + + for node in raw_nodes: + name = node + ip = raw_nodes[node]['ip'] + status = 'active' + id = None + if self.ROLES[node] == 'controller': + roles = 'controller' + elif self.ROLES[node] == 'compute': + roles = 'compute' + ssh_client = ssh_utils.get_ssh_client(hostname=ip, + username=self.installer_user, + pkey_file=self.pkey_file) + node = manager.Node(id, ip, name, status, roles, ssh_client) + nodes.append(node) + + return nodes + + def get_nodes(self, options=None): + try: + # if we have retrieved previously all the nodes, don't do it again + # This fails the first time when the constructor calls this method + # therefore the try/except + if len(self.nodes) > 0: + return self.nodes + except: + pass + + with open(self.DST_PATH_UC, 'r') as stream: + try: + file = yaml.load(stream) + raw_nodes = self._find_nodes(file) + except yaml.YAMLError as exc: + logger.error(exc) + self.nodes = self._process_nodes(raw_nodes) + return self.nodes diff --git a/modules/opnfv/deployment/factory.py b/modules/opnfv/deployment/factory.py index 2788e5eaa..1fd8d447b 100644 --- a/modules/opnfv/deployment/factory.py +++ b/modules/opnfv/deployment/factory.py @@ -9,7 +9,7 @@ from opnfv.deployment.apex import adapter as apex_adapter -from opnfv.deployment.compass import adapter as compass_adapter +from opnfv.deployment.compass import adapter_container as compass_adapter from opnfv.deployment.fuel import adapter as fuel_adapter from opnfv.deployment.osa import adapter as osa_adapter from opnfv.deployment.daisy import adapter as daisy_adapter @@ -44,10 +44,10 @@ class Factory(object): installer_user=installer_user, installer_pwd=installer_pwd) elif installer.lower() == "compass": - return compass_adapter.CompassAdapter( + return compass_adapter.ContainerizedCompassAdapter( installer_ip=installer_ip, installer_user=installer_user, - installer_pwd=installer_pwd) + pkey_file=pkey_file) elif installer.lower() == "osa": return osa_adapter.OSAAdapter(installer_ip=installer_ip, installer_user=installer_user,