diff options
96 files changed, 2204 insertions, 1230 deletions
diff --git a/.gitignore b/.gitignore index 024dfac4b..91ccabc4b 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ wheels/ .venv/ venv/ ENV/ +node_modules/ diff --git a/docs/jenkins-job-builder/opnfv-jjb-usage.rst b/docs/jenkins-job-builder/opnfv-jjb-usage.rst index 73b31b20a..fc968f841 100644 --- a/docs/jenkins-job-builder/opnfv-jjb-usage.rst +++ b/docs/jenkins-job-builder/opnfv-jjb-usage.rst @@ -39,11 +39,24 @@ Job Types * Trigger: **remerge** +* Experimental Job + + * Trigger: **check-experimental** + The verify and merge jobs are retriggerable in Gerrit by simply leaving a comment with one of the keywords listed above. This is useful in case you need to re-run one of those jobs in case if build issues or something changed with the environment. +The experimental jobs are not triggered automatically. You need to leave +a comment with the keyword list above to trigger it manually. It is useful +for trying out experimental features. + +Note that, experimental jobs `skip vote`_ for verified status, which means +it will reset the verified status to 0. If you want to keep the verified +status, use **recheck-experimental** in commit message to trigger both +verify and experimental jobs. + You can add below persons as reviewers to your patch in order to get it reviewed and submitted. @@ -67,3 +80,5 @@ in `releng-jobs.yaml`_. .. _releng-jobs.yaml: https://gerrit.opnfv.org/gerrit/gitweb?p=releng.git;a=blob;f=jjb/releng-jobs.yaml; +.. _skip vote: + https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger#GerritTrigger-SkipVote
\ No newline at end of file diff --git a/jjb/3rd_party_ci/create-apex-vms.sh b/jjb/3rd_party_ci/create-apex-vms.sh index 3f5dbd1c4..0744ac89a 100755 --- a/jjb/3rd_party_ci/create-apex-vms.sh +++ b/jjb/3rd_party_ci/create-apex-vms.sh @@ -1,12 +1,8 @@ #!/bin/bash -set -e +set -o errexit +set -o nounset +set -o pipefail -if [ -z ${WORKSPACE} ]; then - echo "WORKSPACE is unset. Please do so." - exit 1 -fi -# wipe the WORKSPACE -/bin/rm -rf $WORKSPACE/* # clone opnfv sdnvpn repo git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git $WORKSPACE/sdnvpn diff --git a/jjb/3rd_party_ci/download-netvirt-artifact.sh b/jjb/3rd_party_ci/download-netvirt-artifact.sh index be2d4059a..fe8066cb8 100755 --- a/jjb/3rd_party_ci/download-netvirt-artifact.sh +++ b/jjb/3rd_party_ci/download-netvirt-artifact.sh @@ -1,12 +1,7 @@ #!/bin/bash -set -e - -if [ -z ${WORKSPACE} ]; then - echo "WORKSPACE is unset. Please do so." - exit 1 -fi -# wipe the WORKSPACE -/bin/rm -rf $WORKSPACE/* +set -o errexit +set -o nounset +set -o pipefail echo "Attempting to fetch the artifact location from ODL Jenkins" CHANGE_DETAILS_URL="https://git.opendaylight.org/gerrit/changes/netvirt~master~$GERRIT_CHANGE_ID/detail" diff --git a/jjb/3rd_party_ci/install-netvirt.sh b/jjb/3rd_party_ci/install-netvirt.sh index c9aa4c501..ce2a50cd0 100755 --- a/jjb/3rd_party_ci/install-netvirt.sh +++ b/jjb/3rd_party_ci/install-netvirt.sh @@ -1,12 +1,4 @@ #!/bin/bash -set -e - -if [ -z ${WORKSPACE} ]; then - echo "WORKSPACE is unset. Please set." - exit 1 -fi -# wipe the WORKSPACE -/bin/rm -rf $WORKSPACE/* set -o errexit set -o nounset set -o pipefail diff --git a/jjb/3rd_party_ci/odl-netvirt.yml b/jjb/3rd_party_ci/odl-netvirt.yml index 6e25425ba..f3a4c0236 100644 --- a/jjb/3rd_party_ci/odl-netvirt.yml +++ b/jjb/3rd_party_ci/odl-netvirt.yml @@ -48,6 +48,14 @@ max-per-node: 1 option: 'project' + scm: + - git: + url: https://gerrit.opnfv.org/gerrit/apex + branches: + - 'origin/master' + timeout: 15 + wipe-workspace: true + parameters: - project-parameter: project: '{project}' @@ -171,6 +179,14 @@ timeout: 360 fail: true + scm: + - git: + url: https://gerrit.opnfv.org/gerrit/apex + branches: + - 'origin/master' + timeout: 15 + wipe-workspace: true + parameters: - project-parameter: project: '{project}' @@ -181,6 +197,10 @@ name: DEPLOY_SCENARIO default: 'os-odl_l2-bgpvpn-noha' description: 'Scenario to deploy and test' + - string: + name: GS_URL + default: artifacts.opnfv.org/apex + description: "URL to Google Storage with snapshot artifacts." builders: - description-setter: diff --git a/jjb/3rd_party_ci/postprocess-netvirt.sh b/jjb/3rd_party_ci/postprocess-netvirt.sh index 5baf378a9..796514259 100755 --- a/jjb/3rd_party_ci/postprocess-netvirt.sh +++ b/jjb/3rd_party_ci/postprocess-netvirt.sh @@ -1,12 +1,8 @@ #!/bin/bash -set -e +set -o errexit +set -o nounset +set -o pipefail -if [ -z ${WORKSPACE} ]; then - echo "WORKSPACE is unset. Please do so." - exit 1 -fi -# wipe the WORKSPACE -/bin/rm -rf $WORKSPACE/* # clone opnfv sdnvpn repo git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git $WORKSPACE/sdnvpn . $WORKSPACE/sdnvpn/odl-pipeline/odl-pipeline-common.sh diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 9535e7fb7..b68225f15 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -62,6 +62,21 @@ fi if [ -z "$DEPLOY_SCENARIO" ]; then echo "Deploy scenario not set!" exit 1 +elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then + echo "Detecting Gating scenario..." + if [ -z "$GERRIT_EVENT_COMMENT_TEXT" ]; then + echo "ERROR: Gate job triggered without comment!" + exit 1 + else + DEPLOY_SCENARIO=$(echo ${GERRIT_EVENT_COMMENT_TEXT} | grep start-gate-scenario | grep -Eo 'os-.*$') + if [ -z "$DEPLOY_SCENARIO" ]; then + echo "ERROR: Unable to detect scenario in Gerrit Comment!" + echo "Format of comment to trigger gate should be 'start-gate-scenario: <scenario>'" + exit 1 + else + echo "Gate scenario detected: ${DEPLOY_SCENARIO}" + fi + fi fi # use local build for verify and csit promote @@ -203,6 +218,16 @@ fi # start deployment sudo ${DEPLOY_CMD} -d ${DEPLOY_FILE} -n ${NETWORK_FILE} --debug +if [[ "$JOB_NAME" == *csit* ]]; then + echo "CSIT job: setting host route for floating ip routing" + # csit route to allow docker container to reach floating ips + UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo "[0-9\.]+{3}[0-9]+") + if sudo route | grep 192.168.37.128 > /dev/null; then + sudo route del -net 192.168.37.128 netmask 255.255.255.128 + fi + sudo route add -net 192.168.37.128 netmask 255.255.255.128 gw ${UNDERCLOUD} +fi + echo echo "--------------------------------------------------------" echo "Done!" diff --git a/jjb/apex/apex-snapshot-create.sh b/jjb/apex/apex-snapshot-create.sh index 09c6a1197..f146dd810 100644 --- a/jjb/apex/apex-snapshot-create.sh +++ b/jjb/apex/apex-snapshot-create.sh @@ -26,17 +26,18 @@ mkdir -p ${tmp_dir} pushd ${tmp_dir} > /dev/null echo "Copying overcloudrc and ssh key from Undercloud..." # Store overcloudrc -UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]') -scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:overcloudrc ./ +UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+') +sudo scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:overcloudrc ./ # Copy out ssh key of stack from undercloud -scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:.ssh/id_rsa ./ +sudo scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:.ssh/id_rsa ./ popd > /dev/null echo "Gathering introspection information" git clone https://gerrit.opnfv.org/gerrit/sdnvpn.git pushd sdnvpn/odl-pipeline/lib > /dev/null -./tripleo_introspector.sh --out-file ${tmp_dir}/node.yaml +sudo ./tripleo_introspector.sh --out-file ${tmp_dir}/node.yaml popd > /dev/null +sudo rm -rf sdnvpn echo "Shutting down nodes" # Shut down nodes @@ -63,10 +64,11 @@ for node in $nodes; do fi done +pushd ${tmp_dir} > /dev/null echo "Gathering virsh definitions" # copy qcow2s, virsh definitions for node in $nodes; do - cp -f /var/lib/libvirt/images/${node}.qcow2 ./ + sudo cp -f /var/lib/libvirt/images/${node}.qcow2 ./ sudo virsh dumpxml ${node} > ${node}.xml done @@ -75,11 +77,13 @@ for net in admin api external storage tenant; do sudo virsh net-dumpxml ${net} > ${net}.xml done +sudo chown jenkins-ci:jenkins-ci * + # tar up artifacts DATE=`date +%Y-%m-%d` tar czf ../apex-csit-snap-${DATE}.tar.gz . popd > /dev/null -rm -rf ./.tmp +sudo rm -rf ${tmp_dir} echo "Snapshot saved as apex-csit-snap-${DATE}.tar.gz" # update opnfv properties file diff --git a/jjb/apex/apex-snapshot-deploy.sh b/jjb/apex/apex-snapshot-deploy.sh index 3bb65a0b3..a99955f9a 100644 --- a/jjb/apex/apex-snapshot-deploy.sh +++ b/jjb/apex/apex-snapshot-deploy.sh @@ -21,8 +21,7 @@ echo "--------------------------" echo echo "Cleaning server" -git clone https://gerrit.opnfv.org/gerrit/apex.git -pushd apex/ci > /dev/null +pushd ci > /dev/null sudo CONFIG=../build/ LIB=../lib ./clean.sh popd > /dev/null diff --git a/jjb/apex/apex-upload-artifact.sh b/jjb/apex/apex-upload-artifact.sh index 89fd5ed36..ef8ad5329 100755 --- a/jjb/apex/apex-upload-artifact.sh +++ b/jjb/apex/apex-upload-artifact.sh @@ -81,7 +81,7 @@ uploadsnap () { echo "Upload complete for Snapshot" } -if grep csit $WORKSPACE; then +if echo $WORKSPACE | grep csit > /dev/null; then uploadsnap elif gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then echo "Signing Key avaliable" diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index fcf08ed86..e3f0f53bc 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -2,6 +2,7 @@ name: apex jobs: - 'apex-verify-{stream}' + - 'apex-verify-gate-{stream}' - 'apex-verify-unit-tests-{stream}' - 'apex-runner-{platform}-{scenario}-{stream}' - 'apex-runner-cperf-{stream}' @@ -45,6 +46,7 @@ - 'os-odl_l3-fdio_dvr-ha' - 'os-odl_l3-csit-noha' - 'os-onos-nofeature-ha' + - 'gate' platform: - 'baremetal' @@ -206,6 +208,86 @@ same-node: true - 'apex-workspace-cleanup' +# Verify Scenario Gate +- job-template: + name: 'apex-verify-gate-{stream}' + + node: '{verify-slave}' + + concurrent: true + + parameters: + - apex-parameter: + gs-pathname: '{gs-pathname}' + - project-parameter: + project: '{project}' + branch: '{branch}' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: "Used for overriding the GIT URL coming from parameters macro." + + scm: + - git-scm-gerrit + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - comment-added-contains-event: + comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*' + projects: + - project-compare-type: 'ANT' + project-pattern: 'apex' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'ci/**' + - compare-type: ANT + pattern: 'build/**' + - compare-type: ANT + pattern: 'lib/**' + - compare-type: ANT + pattern: 'config/**' + + properties: + - logrotate-default + - build-blocker: + use-build-blocker: true + block-level: 'NODE' + blocking-jobs: + - 'apex-daily.*' + - 'apex-deploy.*' + - 'apex-build.*' + - 'apex-runner.*' + - 'apex-verify.*' + - throttle: + max-per-node: 1 + max-total: 10 + option: 'project' + + builders: + - 'apex-build' + - trigger-builds: + - project: 'apex-deploy-virtual-gate-{stream}' + predefined-parameters: | + BUILD_DIRECTORY=apex-verify-gate-{stream} + OPNFV_CLEAN=yes + current-parameters: true + git-revision: false + block: true + same-node: true + - trigger-builds: + - project: 'functest-apex-{verify-slave}-suite-{stream}' + predefined-parameters: | + DEPLOY_SCENARIO=os-nosdn-nofeature-ha + FUNCTEST_SUITE_NAME=healthcheck + block: true + same-node: true + - 'apex-workspace-cleanup' + - job-template: name: 'apex-runner-{platform}-{scenario}-{stream}' @@ -560,8 +642,36 @@ build-step-failure-threshold: 'never' failure-threshold: 'never' unstable-threshold: 'FAILURE' - - + - trigger-builds: + - project: 'apex-deploy-baremetal-os-odl-bgpvpn-ha-{stream}' + predefined-parameters: | + BUILD_DIRECTORY=apex-build-{stream}/.build + OPNFV_CLEAN=yes + git-revision: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + block: true + - trigger-builds: + - project: 'functest-apex-{daily-slave}-daily-{stream}' + predefined-parameters: + DEPLOY_SCENARIO=os-odl-bgpvpn-ha + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' + - trigger-builds: + - project: 'yardstick-apex-{slave}-daily-{stream}' + predefined-parameters: + DEPLOY_SCENARIO=os-odl-bgpvpn-ha + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' # Colorado Build - job-template: name: 'apex-build-colorado' diff --git a/jjb/armband/armband-project-jobs.yml b/jjb/armband/armband-project-jobs.yml index 0fb5e4e63..fd37c5af6 100644 --- a/jjb/armband/armband-project-jobs.yml +++ b/jjb/armband/armband-project-jobs.yml @@ -41,7 +41,7 @@ - project-parameter: project: '{project}' branch: '{branch}' - - 'opnfv-build-arm-defaults' + - 'opnfv-build-enea-defaults' - '{installer}-defaults' - armband-project-parameter: gs-pathname: '{gs-pathname}' diff --git a/jjb/armband/armband-verify-jobs.yml b/jjb/armband/armband-verify-jobs.yml index 05146a35c..3486718e4 100644 --- a/jjb/armband/armband-verify-jobs.yml +++ b/jjb/armband/armband-verify-jobs.yml @@ -21,13 +21,13 @@ ##################################### phase: - 'basic': - slave-label: 'opnfv-build-arm' + slave-label: 'opnfv-build-enea' - 'build': - slave-label: 'opnfv-build-arm' + slave-label: 'opnfv-build-enea' - 'deploy-virtual': - slave-label: 'opnfv-build-arm' + slave-label: 'opnfv-build-enea' - 'smoke-test': - slave-label: 'opnfv-build-arm' + slave-label: 'opnfv-build-enea' ##################################### # jobs ##################################### @@ -95,7 +95,7 @@ - project-parameter: project: '{project}' branch: '{branch}' - - 'opnfv-build-arm-defaults' + - 'opnfv-build-enea-defaults' - 'armband-verify-defaults': gs-pathname: '{gs-pathname}' diff --git a/jjb/bottlenecks/bottlenecks-ci-jobs.yml b/jjb/bottlenecks/bottlenecks-ci-jobs.yml index 582f40c31..a9ccd6977 100644 --- a/jjb/bottlenecks/bottlenecks-ci-jobs.yml +++ b/jjb/bottlenecks/bottlenecks-ci-jobs.yml @@ -72,6 +72,7 @@ suite: - 'rubbos' - 'vstf' + - 'posca' jobs: - 'bottlenecks-{installer}-{suite}-{pod}-daily-{stream}' diff --git a/jjb/bottlenecks/bottlenecks-project-jobs.yml b/jjb/bottlenecks/bottlenecks-project-jobs.yml index 535edafc2..12ea31b13 100644 --- a/jjb/bottlenecks/bottlenecks-project-jobs.yml +++ b/jjb/bottlenecks/bottlenecks-project-jobs.yml @@ -29,6 +29,7 @@ suite: - 'rubbos' - 'vstf' + - 'posca' ################################ # job templates diff --git a/jjb/compass4nfv/compass-ci-jobs.yml b/jjb/compass4nfv/compass-ci-jobs.yml index 6c9686a1d..7258e89f4 100644 --- a/jjb/compass4nfv/compass-ci-jobs.yml +++ b/jjb/compass4nfv/compass-ci-jobs.yml @@ -41,8 +41,8 @@ #-------------------------------- # master #-------------------------------- - - huawei-pod5: - slave-label: '{pod}' + - baremetal-centos: + slave-label: 'intel-pod8' os-version: 'centos7' <<: *master @@ -220,12 +220,6 @@ - shell: !include-raw-escape: ./compass-deploy.sh - publishers: - - archive: - artifacts: 'ansible.log' - allow-empty: 'true' - fingerprint: true - ######################## # parameter macros ######################## @@ -249,35 +243,35 @@ # trigger macros ######################## - trigger: - name: 'compass-os-nosdn-nofeature-ha-huawei-pod5-master-trigger' + name: 'compass-os-nosdn-nofeature-ha-baremetal-centos-master-trigger' triggers: - timed: '0 19 * * *' - trigger: - name: 'compass-os-odl_l2-nofeature-ha-huawei-pod5-master-trigger' + name: 'compass-os-odl_l2-nofeature-ha-baremetal-centos-master-trigger' triggers: - timed: '0 23 * * *' - trigger: - name: 'compass-os-odl_l3-nofeature-ha-huawei-pod5-master-trigger' + name: 'compass-os-odl_l3-nofeature-ha-baremetal-centos-master-trigger' triggers: - timed: '0 15 * * *' - trigger: - name: 'compass-os-onos-nofeature-ha-huawei-pod5-master-trigger' + name: 'compass-os-onos-nofeature-ha-baremetal-centos-master-trigger' triggers: - timed: '0 7 * * *' - trigger: - name: 'compass-os-ocl-nofeature-ha-huawei-pod5-master-trigger' + name: 'compass-os-ocl-nofeature-ha-baremetal-centos-master-trigger' triggers: - timed: '0 11 * * *' - trigger: - name: 'compass-os-onos-sfc-ha-huawei-pod5-master-trigger' + name: 'compass-os-onos-sfc-ha-baremetal-centos-master-trigger' triggers: - timed: '0 3 * * *' - trigger: - name: 'compass-os-odl_l2-moon-ha-huawei-pod5-master-trigger' + name: 'compass-os-odl_l2-moon-ha-baremetal-centos-master-trigger' triggers: - timed: '' - trigger: - name: 'compass-os-nosdn-kvm-ha-huawei-pod5-master-trigger' + name: 'compass-os-nosdn-kvm-ha-baremetal-centos-master-trigger' triggers: - timed: '' diff --git a/jjb/compass4nfv/compass-deploy.sh b/jjb/compass4nfv/compass-deploy.sh index f89d04e6d..6696e4b3d 100644 --- a/jjb/compass4nfv/compass-deploy.sh +++ b/jjb/compass4nfv/compass-deploy.sh @@ -65,7 +65,4 @@ echo echo "--------------------------------------------------------" echo "Done!" -ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -sshpass -p root scp 2>/dev/null $ssh_options root@${INSTALLER_IP}:/var/ansible/run/openstack_${OPENSTACK_VERSION}-opnfv2/ansible.log ./ &> /dev/null - exit $deploy_ret diff --git a/jjb/compass4nfv/compass-dovetail-jobs.yml b/jjb/compass4nfv/compass-dovetail-jobs.yml index 0fd2f9e66..d49d0ec5f 100644 --- a/jjb/compass4nfv/compass-dovetail-jobs.yml +++ b/jjb/compass4nfv/compass-dovetail-jobs.yml @@ -28,7 +28,7 @@ scenario: - 'os-nosdn-nofeature-ha': disabled: false - auto-trigger-name: 'dovetail-weekly-trigger' + auto-trigger-name: 'compass-{scenario}-{pod}-weekly-{stream}-trigger' jobs: - 'compass-{scenario}-{pod}-weekly-{stream}' @@ -63,7 +63,7 @@ - project-parameter: project: '{project}' branch: '{branch}' - - compass-ci-parameter: + - compass-dovetail-parameter: installer: '{installer}' gs-pathname: '{gs-pathname}' - string: @@ -153,7 +153,7 @@ - project-parameter: project: '{project}' branch: '{branch}' - - compass-ci-parameter: + - compass-dovetail-parameter: installer: '{installer}' gs-pathname: '{gs-pathname}' - '{slave-label}-defaults' @@ -175,12 +175,6 @@ - shell: !include-raw-escape: ./compass-deploy.sh - publishers: - - archive: - artifacts: 'ansible.log' - allow-empty: 'true' - fingerprint: true - ######################## # parameter macros ######################## @@ -206,4 +200,9 @@ - trigger: name: 'compass-os-nosdn-nofeature-ha-baremetal-weekly-colorado-trigger' triggers: - - timed: '' + - timed: 'H H * * 0' + +- trigger: + name: 'dovetail-weekly-trigger' + triggers: + - timed: 'H H * * 0' diff --git a/jjb/compass4nfv/compass-verify-jobs.yml b/jjb/compass4nfv/compass-verify-jobs.yml index f4df6709d..d58138088 100644 --- a/jjb/compass4nfv/compass-verify-jobs.yml +++ b/jjb/compass4nfv/compass-verify-jobs.yml @@ -190,11 +190,6 @@ description: "Built on $NODE_NAME" - '{project}-verify-{phase}-macro' - publishers: - - archive: - artifacts: 'ansible.log' - allow-empty: 'true' - fingerprint: true ##################################### # builder macros ##################################### diff --git a/jjb/daisy4nfv/daisy-project-jobs.yml b/jjb/daisy4nfv/daisy-project-jobs.yml new file mode 100644 index 000000000..f712adb0a --- /dev/null +++ b/jjb/daisy4nfv/daisy-project-jobs.yml @@ -0,0 +1,232 @@ +###################################################################### +# Add daily jobs, for buidoing, deploying and testing +# TODO: +# - [ ] Add yardstick and functest for test stage +# - [x] Use daisy-baremetal-defauls for choosing baremetal deployment +###################################################################### + +############################# +# Job configuration for daisy +############################# +- project: + name: daisy-project-jobs + + project: 'daisy' + + installer: 'daisy' + + stream: + - master: + branch: '{stream}' + gs-pathname: '' + disabled: false + - danube: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + disabled: true + + phase: + - 'build': + slave-label: 'opnfv-build-centos' + - 'deploy': + slave-label: 'daisy-baremetal' + - 'test': + slave-label: 'opnfv-build-centos' + jobs: + - '{installer}-daily-{stream}' + - '{installer}-{phase}-daily-{stream}' + +######################## +# job templates +######################## +- job-template: + name: '{installer}-daily-{stream}' + + project-type: multijob + + disabled: false + + concurrent: true + + properties: + - logrotate-default + - throttle: + enabled: true + max-total: 4 + option: 'project' + + scm: + - git-scm + + triggers: + - timed: '0 H/8 * * *' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-centos-defaults' + - 'daisy-defaults' + - '{installer}-project-parameter': + gs-pathname: '{gs-pathname}' + + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 360 + fail: true + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - multijob: + name: build + condition: SUCCESSFUL + projects: + - name: '{installer}-build-daily-{stream}' + current-parameters: false + predefined-parameters: | + BRANCH=$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 + - multijob: + name: deploy + condition: SUCCESSFUL + projects: + - name: '{installer}-deploy-daily-{stream}' + current-parameters: false + predefined-parameters: | + BRANCH=$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 + - multijob: + name: test + condition: SUCCESSFUL + projects: + - name: '{installer}-test-daily-{stream}' + current-parameters: false + predefined-parameters: | + BRANCH=$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 + + publishers: + - '{installer}-recipients' + +- job-template: + name: '{installer}-{phase}-daily-{stream}' + + disabled: '{obj:disabled}' + + concurrent: true + + properties: + - logrotate-default + - throttle: + enabled: true + max-total: 6 + option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - '{installer}-.*deploy-.*' + block-level: 'NODE' + + scm: + - git-scm + + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 360 + fail: true + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'daisy-defaults' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + - string: + name: DEPLOY_SCENARIO + default: 'os-nosdn-nofeature-ha' + - 'daisy-defaults' + - '{slave-label}-defaults' + - '{installer}-project-parameter': + gs-pathname: '{gs-pathname}' + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - '{installer}-{phase}-daily-macro' + +##################################### +# builder macros +##################################### +- builder: + name: 'daisy-build-daily-macro' + builders: + - shell: + !include-raw-escape: ./daisy4nfv-basic.sh + - shell: + !include-raw-escape: ./daisy4nfv-build.sh + - shell: + !include-raw-escape: ./daisy4nfv-upload-artifact.sh + - shell: + !include-raw-escape: ./daisy4nfv-workspace-cleanup.sh + +- builder: + name: 'daisy-deploy-daily-macro' + builders: + - shell: + !include-raw-escape: ./daisy4nfv-download-artifact.sh + - shell: + !include-raw-escape: ./daisy4nfv-deploy.sh + +- builder: + name: 'daisy-test-daily-macro' + builders: + - shell: | + #!/bin/bash + + echo "Not activated!" + +##################################### +# parameter macros +##################################### +- publisher: + name: 'daisy-recipients' + publishers: + - email: + recipients: hu.zhijiang@zte.com.cn lu.yao135@zte.com.cn zhou.ya@zte.com.cn yangyang1@zte.com.cn julienjut@gmail.com + +- parameter: + name: 'daisy-project-parameter' + parameters: + - string: + name: BUILD_DIRECTORY + default: $WORKSPACE/build_output + description: "Directory where the build artifact will be located upon the completion of the build." + - string: + name: CACHE_DIRECTORY + default: $HOME/opnfv/cache/$INSTALLER_TYPE + description: "Directory where the cache to be used during the build is located." + - string: + name: GS_URL + default: artifacts.opnfv.org/$PROJECT{gs-pathname} + description: "URL to Google Storage." diff --git a/jjb/daisy4nfv/daisy4nfv-deploy.sh b/jjb/daisy4nfv/daisy4nfv-deploy.sh new file mode 100755 index 000000000..cc2c10388 --- /dev/null +++ b/jjb/daisy4nfv/daisy4nfv-deploy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Daisy deployment WIP" diff --git a/jjb/daisy4nfv/daisy4nfv-merge-jobs.yml b/jjb/daisy4nfv/daisy4nfv-merge-jobs.yml index 72e25b23a..a6659b2bf 100644 --- a/jjb/daisy4nfv/daisy4nfv-merge-jobs.yml +++ b/jjb/daisy4nfv/daisy4nfv-merge-jobs.yml @@ -2,6 +2,14 @@ name: 'daisy4nfv-merge-jobs' project: 'daisy' + + installer: 'daisy' + +########################################################### +# use alias to keep the jobs'name existed already unchanged +########################################################### + alias: 'daisy4nfv' + ##################################### # branch definitions ##################################### @@ -10,31 +18,29 @@ branch: '{stream}' gs-pathname: '' disabled: false + - danube: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + disabled: true ##################################### # patch merge phases ##################################### phase: - - 'basic': - slave-label: 'opnfv-build-centos' - 'build': slave-label: 'opnfv-build-centos' - 'deploy-virtual': slave-label: 'opnfv-build-centos' - - 'smoke-test': - slave-label: 'opnfv-build-centos' - - 'promote': - slave-label: 'opnfv-build-centos' ##################################### # jobs ##################################### jobs: - - 'daisy4nfv-merge-{stream}' - - 'daisy4nfv-merge-{phase}-{stream}' + - '{alias}-merge-{stream}' + - '{alias}-merge-{phase}-{stream}' ##################################### # job templates ##################################### - job-template: - name: 'daisy4nfv-merge-{stream}' + name: '{alias}-merge-{stream}' project-type: multijob @@ -66,46 +72,41 @@ - comment-added-contains-event: comment-contains-value: 'remerge' projects: - - project-compare-type: 'ANT' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - forbidden-file-paths: - - compare-type: ANT - pattern: 'docs/**|.gitignore' + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'ci/**' + - compare-type: ANT + pattern: 'code/**' + - compare-type: ANT + pattern: 'deploy/**' + forbidden-file-paths: + - compare-type: ANT + pattern: 'docs/**' + - compare-type: ANT + pattern: '.gitignore' readable-message: true parameters: - project-parameter: project: '{project}' branch: '{branch}' - - 'opnfv-build-defaults' - - 'daisy4nfv-merge-defaults': + - 'opnfv-build-centos-defaults' + - '{alias}-merge-defaults': gs-pathname: '{gs-pathname}' builders: - description-setter: description: "Built on $NODE_NAME" - multijob: - name: basic - condition: SUCCESSFUL - projects: - - name: 'daisy4nfv-merge-basic-{stream}' - current-parameters: false - predefined-parameters: | - BRANCH=$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 - - multijob: name: build condition: SUCCESSFUL projects: - - name: 'daisy4nfv-merge-build-{stream}' + - name: '{alias}-merge-build-{stream}' current-parameters: false predefined-parameters: | BRANCH=$BRANCH @@ -119,35 +120,7 @@ name: deploy-virtual condition: SUCCESSFUL projects: - - name: 'daisy4nfv-merge-deploy-virtual-{stream}' - current-parameters: false - predefined-parameters: | - BRANCH=$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 - - multijob: - name: smoke-test - condition: SUCCESSFUL - projects: - - name: 'daisy4nfv-merge-smoke-test-{stream}' - current-parameters: false - predefined-parameters: | - BRANCH=$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 - - multijob: - name: promote - condition: SUCCESSFUL - projects: - - name: 'daisy4nfv-merge-promote-{stream}' + - name: '{alias}-merge-deploy-virtual-{stream}' current-parameters: false predefined-parameters: | BRANCH=$BRANCH @@ -159,7 +132,7 @@ abort-all-job: true - job-template: - name: 'daisy4nfv-merge-{phase}-{stream}' + name: '{alias}-merge-{phase}-{stream}' disabled: '{obj:disabled}' @@ -169,13 +142,12 @@ - logrotate-default - throttle: enabled: true - max-total: 6 + max-total: 4 option: 'project' - build-blocker: use-build-blocker: true blocking-jobs: - - 'daisy4nfv-merge-deploy-.*' - - 'daisy4nfv-merge-test-.*' + - '{alias}-merge-deploy-.*' block-level: 'NODE' scm: @@ -192,55 +164,39 @@ project: '{project}' branch: '{branch}' - '{slave-label}-defaults' - - 'daisy4nfv-merge-defaults': + - '{alias}-merge-defaults': gs-pathname: '{gs-pathname}' builders: - description-setter: description: "Built on $NODE_NAME" - '{project}-merge-{phase}-macro' + ##################################### # builder macros ##################################### - builder: - name: 'daisy-merge-basic-macro' + name: 'daisy-merge-build-macro' builders: - shell: !include-raw: ./daisy4nfv-basic.sh - -- builder: - name: 'daisy-merge-build-macro' - builders: - shell: - !include-raw: - - ./daisy4nfv-build.sh - - ./daisy4nfv-upload-artifact.sh - - ./daisy4nfv-workspace-cleanup.sh + !include-raw: ./daisy4nfv-build.sh + - shell: + !include-raw: ./daisy4nfv-upload-artifact.sh + - shell: + !include-raw: ./daisy4nfv-workspace-cleanup.sh - builder: name: 'daisy-merge-deploy-virtual-macro' builders: - shell: - !include-raw: - - ./daisy4nfv-download-artifact.sh - - ./daisy4nfv-virtual-deploy.sh - - ./daisy4nfv-workspace-cleanup.sh - -- builder: - name: 'daisy-merge-smoke-test-macro' - builders: - - shell: | - #!/bin/bash - - echo "Not activated!" - -- builder: - name: 'daisy-merge-promote-macro' - builders: - - shell: | - #!/bin/bash + !include-raw: ./daisy4nfv-download-artifact.sh + - shell: + !include-raw: ./daisy4nfv-virtual-deploy.sh + - shell: + !include-raw: ./daisy4nfv-workspace-cleanup.sh - echo "Not activated!" ##################################### # parameter macros ##################################### diff --git a/jjb/daisy4nfv/daisy4nfv-verify-jobs.yml b/jjb/daisy4nfv/daisy4nfv-verify-jobs.yml index fd36d20b6..febce6f82 100644 --- a/jjb/daisy4nfv/daisy4nfv-verify-jobs.yml +++ b/jjb/daisy4nfv/daisy4nfv-verify-jobs.yml @@ -2,6 +2,14 @@ name: 'daisy4nfv-verify-jobs' project: 'daisy' + + installer: 'daisy' + +########################################################## +# use alias to keep the jobs'name existed alread unchanged +########################################################## + alias: 'daisy4nfv' + ##################################### # branch definitions ##################################### @@ -10,29 +18,27 @@ branch: '{stream}' gs-pathname: '' disabled: false + - danube: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + disabled: true ##################################### # patch verification phases ##################################### phase: - - 'basic': - slave-label: 'opnfv-build-centos' - 'build': slave-label: 'opnfv-build-centos' - - 'deploy-virtual': - slave-label: 'opnfv-build' - - 'smoke-test': - slave-label: 'opnfv-build' ##################################### # jobs ##################################### jobs: - - 'daisy4nfv-verify-{stream}' - - 'daisy4nfv-verify-{phase}-{stream}' + - '{alias}-verify-{stream}' + - '{alias}-verify-{phase}-{stream}' ##################################### # job templates ##################################### - job-template: - name: 'daisy4nfv-verify-{stream}' + name: '{alias}-verify-{stream}' project-type: multijob @@ -48,7 +54,7 @@ option: 'project' scm: - - git-scm-gerrit + - git-scm wrappers: - ssh-agent-wrapper @@ -70,74 +76,41 @@ - comment-added-contains-event: comment-contains-value: 'reverify' projects: - - project-compare-type: 'ANT' - project-pattern: '{project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - forbidden-file-paths: - - compare-type: ANT - pattern: 'docs/**|.gitignore' + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'ci/**' + - compare-type: ANT + pattern: 'code/**' + - compare-type: ANT + pattern: 'deploy/**' + forbidden-file-paths: + - compare-type: ANT + pattern: 'docs/**' + - compare-type: ANT + pattern: '.gitignore' readable-message: true parameters: - project-parameter: project: '{project}' branch: '{branch}' - - 'opnfv-build-defaults' - - 'daisy4nfv-verify-defaults': + - 'opnfv-build-centos-defaults' + - '{alias}-verify-defaults': gs-pathname: '{gs-pathname}' builders: - description-setter: description: "Built on $NODE_NAME" - multijob: - name: basic - condition: SUCCESSFUL - projects: - - name: 'daisy4nfv-verify-basic-{stream}' - current-parameters: false - predefined-parameters: | - BRANCH=$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 - - multijob: name: build condition: SUCCESSFUL projects: - - name: 'daisy4nfv-verify-build-{stream}' - current-parameters: false - predefined-parameters: | - BRANCH=$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 - - multijob: - name: deploy-virtual - condition: SUCCESSFUL - projects: - - name: 'daisy4nfv-verify-deploy-virtual-{stream}' - current-parameters: false - predefined-parameters: | - BRANCH=$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 - - multijob: - name: smoke-test - condition: SUCCESSFUL - projects: - - name: 'daisy4nfv-verify-smoke-test-{stream}' + - name: '{alias}-verify-build-{stream}' current-parameters: false predefined-parameters: | BRANCH=$BRANCH @@ -149,7 +122,7 @@ abort-all-job: true - job-template: - name: 'daisy4nfv-verify-{phase}-{stream}' + name: '{alias}-verify-{phase}-{stream}' disabled: '{obj:disabled}' @@ -164,12 +137,11 @@ - build-blocker: use-build-blocker: true blocking-jobs: - - 'daisy4nfv-verify-deploy-.*' - - 'daisy4nfv-verify-test-.*' + - '{alias}-verify-deploy-.*' block-level: 'NODE' scm: - - git-scm-gerrit + - git-scm wrappers: - ssh-agent-wrapper @@ -182,41 +154,27 @@ project: '{project}' branch: '{branch}' - '{slave-label}-defaults' - - 'daisy4nfv-verify-defaults': + - '{alias}-verify-defaults': gs-pathname: '{gs-pathname}' builders: - description-setter: description: "Built on $NODE_NAME" - '{project}-verify-{phase}-macro' + ##################################### # builder macros ##################################### - builder: - name: 'daisy-verify-basic-macro' - builders: - - shell: - !include-raw: ./daisy4nfv-basic.sh - -- builder: name: 'daisy-verify-build-macro' builders: - shell: - !include-raw: ./daisy4nfv-build.sh - -- builder: - name: 'daisy-verify-deploy-virtual-macro' - builders: + !include-raw-escape: ./daisy4nfv-basic.sh - shell: - !include-raw: ./daisy4nfv-virtual-deploy.sh - -- builder: - name: 'daisy-verify-smoke-test-macro' - builders: - - shell: | - #!/bin/bash + !include-raw-escape: ./daisy4nfv-build.sh + - shell: + !include-raw-escape: ./daisy4nfv-workspace-cleanup.sh - echo "Not activated!" ##################################### # parameter macros ##################################### diff --git a/jjb/daisy4nfv/daisy4nfv-virtual-deploy.sh b/jjb/daisy4nfv/daisy4nfv-virtual-deploy.sh index 4aa7b0bd5..ef4a07b8d 100755 --- a/jjb/daisy4nfv/daisy4nfv-virtual-deploy.sh +++ b/jjb/daisy4nfv/daisy4nfv-virtual-deploy.sh @@ -15,7 +15,7 @@ else exit 0 fi -./ci/deploy/deploy.sh ${DHA_CONF} ${NETWORK_CONF} +sudo ./ci/deploy/deploy.sh -d ${DHA_CONF} -n ${NETWORK_CONF} -p ${NODE_NAME:-"zte-virtual1"} if [ $? -ne 0 ]; then echo "depolyment failed!" diff --git a/jjb/dovetail/dovetail-ci-jobs.yml b/jjb/dovetail/dovetail-ci-jobs.yml index 4d92980af..e2a334d40 100644 --- a/jjb/dovetail/dovetail-ci-jobs.yml +++ b/jjb/dovetail/dovetail-ci-jobs.yml @@ -126,8 +126,8 @@ #-------------------------------- # None-CI PODs #-------------------------------- - - huawei-pod5: - slave-label: '{pod}' + - baremetal-centos: + slave-label: 'intel-pod8' SUT: compass auto-trigger-name: 'daily-trigger-disabled' <<: *master @@ -180,7 +180,7 @@ parameters: - project-parameter: project: '{project}' - branch: '{branch}' + branch: '{dovetail-branch}' - '{SUT}-defaults' - '{slave-label}-defaults' - string: diff --git a/jjb/dovetail/dovetail-weekly-jobs.yml b/jjb/dovetail/dovetail-weekly-jobs.yml index 66c05e243..8edce4246 100644 --- a/jjb/dovetail/dovetail-weekly-jobs.yml +++ b/jjb/dovetail/dovetail-weekly-jobs.yml @@ -82,7 +82,7 @@ parameters: - project-parameter: project: '{project}' - branch: '{branch}' + branch: '{dovetail-branch}' - '{sut}-defaults' - '{slave-label}-defaults' - string: diff --git a/jjb/fuel/fuel-daily-jobs.yml b/jjb/fuel/fuel-daily-jobs.yml index a9af1bcba..f78c4a317 100644 --- a/jjb/fuel/fuel-daily-jobs.yml +++ b/jjb/fuel/fuel-daily-jobs.yml @@ -83,6 +83,8 @@ auto-trigger-name: 'daily-trigger-disabled' - 'os-nosdn-kvm_ovs_dpdk-ha': auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger' + - 'os-nosdn-kvm_ovs_dpdk_bar-ha': + auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger' # NOHA scenarios - 'os-nosdn-nofeature-noha': auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger' @@ -278,11 +280,15 @@ - trigger: name: 'fuel-os-odl_l2-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 23 * * *' + - timed: '5 23 * * *' - trigger: name: 'fuel-os-odl_l3-nofeature-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 2 * * *' + - timed: '5 2 * * *' +- trigger: + name: 'fuel-os-nosdn-ovs-ha-baremetal-daily-master-trigger' + triggers: + - timed: '5 5 * * *' - trigger: name: 'fuel-os-onos-sfc-ha-baremetal-daily-master-trigger' triggers: @@ -294,7 +300,7 @@ - trigger: name: 'fuel-os-odl_l2-sfc-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 11 * * *' + - timed: '5 11 * * *' - trigger: name: 'fuel-os-odl_l2-bgpvpn-ha-baremetal-daily-master-trigger' triggers: @@ -302,15 +308,15 @@ - trigger: name: 'fuel-os-nosdn-kvm-ha-baremetal-daily-master-trigger' triggers: - - timed: '' # '5 17 * * *' -- trigger: - name: 'fuel-os-nosdn-ovs-ha-baremetal-daily-master-trigger' - triggers: - - timed: '5 20 * * *' + - timed: '5 17 * * *' - trigger: name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-baremetal-daily-master-trigger' triggers: - timed: '30 12 * * *' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-baremetal-daily-master-trigger' + triggers: + - timed: '30 8 * * *' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-baremetal-daily-master-trigger' @@ -396,6 +402,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-baremetal-daily-danube-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-baremetal-daily-danube-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-baremetal-daily-danube-trigger' @@ -480,6 +490,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-virtual-daily-master-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-virtual-daily-master-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-virtual-daily-master-trigger' @@ -496,11 +510,11 @@ - trigger: name: 'fuel-os-onos-sfc-noha-virtual-daily-master-trigger' triggers: - - timed: '35 20 * * *' + - timed: '' # '35 20 * * *' - trigger: name: 'fuel-os-onos-nofeature-noha-virtual-daily-master-trigger' triggers: - - timed: '5 23 * * *' + - timed: '' # '5 23 * * *' - trigger: name: 'fuel-os-odl_l2-sfc-noha-virtual-daily-master-trigger' triggers: @@ -564,6 +578,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-virtual-daily-danube-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-virtual-daily-danube-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-virtual-daily-danube-trigger' @@ -648,6 +666,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod1-daily-master-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod1-daily-master-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-zte-pod1-daily-master-trigger' @@ -733,6 +755,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod2-daily-master-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod2-daily-master-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-zte-pod2-daily-master-trigger' @@ -817,6 +843,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod3-daily-master-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod3-daily-master-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-zte-pod3-daily-master-trigger' @@ -901,6 +931,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod1-daily-danube-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod1-daily-danube-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-zte-pod1-daily-danube-trigger' @@ -986,6 +1020,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod2-daily-danube-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod2-daily-danube-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-zte-pod2-daily-danube-trigger' @@ -1070,6 +1108,10 @@ name: 'fuel-os-nosdn-kvm_ovs_dpdk-ha-zte-pod3-daily-danube-trigger' triggers: - timed: '' +- trigger: + name: 'fuel-os-nosdn-kvm_ovs_dpdk_bar-ha-zte-pod3-daily-danube-trigger' + triggers: + - timed: '' # NOHA Scenarios - trigger: name: 'fuel-os-nosdn-nofeature-noha-zte-pod3-daily-danube-trigger' diff --git a/jjb/functest/functest-ci-jobs.yml b/jjb/functest/functest-ci-jobs.yml index 7478e2a86..49901bea2 100644 --- a/jjb/functest/functest-ci-jobs.yml +++ b/jjb/functest/functest-ci-jobs.yml @@ -133,8 +133,8 @@ slave-label: '{pod}' installer: joid <<: *master - - huawei-pod5: - slave-label: '{pod}' + - baremetal-centos: + slave-label: 'intel-pod8' installer: compass <<: *master - nokia-pod1: @@ -234,7 +234,7 @@ - string: name: CLEAN_DOCKER_IMAGES default: 'false' - description: 'Remove downloaded docker images (opnfv/functest:*)' + description: 'Remove downloaded docker images (opnfv/functest*:*)' - functest-parameter: gs-pathname: '{gs-pathname}' @@ -347,6 +347,8 @@ - 'functest-cleanup' - 'set-functest-env' - 'functest-suite' + - 'functest-store-results' + - 'functest-exit' - builder: name: functest-daily diff --git a/jjb/functest/functest-cleanup.sh b/jjb/functest/functest-cleanup.sh index b03d4778d..3ef9b90dd 100755 --- a/jjb/functest/functest-cleanup.sh +++ b/jjb/functest/functest-cleanup.sh @@ -3,8 +3,13 @@ [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" echo "Cleaning up docker containers/images..." +HOST_ARCH=$(uname -m) FUNCTEST_IMAGE=opnfv/functest -# Remove containers along with image opnfv/functest:<none> +if [ "$HOST_ARCH" = "aarch64" ]; then + FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" +fi + +# Remove containers along with image opnfv/functest*:<none> dangling_images=($(docker images -f "dangling=true" | grep $FUNCTEST_IMAGE | awk '{print $3}')) if [[ -n ${dangling_images} ]]; then echo " Removing $FUNCTEST_IMAGE:<none> images and their containers..." diff --git a/jjb/functest/functest-suite.sh b/jjb/functest/functest-suite.sh index 28d7e3d10..f28d3d037 100755 --- a/jjb/functest/functest-suite.sh +++ b/jjb/functest/functest-suite.sh @@ -13,5 +13,7 @@ container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1) docker exec $container_id $cmd ret_value=$? +ret_val_file="${HOME}/opnfv/functest/results/${BRANCH##*/}/return_value" +echo ${ret_value}>${ret_val_file} -exit $ret_value +exit 0 diff --git a/jjb/functest/set-functest-env.sh b/jjb/functest/set-functest-env.sh index afd656f52..5224793dc 100755 --- a/jjb/functest/set-functest-env.sh +++ b/jjb/functest/set-functest-env.sh @@ -70,17 +70,22 @@ envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}" +HOST_ARCH=$(uname -m) +FUNCTEST_IMAGE="opnfv/functest" +if [ "$HOST_ARCH" = "aarch64" ]; then + FUNCTEST_IMAGE="${FUNCTEST_IMAGE}_${HOST_ARCH}" +fi -echo "Functest: Pulling image opnfv/functest:${DOCKER_TAG}" -docker pull opnfv/functest:$DOCKER_TAG >/dev/null +echo "Functest: Pulling image ${FUNCTEST_IMAGE}:${DOCKER_TAG}" +docker pull ${FUNCTEST_IMAGE}:$DOCKER_TAG >/dev/null cmd="sudo docker run --privileged=true -id ${envs} ${volumes} \ ${custom_params} ${TESTCASE_OPTIONS} \ - opnfv/functest:${DOCKER_TAG} /bin/bash" + ${FUNCTEST_IMAGE}:${DOCKER_TAG} /bin/bash" echo "Functest: Running docker run command: ${cmd}" ${cmd} >${redirect} sleep 5 -container_id=$(docker ps | grep "opnfv/functest:${DOCKER_TAG}" | awk '{print $1}' | head -1) +container_id=$(docker ps | grep "${FUNCTEST_IMAGE}:${DOCKER_TAG}" | awk '{print $1}' | head -1) echo "Container ID=${container_id}" if [ -z ${container_id} ]; then echo "Cannot find opnfv/functest container ID ${container_id}. Please check if it is existing." @@ -91,8 +96,8 @@ echo "Starting the container: docker start ${container_id}" docker start ${container_id} sleep 5 docker ps >${redirect} -if [ $(docker ps | grep "opnfv/functest:${DOCKER_TAG}" | wc -l) == 0 ]; then - echo "The container opnfv/functest with ID=${container_id} has not been properly started. Exiting..." +if [ $(docker ps | grep "${FUNCTEST_IMAGE}:${DOCKER_TAG}" | wc -l) == 0 ]; then + echo "The container ${FUNCTEST_IMAGE} with ID=${container_id} has not been properly started. Exiting..." exit 1 fi if [[ "$BRANCH" =~ 'brahmaputra' ]]; then diff --git a/jjb/global/installer-params.yml b/jjb/global/installer-params.yml index 6e965a9cb..c3e775681 100644 --- a/jjb/global/installer-params.yml +++ b/jjb/global/installer-params.yml @@ -89,6 +89,19 @@ name: CPU_ARCHITECTURE default: 'amd64' description: "CPU Architecture to use for Ubuntu distro " + +- parameter: + name: 'daisy-defaults' + parameters: + - string: + name: INSTALLER_IP + default: '10.20.0.2' + description: 'IP of the installer' + - string: + name: INSTALLER_TYPE + default: daisy + description: 'Installer used for deploying OPNFV on this POD' + - parameter: name: 'infra-defaults' parameters: diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index 06152fe6b..9b09e315f 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -68,13 +68,13 @@ - timed: '' - trigger: - name: 'dovetail-weekly-trigger' + name: 'weekly-trigger-disabled' triggers: - - timed: 'H H * * 0' + - timed: '' # NOTE: unused macro, but we may use this for some jobs. - trigger: - name: gerrit-trigger-patch-submitted + name: gerrit-trigger-patchset-created triggers: - gerrit: server-name: 'gerrit.opnfv.org' @@ -88,14 +88,13 @@ comment-contains-value: 'recheck' projects: - project-compare-type: 'ANT' - project-pattern: '{name}' + project-pattern: '{project}' branches: - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' -# NOTE: unused macro, but we may use this for some jobs. - trigger: - name: gerrit-trigger-patch-merged + name: gerrit-trigger-change-merged triggers: - gerrit: server-name: 'gerrit.opnfv.org' @@ -105,7 +104,7 @@ comment-contains-value: 'remerge' projects: - project-compare-type: 'ANT' - project-pattern: '{name}' + project-pattern: '{project}' branches: - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' diff --git a/jjb/global/slave-params.yml b/jjb/global/slave-params.yml index c87fc289c..429828e8e 100644 --- a/jjb/global/slave-params.yml +++ b/jjb/global/slave-params.yml @@ -178,6 +178,23 @@ name: EXTERNAL_NETWORK default: ext-net description: "External network floating ips" +- parameter: + name: 'daisy-baremetal-defaults' + parameters: + - node: + name: SLAVE_NAME + description: 'Slave name on Jenkins' + allowed-slaves: + - zte-pod2 + default-slaves: + - zte-pod2 + - label: + name: SLAVE_LABEL + default: 'daisy-baremetal' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' ##################################################### # Parameters for CI virtual PODs ##################################################### @@ -239,15 +256,33 @@ name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' +- parameter: + name: 'daisy-virtual-defaults' + parameters: + - node: + name: SLAVE_NAME + description: 'Slave name on Jenkins' + allowed-slaves: + - zte-virtual1 + - zte-virtual2 + default-slaves: + - zte-virtual1 + - label: + name: SLAVE_LABEL + default: 'daisy-virtual' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' ##################################################### # Parameters for build slaves ##################################################### - parameter: - name: 'opnfv-build-arm-defaults' + name: 'opnfv-build-enea-defaults' parameters: - label: name: SLAVE_LABEL - default: 'opnfv-build-arm' + default: 'opnfv-build-enea' - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT @@ -314,6 +349,21 @@ name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' +- parameter: + name: 'opnfv-build-ubuntu-arm-defaults' + parameters: + - label: + name: SLAVE_LABEL + default: 'opnfv-build-ubuntu-arm' + description: 'Slave label on Jenkins' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + - string: + name: BUILD_DIRECTORY + default: $WORKSPACE/build_output + description: "Directory where the build artifact will be located upon the completion of the build." ##################################################### # Parameters for none-CI PODs ##################################################### @@ -392,15 +442,15 @@ default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' - parameter: - name: 'intel-pod3-defaults' + name: 'intel-pod12-defaults' parameters: - node: name: SLAVE_NAME description: 'Slave name on Jenkins' allowed-slaves: - - intel-pod3 + - intel-pod12 default-slaves: - - intel-pod3 + - intel-pod12 - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT @@ -440,15 +490,15 @@ default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' - parameter: - name: 'huawei-pod5-defaults' + name: 'intel-pod8-defaults' parameters: - node: name: SLAVE_NAME description: 'Slave name on Jenkins' allowed-slaves: - - huawei-pod5 + - intel-pod8 default-slaves: - - huawei-pod5 + - intel-pod8 - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT diff --git a/jjb/infra/bifrost-verify.sh b/jjb/infra/bifrost-verify.sh index 94c7dacfa..4115ffcc4 100755 --- a/jjb/infra/bifrost-verify.sh +++ b/jjb/infra/bifrost-verify.sh @@ -24,8 +24,9 @@ function upload_logs() { # before we upload the new data. gsutil -q rm ${BIFROST_GS_URL}/index.html || true + echo "Uploading collected bifrost build logs to ${BIFROST_LOG_URL}" + if [[ -d ${WORKSPACE}/logs ]]; then - echo "Uploading collected bifrost logs to ${BIFROST_LOG_URL}" pushd ${WORKSPACE}/logs &> /dev/null for x in *.log; do echo "Compressing and uploading $x" @@ -34,7 +35,7 @@ function upload_logs() { popd &> /dev/null fi - echo "Generating the landing page" + echo "Generating the ${BIFROST_LOG_URL}/index.html landing page" cat > ${WORKSPACE}/index.html <<EOF <html> <h1>Build results for <a href=https://$GERRIT_NAME/#/c/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER>$GERRIT_NAME/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER</a></h1> @@ -58,7 +59,7 @@ EOF # Finally, download and upload the entire build log so we can retain # as much build information as possible - echo "Uploading console output" + echo "Uploading the final console output" curl -s -L ${BIFROST_CONSOLE_LOG} > ${WORKSPACE}/build_log.txt gsutil -q cp -Z ${WORKSPACE}/build_log.txt ${BIFROST_GS_URL}/build_log.txt rm ${WORKSPACE}/build_log.txt diff --git a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh index 6f8fff3ff..56fb4f9c1 100755 --- a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh +++ b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh @@ -11,16 +11,17 @@ fi case "$JOB_TYPE" in verify) - OPNFV_ARTIFACT_VERSION="gerrit-$GERRIT_CHANGE_NUMBER" - GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER" - echo "Removing outdated artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER" - gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION - echo "Uploading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..." - ;; + OPNFV_ARTIFACT_VERSION="gerrit-$GERRIT_CHANGE_NUMBER" + GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER" + echo "Removing outdated artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER" + gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION + echo "Uploading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..." + ;; daily) echo "Uploading daily artifacts This could take some time..." OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S") GS_UPLOAD_LOCATION="gs://$GS_URL/$OPNFV_ARTIFACT_VERSION" + GS_LOG_LOCATION="gs://$GS_URL/logs-$(date -u +"%Y-%m-%d")"/ ;; *) echo "Artifact upload is not enabled for $JOB_TYPE jobs" @@ -38,10 +39,23 @@ esac source $WORKSPACE/opnfv.properties # upload artifacts -gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1 -gsutil -m setmeta -r \ - -h "Cache-Control:private, max-age=0, no-transform" \ - $GS_UPLOAD_LOCATION > /dev/null 2>&1 +if [[ "$PHASE" == "build" ]]; then + gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1 + gsutil -m setmeta -r \ + -h "Cache-Control:private, max-age=0, no-transform" \ + $GS_UPLOAD_LOCATION > /dev/null 2>&1 +else + if [[ "$JOB_TYPE" == "daily" ]]; then + log_dir=$WORKSPACE/build_output/log + if [[ -d "$log_dir" ]]; then + #Uploading logs to artifacts + echo "Uploading artifacts for future debugging needs...." + gsutil cp -r $WORKSPACE/build_output/log-*.tar.gz $GS_LOG_LOCATION > $WORKSPACE/gsutil.log 2>&1 + else + echo "No test logs/artifacts available for uploading" + fi + fi +fi # upload metadata file for the artifacts built by daily job if [[ "$JOB_TYPE" == "daily" ]]; then diff --git a/jjb/kvmfornfv/kvmfornfv.yml b/jjb/kvmfornfv/kvmfornfv.yml index 157f2dcc4..a782ee0fa 100644 --- a/jjb/kvmfornfv/kvmfornfv.yml +++ b/jjb/kvmfornfv/kvmfornfv.yml @@ -131,6 +131,10 @@ - '{slave-label}-defaults' - 'kvmfornfv-defaults': gs-pathname: '{gs-pathname}' + - string: + name: PHASE + default: '{phase}' + description: "Execution of kvmfornfv daily '{phase}' job ." builders: - description-setter: @@ -264,6 +268,10 @@ name: TEST_NAME default: '{testname}' description: "Daily job to execute kvmfornfv '{testname}' testcase." + - string: + name: PHASE + default: '{phase}' + description: "Execution of kvmfornfv daily '{phase}' job ." builders: - description-setter: @@ -300,6 +308,8 @@ !include-raw: ./kvmfornfv-download-artifact.sh - shell: !include-raw: ./kvmfornfv-test.sh + - shell: + !include-raw: ./kvmfornfv-upload-artifact.sh - builder: name: 'kvmfornfv-packet_forward-daily-build-macro' builders: diff --git a/jjb/openretriever/openretriever-project.yml b/jjb/openretriever/openretriever-project.yml new file mode 100644 index 000000000..3d53f9b2e --- /dev/null +++ b/jjb/openretriever/openretriever-project.yml @@ -0,0 +1,62 @@ +################################################### +# All the jobs except verify have been removed! +# They will only be enabled on request by projects! +################################################### +- project: + name: openretriever + + project: '{name}' + + jobs: + - 'openretriever-verify-{stream}' + + stream: + - master: + branch: '{stream}' + gs-pathname: '' + disabled: false + - danube: + branch: 'stable/{stream}' + gs-pathname: '/{stream}' + disabled: false + +- job-template: + name: 'openretriever-verify-{stream}' + + disabled: '{obj:disabled}' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-ubuntu-defaults' + + scm: + - git-scm-gerrit + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + forbidden-file-paths: + - compare-type: ANT + pattern: 'docs/**|.gitignore' + + builders: + - shell: | + echo "Nothing to verify!" diff --git a/jjb/opera/opera-daily-jobs.yml b/jjb/opera/opera-daily-jobs.yml index f1ea1aa74..d49caf1a6 100644 --- a/jjb/opera/opera-daily-jobs.yml +++ b/jjb/opera/opera-daily-jobs.yml @@ -52,7 +52,7 @@ - ssh-agent-wrapper - timeout: - timeout: 120 + timeout: 240 fail: true triggers: diff --git a/jjb/opnfvdocs/project.cfg b/jjb/opnfvdocs/project.cfg index 186e0ea74..1ea05c1d4 100644 --- a/jjb/opnfvdocs/project.cfg +++ b/jjb/opnfvdocs/project.cfg @@ -24,6 +24,7 @@ movie multisite octopus onosfw +openretriever ovno ovsnfv parser diff --git a/jjb/qtip/qtip-cleanup.sh b/jjb/qtip/helpers/cleanup-deploy.sh index 95babb318..95babb318 100644 --- a/jjb/qtip/qtip-cleanup.sh +++ b/jjb/qtip/helpers/cleanup-deploy.sh diff --git a/jjb/qtip/qtip-daily-ci.sh b/jjb/qtip/helpers/validate-deploy.sh index 4fdc04345..16455371f 100644 --- a/jjb/qtip/qtip-daily-ci.sh +++ b/jjb/qtip/helpers/validate-deploy.sh @@ -27,12 +27,7 @@ if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then else echo "The container ID is: ${container_id}" QTIP_REPO=/home/opnfv/repos/qtip - - echo "Run Qtip test" - docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh - - echo "Pushing available results to DB" - docker exec -t ${container_id} $QTIP_REPO/docker/push_db.sh +# TODO(yujunz): execute benchmark plan for compute-qpi fi echo "Qtip done!" diff --git a/jjb/qtip/helpers/validate-setup.sh b/jjb/qtip/helpers/validate-setup.sh new file mode 100644 index 000000000..8d84e120c --- /dev/null +++ b/jjb/qtip/helpers/validate-setup.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +############################################################################## +# Copyright (c) 2017 ZTE 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 +############################################################################## + +set -e + +# setup virtualenv +sudo pip install -u virtualenv virtualenvwrapper +export WORKON_HOME=$HOME/.virtualenvs +source /usr/local/bin/virtualenvwrapper.sh +mkvirtualenv qtip +workon qtip + +# setup qtip +sudo pip install $HOME/repos/qtip + +# testing +qtip --version +qtip --help diff --git a/jjb/qtip/qtip-ci-jobs.yml b/jjb/qtip/qtip-ci-jobs.yml deleted file mode 100644 index 38f9955ec..000000000 --- a/jjb/qtip/qtip-ci-jobs.yml +++ /dev/null @@ -1,100 +0,0 @@ -#################################### -# job configuration for qtip -#################################### -- project: - name: qtip - - project: 'qtip' - -#-------------------------------- -# BRANCH ANCHORS -#-------------------------------- - master: &master - stream: master - branch: '{stream}' - gs-pathname: '' - docker-tag: 'latest' -#-------------------------------- -# POD, INSTALLER, AND BRANCH MAPPING -#-------------------------------- -# master -#-------------------------------- - pod: - - zte-pod2: - installer: fuel - auto-trigger-name: 'qtip-daily-zte-pod2-trigger' - <<: *master - - zte-pod3: - installer: fuel - auto-trigger-name: 'qtip-daily-zte-pod3-trigger' - <<: *master - -#-------------------------------- - jobs: - - 'qtip-{installer}-{pod}-daily-{stream}' - -################################ -# job templates -################################ -- job-template: - name: 'qtip-{installer}-{pod}-daily-{stream}' - - disabled: false - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - '{installer}-defaults' - - '{pod}-defaults' - - string: - name: DEPLOY_SCENARIO - default: 'os-nosdn-nofeature-ha' - - string: - name: DOCKER_TAG - default: '{docker-tag}' - description: 'Tag to pull docker image' - - scm: - - git-scm - - triggers: - - '{auto-trigger-name}' - - builders: - - description-setter: - description: "POD: $NODE_NAME" - - 'qtip-cleanup' - - 'qtip-daily-ci' - - publishers: - - email: - recipients: wu.zhihui1@zte.com.cn, zhang.yujunz@zte.com.cn - -########################### -#biuilder macros -########################### -- builder: - name: qtip-daily-ci - builders: - - shell: - !include-raw: ./qtip-daily-ci.sh - -- builder: - name: qtip-cleanup - builders: - - shell: - !include-raw: ./qtip-cleanup.sh - -################# -#trigger macros -################# -- trigger: - name: 'qtip-daily-zte-pod2-trigger' - triggers: - - timed: '0 7 * * *' - -- trigger: - name: 'qtip-daily-zte-pod3-trigger' - triggers: - - timed: '0 1 * * *' diff --git a/jjb/qtip/qtip-validate-jobs.yml b/jjb/qtip/qtip-validate-jobs.yml new file mode 100644 index 000000000..98f7ab90a --- /dev/null +++ b/jjb/qtip/qtip-validate-jobs.yml @@ -0,0 +1,141 @@ +####################### +# validate after MERGE +####################### +- project: + name: qtip + project: qtip + +#-------------------------------- +# BRANCH ANCHORS +#-------------------------------- + master: &master + stream: master + branch: '{stream}' + gs-pathname: '' + docker-tag: latest + +#-------------------------------- +# JOB VARIABLES +#-------------------------------- + pod: + - zte-pod2: + installer: fuel + <<: *master + - zte-pod3: + installer: fuel + <<: *master + task: + - daily: + auto-builder-name: qtip-validate-deploy + auto-trigger-name: 'qtip-daily-{pod}-trigger' + - validate: + auto-builder-name: qtip-validate-setup + auto-trigger-name: qtip-validate-trigger + - experimental: + auto-builder-name: qtip-validate-setup + auto-trigger-name: experimental + +#-------------------------------- +# JOB LIST +#-------------------------------- + jobs: + - 'qtip-{task}-{installer}-{pod}-{stream}' + +################################ +# job templates +################################ +- job-template: + name: 'qtip-{task}-{installer}-{pod}-{stream}' + disabled: false + parameters: + - qtip-common-parameters: + project: '{project}' + <<: *master + - '{installer}-defaults' + - '{pod}-defaults' + scm: + - git-scm + triggers: + - '{auto-trigger-name}' + builders: + - qtip-common-builders + - '{auto-builder-name}' + publishers: + - qtip-common-publishers + +################ +# MARCOS +################ + +#--------- +# builder +#--------- + +- builder: + name: qtip-common-builders + builders: + - description-setter: + description: "POD: $NODE_NAME" + +- builder: + name: qtip-validate-deploy + builders: + - shell: + !include-raw: ./helpers/validate-deploy.sh + - shell: + !include-raw: ./helpers/cleanup-deploy.sh + +- builder: + name: qtip-validate-setup + builders: + - shell: + !include-raw: ./helpers/validate-setup.sh + +#----------- +# parameter +#----------- + +- parameter: + name: qtip-common-parameters + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - string: + name: DEPLOY_SCENARIO + default: 'os-nosdn-nofeature-ha' + - string: + name: DOCKER_TAG + default: '{docker-tag}' + description: 'Tag to pull docker image' + +#----------- +# publisher +#----------- + +- publisher: + name: qtip-common-publishers + publishers: + - email: + recipients: wu.zhihui1@zte.com.cn, zhang.yujunz@zte.com.cn + +#--------- +# trigger +#--------- + +- trigger: + name: qtip-daily-zte-pod2-trigger + triggers: + - timed: '0 7 * * *' + +- trigger: + name: qtip-daily-zte-pod3-trigger + triggers: + - timed: '0 1 * * *' + +- trigger: + name: qtip-validate-trigger + triggers: + - gerrit-trigger-change-merged: + project: '{project}' + branch: '{branch}' diff --git a/jjb/qtip/qtip-project-jobs.yml b/jjb/qtip/qtip-verify-jobs.yml index 00455f8b3..d1fc34d11 100644 --- a/jjb/qtip/qtip-project-jobs.yml +++ b/jjb/qtip/qtip-verify-jobs.yml @@ -1,11 +1,12 @@ -- project: - name: qtip-project-jobs - - project: 'qtip' +###################### +# verify before MERGE +###################### +- project: + name: qtip-verify-jobs + project: qtip jobs: - 'qtip-verify-{stream}' - stream: - master: branch: '{stream}' diff --git a/jjb/releng/opnfv-docker-arm.yml b/jjb/releng/opnfv-docker-arm.yml new file mode 100644 index 000000000..09c9f335e --- /dev/null +++ b/jjb/releng/opnfv-docker-arm.yml @@ -0,0 +1,77 @@ +############################################## +# job configuration for docker build and push +############################################## + +- project: + + name: opnfv-docker-arm + + master: &master + stream: master + branch: '{stream}' + disabled: false + danube: &danube + stream: danube + branch: 'stable/{stream}' + disabled: true + functest-arm-receivers: &functest-arm-receivers + receivers: > + cristina.pauna@enea.com + alexandru.avadanii@enea.com + other-receivers: &other-receivers + receivers: '' + + project: + # projects with jobs for master + - 'functest': + <<: *master + <<: *functest-arm-receivers + # projects with jobs for stable + + jobs: + - '{project}-docker-build-arm-push-{stream}' + +######################## +# job templates +######################## +- job-template: + name: '{project}-docker-build-arm-push-{stream}' + + disabled: '{obj:disabled}' + + parameters: ¶meters + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-ubuntu-arm-defaults' + - string: + name: PUSH_IMAGE + default: "true" + description: "To enable/disable pushing the image to Dockerhub." + - string: + name: DOCKER_REPO_NAME + default: "opnfv/{project}_aarch64" + description: "Dockerhub repo to be pushed to." + - string: + name: RELEASE_VERSION + default: "" + description: "Release version, e.g. 1.0, 2.0, 3.0" + - string: + name: DOCKERFILE + default: "Dockerfile.aarch64" + description: "Dockerfile to use for creating the image." + + scm: + - git-scm + + builders: &builders + - shell: + !include-raw-escape: ./opnfv-docker.sh + + triggers: + - pollscm: + cron: "*/30 * * * *" + + publishers: + - email: + recipients: '{receivers}' diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index 40669bcb7..c906e1fcd 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -12,6 +12,7 @@ set -o nounset set -o pipefail + echo "Starting opnfv-docker for $DOCKER_REPO_NAME ..." echo "--------------------------------------------------------" echo @@ -51,10 +52,8 @@ if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then done fi - -# cd to directory where Dockerfile is located cd $WORKSPACE/docker -if [ ! -f ./Dockerfile ]; then +if [ ! -f ${DOCKERFILE} ]; then echo "ERROR: Dockerfile not found." exit 1 fi @@ -78,7 +77,8 @@ fi echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG" echo "--------------------------------------------------------" echo -cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$BRANCH ." +cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$BRANCH + -f $DOCKERFILE ." echo ${cmd} ${cmd} diff --git a/jjb/releng/opnfv-docker.yml b/jjb/releng/opnfv-docker.yml index cb9b4d488..90a91f802 100644 --- a/jjb/releng/opnfv-docker.yml +++ b/jjb/releng/opnfv-docker.yml @@ -72,6 +72,8 @@ # projects with jobs for master - 'daisy': <<: *master + - 'escalator': + <<: *master jobs: - '{project}-docker-build-push-monitor-{stream}' @@ -101,6 +103,10 @@ name: RELEASE_VERSION default: "" description: "Release version, e.g. 1.0, 2.0, 3.0" + - string: + name: DOCKERFILE + default: "Dockerfile" + description: "Dockerfile to use for creating the image." scm: - git-scm diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml index b06072b73..0b6c36e59 100644 --- a/jjb/releng/testapi-automate.yml +++ b/jjb/releng/testapi-automate.yml @@ -93,7 +93,6 @@ healthy: 50 unhealthy: 40 failing: 30 - - 'email-publisher' - job-template: name: 'testapi-automate-{stream}' @@ -160,6 +159,8 @@ projects: - name: 'testapi-automate-docker-deploy-{stream}' current-parameters: false + predefined-parameters: | + GIT_BASE=$GIT_BASE node-label-name: SLAVE_LABEL node-label: testresults kill-phase-on: FAILURE @@ -261,6 +262,6 @@ name: 'email-publisher' publishers: - email: - recipients: rohitsakala@gmail.com serena.feng.711@gmail.com + recipients: rohitsakala@gmail.com feng.xiaowei@zte.com.cn notify-every-unstable-build: false send-to-individuals: true diff --git a/jjb/vswitchperf/vswitchperf.yml b/jjb/vswitchperf/vswitchperf.yml index 936483706..ef0e90a76 100644 --- a/jjb/vswitchperf/vswitchperf.yml +++ b/jjb/vswitchperf/vswitchperf.yml @@ -19,7 +19,7 @@ branch: 'stable/{stream}' gs-pathname: '/{stream}' disabled: true - slave-label: 'intel-pod3' + slave-label: 'intel-pod12' - job-template: @@ -31,7 +31,7 @@ - project-parameter: project: '{project}' branch: '{branch}' - - 'intel-pod3-defaults' + - 'intel-pod12-defaults' scm: - git-scm diff --git a/jjb/yardstick/yardstick-ci-jobs.yml b/jjb/yardstick/yardstick-ci-jobs.yml index 2c3dda9e6..604eaed25 100644 --- a/jjb/yardstick/yardstick-ci-jobs.yml +++ b/jjb/yardstick/yardstick-ci-jobs.yml @@ -197,8 +197,8 @@ installer: compass auto-trigger-name: 'yardstick-daily-huawei-pod4-trigger' <<: *master - - huawei-pod5: - slave-label: '{pod}' + - baremetal-centos: + slave-label: 'intel-pod8' installer: compass auto-trigger-name: 'daily-trigger-disabled' <<: *master @@ -381,15 +381,6 @@ name: YARDSTICK_DB_BACKEND default: '-i 104.197.68.199:8086' description: 'Arguments to use in order to choose the backend DB' - -- parameter: - name: 'yardstick-params-huawei-pod5' - parameters: - - string: - name: YARDSTICK_DB_BACKEND - default: '-i 104.197.68.199:8086' - description: 'Arguments to use in order to choose the backend DB' - - parameter: name: 'yardstick-params-zte-pod1' parameters: diff --git a/modules/opnfv/installer_adapters/__init__.py b/modules/opnfv/deployment/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/opnfv/installer_adapters/__init__.py +++ b/modules/opnfv/deployment/__init__.py diff --git a/modules/opnfv/installer_adapters/apex/__init__.py b/modules/opnfv/deployment/apex/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/opnfv/installer_adapters/apex/__init__.py +++ b/modules/opnfv/deployment/apex/__init__.py diff --git a/modules/opnfv/deployment/apex/adapter.py b/modules/opnfv/deployment/apex/adapter.py new file mode 100644 index 000000000..1b81e781b --- /dev/null +++ b/modules/opnfv/deployment/apex/adapter.py @@ -0,0 +1,93 @@ +############################################################################## +# Copyright (c) 2017 Ericsson AB and others. +# Author: Jose Lausuch (jose.lausuch@ericsson.com) +# 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 +############################################################################## + +import re + +from opnfv.deployment import manager +from opnfv.utils import opnfv_logger as logger +from opnfv.utils import ssh_utils + +logger = logger.Logger(__name__).getLogger() + + +class ApexAdapter(manager.DeploymentHandler): + + def __init__(self, installer_ip, installer_user, pkey_file): + super(ApexAdapter, self).__init__(installer='apex', + installer_ip=installer_ip, + installer_user=installer_user, + installer_pwd=None, + pkey_file=pkey_file) + + def nodes(self): + nodes = [] + cmd = "source /home/stack/stackrc;nova list 2>/dev/null" + output = self.installer_node.run_cmd(cmd) + lines = output.rsplit('\n') + if len(lines) < 4: + logger.info("No nodes found in the deployment.") + return None + + for line in lines: + if 'controller' in line: + roles = "controller" + elif 'compute' in line: + roles = "compute" + else: + continue + if 'Daylight' in line: + roles += ", OpenDaylight" + fields = line.split('|') + id = re.sub('[!| ]', '', fields[1]) + name = re.sub('[!| ]', '', fields[2]) + status_node = re.sub('[!| ]', '', fields[3]) + ip = re.sub('[!| ctlplane=]', '', fields[6]) + + if status_node == 'ACTIVE': + status = manager.Node.STATUS_OK + ssh_client = ssh_utils.get_ssh_client(hostname=ip, + username='heat-admin', + pkey_file=self.pkey_file) + else: + status = manager.Node.STATUS_INACTIVE + ssh_client = None + + node = manager.Node(id, ip, name, status, roles, ssh_client) + nodes.append(node) + + return nodes + + def get_openstack_version(self): + cmd = 'source overcloudrc;sudo nova-manage version' + result = self.installer_node.run_cmd(cmd) + return result + + def get_sdn_version(self): + cmd_descr = ("sudo yum info opendaylight 2>/dev/null|" + "grep Description|sed 's/^.*\: //'") + cmd_ver = ("sudo yum info opendaylight 2>/dev/null|" + "grep Version|sed 's/^.*\: //'") + for node in self.nodes: + if 'controller' in node.get_attribute('roles'): + description = node.run_cmd(cmd_descr) + version = node.run_cmd(cmd_ver) + break + + if description is None: + return None + else: + return description + ':' + version + + def get_deployment_status(self): + cmd = 'source stackrc;openstack stack list|grep CREATE_COMPLETE' + result = self.installer_node.run_cmd(cmd) + if result is None or len(result) == 0: + return 'failed' + else: + return 'active' diff --git a/modules/opnfv/deployment/example.py b/modules/opnfv/deployment/example.py new file mode 100644 index 000000000..6a76eb9c3 --- /dev/null +++ b/modules/opnfv/deployment/example.py @@ -0,0 +1,21 @@ +# This is an example of usage of this Tool +# Author: Jose Lausuch (jose.lausuch@ericsson.com) + +from opnfv.deployment import factory + +handler = factory.Factory.get_handler('apex', + '192.168.122.135', + 'stack', + pkey_file='/root/.ssh/id_rsa') + + +installer_node = handler.get_installer_node() +print("Hello, I am node '%s'" % installer_node.run_cmd('hostname')) +installer_node.get_file('/home/stack/overcloudrc', './overcloudrc') + +nodes = handler.get_nodes() +for node in nodes: + print("Hello, I am node '%s' and my ip is %s." % + (node.run_cmd('hostname'), node.ip)) + +print handler.get_deployment_info() diff --git a/modules/opnfv/deployment/factory.py b/modules/opnfv/deployment/factory.py new file mode 100644 index 000000000..e48a751ad --- /dev/null +++ b/modules/opnfv/deployment/factory.py @@ -0,0 +1,44 @@ +############################################################################## +# Copyright (c) 2017 Ericsson AB and others. +# Author: Jose Lausuch (jose.lausuch@ericsson.com) +# 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.apex import adapter as apex_adapter +from opnfv.deployment.fuel import adapter as fuel_adapter +from opnfv.utils import opnfv_logger as logger + +logger = logger.Logger(__name__).getLogger() + + +class Factory(object): + + INSTALLERS = ["fuel", "apex", "compass", "joid", "daisy"] + + def __init__(self): + pass + + @staticmethod + def get_handler(installer, + installer_ip, + installer_user, + installer_pwd=None, + pkey_file=None): + + if installer not in Factory.INSTALLERS: + raise Exception("This is not an OPNFV installer.") + + if installer.lower() == "apex": + return apex_adapter.ApexAdapter(installer_ip=installer_ip, + installer_user=installer_user, + pkey_file=pkey_file) + elif installer.lower() == "fuel": + return fuel_adapter.FuelAdapter(installer_ip=installer_ip, + installer_user=installer_user, + installer_pwd=installer_pwd) + else: + raise Exception("Installer adapter is not implemented.") diff --git a/modules/opnfv/installer_adapters/compass/__init__.py b/modules/opnfv/deployment/fuel/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/opnfv/installer_adapters/compass/__init__.py +++ b/modules/opnfv/deployment/fuel/__init__.py diff --git a/modules/opnfv/deployment/fuel/adapter.py b/modules/opnfv/deployment/fuel/adapter.py new file mode 100644 index 000000000..d53966e82 --- /dev/null +++ b/modules/opnfv/deployment/fuel/adapter.py @@ -0,0 +1,167 @@ +############################################################################## +# Copyright (c) 2017 Ericsson AB and others. +# Author: Jose Lausuch (jose.lausuch@ericsson.com) +# George Paraskevopoulos (geopar@intracom-telecom.com) +# 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 + +logger = logger.Logger("FuelAdapter").getLogger() + + +class FuelAdapter(manager.DeploymentHandler): + + def __init__(self, installer_ip, installer_user, installer_pwd): + super(FuelAdapter, self).__init__(installer='fuel', + installer_ip=installer_ip, + installer_user=installer_user, + installer_pwd=installer_pwd, + pkey_file=None) + + def _get_clusters(self): + environments = [] + output = self.runcmd_fuel_env() + lines = output.rsplit('\n') + if len(lines) < 2: + logger.info("No environments found in the deployment.") + return None + else: + fields = lines[0].rsplit(' | ') + + index_id = -1 + index_status = -1 + index_name = -1 + index_release_id = -1 + + for i in range(len(fields) - 1): + if "id" in fields[i]: + index_id = i + elif "status" in fields[i]: + index_status = i + elif "name" in fields[i]: + index_name = i + elif "release_id" in fields[i]: + index_release_id = i + + # order env info + for i in range(2, len(lines) - 1): + fields = lines[i].rsplit(' | ') + dict = {"id": fields[index_id].strip(), + "status": fields[index_status].strip(), + "name": fields[index_name].strip(), + "release_id": fields[index_release_id].strip()} + environments.append(dict) + + return environments + + def nodes(self, options=None): + nodes = [] + cmd = 'fuel node' + output = self.installer_node.run_cmd(cmd) + lines = output.rsplit('\n') + if len(lines) < 2: + logger.info("No nodes found in the deployment.") + return None + else: + # get fields indexes + fields = lines[0].rsplit(' | ') + + index_id = -1 + index_status = -1 + index_name = -1 + index_cluster = -1 + index_ip = -1 + index_mac = -1 + index_roles = -1 + index_online = -1 + + for i in range(0, len(fields) - 1): + if "id" in fields[i]: + index_id = i + elif "status" in fields[i]: + index_status = i + elif "name" in fields[i]: + index_name = i + elif "cluster" in fields[i]: + index_cluster = i + elif "ip" in fields[i]: + index_ip = i + elif "mac" in fields[i]: + index_mac = i + elif "roles " in fields[i]: + index_roles = i + elif "online" in fields[i]: + index_online = i + + # order nodes info + for i in range(2, len(lines) - 1): + fields = lines[i].rsplit(' | ') + + id = fields[index_id].strip(), + ip = fields[index_ip].strip() + status_node = fields[index_status].strip() + name = fields[index_name].strip() + roles = fields[index_roles].strip() + + dict = {"cluster": fields[index_cluster].strip(), + "mac": fields[index_mac].strip(), + "online": fields[index_online].strip()} + + if status_node == 'ready': + status = manager.Node.STATUS_OK + proxy = {'ip': self.installer_ip, + 'username': self.installer_user, + 'password': self.installer_pwd} + ssh_client = ssh_utils.get_ssh_client(hostname=ip, + username='root', + proxy=proxy) + else: + status = manager.Node.STATUS_INACTIVE + ssh_client = None + + node = manager.Node( + id, ip, name, status, roles, ssh_client, dict) + nodes.append(node) + + # TODO: Add support for Fuel cluster selection + ''' + if options and options['cluster']: + if fields[index_cluster].strip() == options['cluster']: + ''' + + return nodes + + def get_openstack_version(self): + cmd = 'source openrc;nova-manage version 2>/dev/null' + version = None + for node in self.nodes: + if 'controller' in node.get_attribute('roles'): + version = node.run_cmd(cmd) + break + return version + + def get_sdn_version(self): + cmd = "apt-cache show opendaylight|grep Version|sed 's/^.*\: //'" + version = None + for node in self.nodes: + if 'controller' in node.get_attribute('roles'): + odl_version = node.run_cmd(cmd) + if odl_version: + version = 'OpenDaylight ' + odl_version + break + return version + + def get_deployment_status(self): + cmd = 'fuel env|grep operational' + result = self.installer_node.run_cmd(cmd) + if result is None or len(result) == 0: + return 'failed' + else: + return 'active' diff --git a/modules/opnfv/deployment/manager.py b/modules/opnfv/deployment/manager.py new file mode 100644 index 000000000..f0e442903 --- /dev/null +++ b/modules/opnfv/deployment/manager.py @@ -0,0 +1,299 @@ +############################################################################## +# Copyright (c) 2017 Ericsson AB and others. +# Author: Jose Lausuch (jose.lausuch@ericsson.com) +# 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 abc import abstractmethod +import os + + +from opnfv.utils import opnfv_logger as logger +from opnfv.utils import ssh_utils + +logger = logger.Logger(__name__).getLogger() + + +class Deployment(object): + + def __init__(self, + installer, + installer_ip, + scenario, + pod, + status, + openstack_version, + sdn_controller, + nodes=[]): + + self.deployment_info = { + 'installer': installer, + 'installer_ip': installer_ip, + 'scenario': scenario, + 'pod': pod, + 'status': status, + 'openstack_version': openstack_version, + 'sdn_controller': sdn_controller, + 'nodes': nodes + } + + def _get_openstack_release(self): + ''' + Translates an openstack version into the release name + ''' + os_versions = { + '12': 'Liberty', + '13': 'Mitaka', + '14': 'Newton', + '15': 'Ocata', + '16': 'Pike', + '17': 'Queens' + } + try: + version = self.deployment_info['openstack_version'].split('.')[0] + name = os_versions[version] + return name + except Exception as e: + return 'Unknown release' + + def get_dict(self): + ''' + Returns a dictionary will all the attributes + ''' + return self.deployment_info + + def __str__(self): + ''' + Override of the str method + ''' + s = ''' + INSTALLER: {installer} + SCENARIO: {scenario} + INSTALLER IP: {installer_ip} + POD: {pod} + STATUS: {status} + OPENSTACK: {openstack_version} ({openstack_release}) + SDN: {sdn_controller} + NODES: + '''.format(installer=self.deployment_info['installer'], + scenario=self.deployment_info['scenario'], + installer_ip=self.deployment_info['installer_ip'], + pod=self.deployment_info['pod'], + status=self.deployment_info['status'], + openstack_version=self.deployment_info[ + 'openstack_version'], + openstack_release=self._get_openstack_release(), + sdn_controller=self.deployment_info['sdn_controller']) + + for node in self.deployment_info['nodes']: + s += '\t\t{node_object}\n'.format(node_object=node) + + return s + + +class Node(object): + + STATUS_OK = 'active' + STATUS_INACTIVE = 'inactive' + STATUS_OFFLINE = 'offline' + STATUS_FAILED = 'failed' + + def __init__(self, + id, + ip, + name, + status, + roles, + ssh_client, + info={}): + self.id = id + self.ip = ip + self.name = name + self.status = status + self.ssh_client = ssh_client + self.roles = roles + self.info = info + + def get_file(self, src, dest): + ''' + SCP file from a node + ''' + if self.status is not Node.STATUS_OK: + logger.info("The node %s is not active" % self.ip) + return 1 + logger.info("Fetching %s from %s" % (src, self.ip)) + get_file_result = ssh_utils.get_file(self.ssh_client, src, dest) + if get_file_result is None: + logger.error("SFTP failed to retrieve the file.") + else: + logger.info("Successfully copied %s:%s to %s" % + (self.ip, src, dest)) + return get_file_result + + def put_file(self, src, dest): + ''' + SCP file to a node + ''' + if self.status is not Node.STATUS_OK: + logger.info("The node %s is not active" % self.ip) + return 1 + logger.info("Copying %s to %s" % (src, self.ip)) + put_file_result = ssh_utils.put_file(self.ssh_client, src, dest) + if put_file_result is None: + logger.error("SFTP failed to retrieve the file.") + else: + logger.info("Successfully copied %s to %s:%s" % + (src, dest, self.ip)) + return put_file_result + + def run_cmd(self, cmd): + ''' + Run command remotely on a node + ''' + if self.status is not Node.STATUS_OK: + logger.info("The node %s is not active" % self.ip) + return 1 + _, stdout, stderr = (self.ssh_client.exec_command(cmd)) + error = stderr.readlines() + if len(error) > 0: + logger.error("error %s" % ''.join(error)) + return error + output = ''.join(stdout.readlines()).rstrip() + return output + + def get_dict(self): + ''' + Returns a dictionary with all the attributes + ''' + return { + 'id': self.id, + 'ip': self.ip, + 'name': self.name, + 'status': self.status, + 'roles': self.roles, + 'info': self.info + } + + def get_attribute(self, attribute): + ''' + Returns an attribute given the name + ''' + return self.get_dict()[attribute] + + def is_controller(self): + ''' + Returns if the node is a controller + ''' + if 'controller' in self.get_attribute('roles'): + return True + return False + + def is_compute(self): + ''' + Returns if the node is a compute + ''' + if 'compute' in self.get_attribute('roles'): + return True + return False + + def __str__(self): + return str(self.get_dict()) + + +class DeploymentHandler(object): + + EX_OK = os.EX_OK + EX_ERROR = os.EX_SOFTWARE + FUNCTION_NOT_IMPLEMENTED = "Function not implemented by adapter!" + + def __init__(self, + installer, + installer_ip, + installer_user, + installer_pwd=None, + pkey_file=None): + + self.installer = installer.lower() + self.installer_ip = installer_ip + self.installer_user = installer_user + self.installer_pwd = installer_pwd + self.pkey_file = pkey_file + + 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) + + self.installer_connection = ssh_utils.get_ssh_client( + hostname=self.installer_ip, + username=self.installer_user, + password=self.installer_pwd, + pkey_file=self.pkey_file) + + if self.installer_connection: + self.installer_node = Node(id='', + ip=installer_ip, + name=installer, + status='active', + ssh_client=self.installer_connection, + roles='installer node') + else: + raise Exception( + 'Cannot establish connection to the installer node!') + + self.nodes = self.nodes() + + @abstractmethod + def get_openstack_version(self): + ''' + Returns a string of the openstack version (nova-compute) + ''' + raise Exception(DeploymentHandler.FUNCTION_NOT_IMPLEMENTED) + + @abstractmethod + def get_sdn_version(self): + ''' + Returns a string of the sdn controller and its version, if exists + ''' + raise Exception(DeploymentHandler.FUNCTION_NOT_IMPLEMENTED) + + @abstractmethod + def get_deployment_status(self): + ''' + Returns a string of the status of the deployment + ''' + raise Exception(DeploymentHandler.FUNCTION_NOT_IMPLEMENTED) + + @abstractmethod + def nodes(self, options=None): + ''' + Generates a list of all the nodes in the deployment + ''' + raise Exception(DeploymentHandler.FUNCTION_NOT_IMPLEMENTED) + + def get_nodes(self, options=None): + ''' + Returns the list of Node objects + ''' + return self.nodes + + def get_installer_node(self): + ''' + Returns the installer node object + ''' + return self.installer_node + + def get_deployment_info(self): + ''' + Returns an object of type Deployment + ''' + return Deployment(installer=self.installer, + installer_ip=self.installer_ip, + scenario=os.getenv('DEPLOY_SCENARIO', 'Unknown'), + status=self.get_deployment_status(), + pod=os.getenv('NODE_NAME', 'Unknown'), + openstack_version=self.get_openstack_version(), + sdn_controller=self.get_sdn_version(), + nodes=self.nodes) diff --git a/modules/opnfv/installer_adapters/InstallerHandler.py b/modules/opnfv/installer_adapters/InstallerHandler.py deleted file mode 100644 index 6c43a46f0..000000000 --- a/modules/opnfv/installer_adapters/InstallerHandler.py +++ /dev/null @@ -1,85 +0,0 @@ -############################################################################## -# Copyright (c) 2017 Ericsson AB and others. -# Author: Jose Lausuch (jose.lausuch@ericsson.com) -# 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.installer_adapters.fuel.FuelAdapter import FuelAdapter -from opnfv.installer_adapters.apex.ApexAdapter import ApexAdapter -from opnfv.installer_adapters.compass.CompassAdapter import CompassAdapter -from opnfv.installer_adapters.joid.JoidAdapter import JoidAdapter -from opnfv.installer_adapters.daisy.DaisyAdapter import DaisyAdapter - - -INSTALLERS = ["fuel", "apex", "compass", "joid", "daisy"] - - -class InstallerHandler: - - def __init__(self, - installer, - installer_ip, - installer_user, - installer_pwd=None, - private_key_file=None): - self.installer = installer.lower() - self.installer_ip = installer_ip - self.installer_user = installer_user - self.installer_pwd = installer_pwd - self.private_key_file = private_key_file - - if self.installer == INSTALLERS[0]: - self.InstallerAdapter = FuelAdapter(self.installer_ip, - self.installer_user, - self.installer_pwd) - elif self.installer == INSTALLERS[1]: - self.InstallerAdapter = ApexAdapter(installer_ip=self.installer_ip, - user=self.installer_user, - pkey_file=self.private_key_file) - elif self.installer == INSTALLERS[2]: - self.InstallerAdapter = CompassAdapter(self.installer_ip) - elif self.installer == INSTALLERS[3]: - self.InstallerAdapter = JoidAdapter(self.installer_ip) - elif self.installer == INSTALLERS[4]: - self.InstallerAdapter = DaisyAdapter(self.installer_ip) - else: - print("Installer %s is not valid. " - "Please use one of the followings: %s" - % (self.installer, INSTALLERS)) - exit(1) - - def get_deployment_info(self): - return self.InstallerAdapter.get_deployment_info() - - def get_nodes(self, options=None): - return self.InstallerAdapter.get_nodes(options=options) - - def get_controller_ips(self, options=None): - return self.InstallerAdapter.get_controller_ips(options=options) - - def get_compute_ips(self, options=None): - return self.InstallerAdapter.get_compute_ips(options=options) - - def get_file_from_installer(self, - remote_path, - local_path, - options=None): - return self.InstallerAdapter.get_file_from_installer(remote_path, - local_path, - options=options) - - def get_file_from_controller(self, - remote_path, - local_path, - ip=None, - options=None): - return self.InstallerAdapter.get_file_from_controller(remote_path, - local_path, - ip=ip, - options=options) - - def get_all(self): - pass diff --git a/modules/opnfv/installer_adapters/apex/ApexAdapter.py b/modules/opnfv/installer_adapters/apex/ApexAdapter.py deleted file mode 100644 index 29637d700..000000000 --- a/modules/opnfv/installer_adapters/apex/ApexAdapter.py +++ /dev/null @@ -1,154 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# Author: Jose Lausuch (jose.lausuch@ericsson.com) -# 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 -############################################################################## - -import os -import re - -import opnfv.utils.SSHUtils as ssh_utils -import opnfv.utils.OPNFVLogger as logger - - -class ApexAdapter: - - def __init__(self, installer_ip, pkey_file, user="stack"): - self.installer_ip = installer_ip - self.installer_user = user - self.pkey_file = pkey_file - self.installer_connection = ssh_utils.get_ssh_client( - self.installer_ip, - self.installer_user, - pkey_file=self.pkey_file) - self.logger = logger.Logger("ApexHandler").getLogger() - - def runcmd_apex_installer(self, cmd): - _, stdout, stderr = (self.installer_connection.exec_command(cmd)) - error = stderr.readlines() - if len(error) > 0: - self.logger.error("error %s" % ''.join(error)) - return error - output = ''.join(stdout.readlines()) - return output - - def get_nodes(self): - nodes = [] - output = self.runcmd_apex_installer( - "source /home/stack/stackrc;nova list") - lines = output.rsplit('\n') - if len(lines) < 4: - self.logger.info("No nodes found in the deployment.") - return None - - for line in lines: - if 'controller' in line: - roles = "controller" - elif 'compute' in line: - roles = "compute" - else: - continue - if 'Daylight' in line: - roles = + ", OpenDaylight" - fields = line.split('|') - dict = {"id": re.sub('[!| ]', '', fields[1]), - "roles": roles, - "name": re.sub('[!| ]', '', fields[2]), - "status": re.sub('[!| ]', '', fields[3]), - "ip": re.sub('[!| ctlplane=]', '', fields[6])} - nodes.append(dict) - - return nodes - - def get_deployment_info(self): - str = "Deployment details:\n" - str += "\tINSTALLER: Apex\n" - str += ("\tSCENARIO: %s\n" % - os.getenv('DEPLOY_SCENARIO', 'Unknown')) - sdn = "None" - - nodes = self.get_nodes() - if nodes is None: - self.logger.info("No nodes found in the deployment.") - return - num_nodes = len(nodes) - num_controllers = 0 - num_computes = 0 - for node in nodes: - if 'controller' in node['roles']: - num_controllers += 1 - if 'compute' in node['roles']: - num_computes += 1 - if 'Daylight' in node['name']: - sdn = 'OpenDaylight' - - ha = str(num_controllers >= 3) - - str += "\tHA: %s\n" % ha - str += "\tNUM.NODES: %s\n" % num_nodes - str += "\tCONTROLLERS: %s\n" % num_controllers - str += "\tCOMPUTES: %s\n" % num_computes - str += "\tSDN CONTR.: %s\n\n" % sdn - - str += "\tNODES:\n" - for node in nodes: - str += ("\t ID: %s\n" % node['id']) - str += ("\t Name: %s\n" % node['name']) - str += ("\t Roles: %s\n" % node['roles']) - str += ("\t Status: %s\n" % node['status']) - str += ("\t IP: %s\n\n" % node['ip']) - - return str - - def get_controller_ips(self, options=None): - nodes = self.get_nodes() - controllers = [] - for node in nodes: - if "controller" in node["roles"]: - controllers.append(node['ip']) - return controllers - - def get_compute_ips(self, options=None): - nodes = self.get_nodes() - computes = [] - for node in nodes: - if "compute" in node["roles"]: - computes.append(node['ip']) - return computes - - def get_file_from_installer(self, remote_path, local_path, options=None): - self.logger.debug("Fetching %s from Undercloud %s" % - (remote_path, self.installer_ip)) - get_file_result = ssh_utils.get_file(self.installer_connection, - remote_path, - local_path) - if get_file_result is None: - self.logger.error("SFTP failed to retrieve the file.") - return 1 - self.logger.info("%s successfully copied from Undercloud to %s" % - (remote_path, local_path)) - - def get_file_from_controller(self, - remote_path, - local_path, - ip=None, - options=None): - if ip is None: - controllers = self.get_controller_ips() - ip = controllers[0] - - connection = ssh_utils.get_ssh_client(ip, - 'heat-admin', - pkey_file=self.pkey_file) - - get_file_result = ssh_utils.get_file(connection, - remote_path, - local_path) - if get_file_result is None: - self.logger.error("SFTP failed to retrieve the file.") - return 1 - self.logger.info("%s successfully copied from %s to %s" % - (remote_path, ip, local_path)) diff --git a/modules/opnfv/installer_adapters/apex/example.py b/modules/opnfv/installer_adapters/apex/example.py deleted file mode 100644 index c8c473727..000000000 --- a/modules/opnfv/installer_adapters/apex/example.py +++ /dev/null @@ -1,16 +0,0 @@ -# This is an example of usage of this Tool -# Author: Jose Lausuch (jose.lausuch@ericsson.com) - -import opnfv.installer_adapters.InstallerHandler as ins_handler - -apex_handler = ins_handler.InstallerHandler(installer='apex', - installer_ip='192.168.122.135', - installer_user='stack', - private_key_file='/root/.ssh/id_rsa') -apex_handler.get_file_from_installer( - '/home/stack/overcloudrc', './overcloudrc') - -print("\n%s\n" % apex_handler.get_deployment_info()) - -apex_handler.get_file_from_controller( - '/etc/resolv.conf', './resolv.conf') diff --git a/modules/opnfv/installer_adapters/compass/CompassAdapter.py b/modules/opnfv/installer_adapters/compass/CompassAdapter.py deleted file mode 100644 index 47cbc646d..000000000 --- a/modules/opnfv/installer_adapters/compass/CompassAdapter.py +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# Author: Jose Lausuch (jose.lausuch@ericsson.com) -# 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 -############################################################################## - - -class CompassAdapter: - - def __init__(self, installer_ip): - self.installer_ip = installer_ip - - def get_deployment_info(self): - pass - - def get_nodes(self): - pass - - def get_controller_ips(self): - pass - - def get_compute_ips(self): - pass - - def get_file_from_installer(self, origin, target, options=None): - pass - - def get_file_from_controller(self, origin, target, ip=None, options=None): - pass diff --git a/modules/opnfv/installer_adapters/daisy/DaisyAdapter.py b/modules/opnfv/installer_adapters/daisy/DaisyAdapter.py deleted file mode 100644 index 9b06f4c3c..000000000 --- a/modules/opnfv/installer_adapters/daisy/DaisyAdapter.py +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# Author: Jose Lausuch (jose.lausuch@ericsson.com) -# 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 -############################################################################## - - -class DaisyAdapter: - - def __init__(self, installer_ip): - self.installer_ip = installer_ip - - def get_deployment_info(self): - pass - - def get_nodes(self): - pass - - def get_controller_ips(self): - pass - - def get_compute_ips(self): - pass - - def get_file_from_installer(self, origin, target, options=None): - pass - - def get_file_from_controller(self, origin, target, ip=None, options=None): - pass diff --git a/modules/opnfv/installer_adapters/daisy/__init__.py b/modules/opnfv/installer_adapters/daisy/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/modules/opnfv/installer_adapters/daisy/__init__.py +++ /dev/null diff --git a/modules/opnfv/installer_adapters/fuel/FuelAdapter.py b/modules/opnfv/installer_adapters/fuel/FuelAdapter.py deleted file mode 100644 index 8ed8f8937..000000000 --- a/modules/opnfv/installer_adapters/fuel/FuelAdapter.py +++ /dev/null @@ -1,236 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# Author: Jose Lausuch (jose.lausuch@ericsson.com) -# George Paraskevopoulos (geopar@intracom-telecom.com) -# 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 -############################################################################## - -import opnfv.utils.SSHUtils as ssh_utils -import opnfv.utils.OPNFVLogger as logger - - -class FuelAdapter: - - def __init__(self, installer_ip, user="root", password="r00tme"): - self.installer_ip = installer_ip - self.installer_user = user - self.installer_password = password - self.installer_connection = ssh_utils.get_ssh_client( - installer_ip, - self.installer_user, - password=self.installer_password) - self.logger = logger.Logger("FuelHandler").getLogger() - - def runcmd_fuel_installer(self, cmd): - _, stdout, stderr = (self - .installer_connection - .exec_command(cmd)) - error = stderr.readlines() - if len(error) > 0: - self.logger.error("error %s" % ''.join(error)) - return error - output = ''.join(stdout.readlines()) - return output - - def runcmd_fuel_nodes(self): - return self.runcmd_fuel_installer('fuel nodes') - - def runcmd_fuel_env(self): - return self.runcmd_fuel_installer('fuel env') - - def get_clusters(self): - environments = [] - output = self.runcmd_fuel_env() - lines = output.rsplit('\n') - if len(lines) < 2: - self.logger.infp("No environments found in the deployment.") - return None - else: - fields = lines[0].rsplit(' | ') - - index_id = -1 - index_status = -1 - index_name = -1 - index_release_id = -1 - - for i in range(0, len(fields) - 1): - if "id" in fields[i]: - index_id = i - elif "status" in fields[i]: - index_status = i - elif "name" in fields[i]: - index_name = i - elif "release_id" in fields[i]: - index_release_id = i - - # order env info - for i in range(2, len(lines) - 1): - fields = lines[i].rsplit(' | ') - dict = {"id": fields[index_id].strip(), - "status": fields[index_status].strip(), - "name": fields[index_name].strip(), - "release_id": fields[index_release_id].strip()} - environments.append(dict) - - return environments - - def get_nodes(self, options=None): - nodes = [] - output = self.runcmd_fuel_nodes() - lines = output.rsplit('\n') - if len(lines) < 2: - self.logger.info("No nodes found in the deployment.") - return None - else: - # get fields indexes - fields = lines[0].rsplit(' | ') - - index_id = -1 - index_status = -1 - index_name = -1 - index_cluster = -1 - index_ip = -1 - index_mac = -1 - index_roles = -1 - index_online = -1 - - for i in range(0, len(fields) - 1): - if "id" in fields[i]: - index_id = i - elif "status" in fields[i]: - index_status = i - elif "name" in fields[i]: - index_name = i - elif "cluster" in fields[i]: - index_cluster = i - elif "ip" in fields[i]: - index_ip = i - elif "mac" in fields[i]: - index_mac = i - elif "roles " in fields[i]: - index_roles = i - elif "online" in fields[i]: - index_online = i - - # order nodes info - for i in range(2, len(lines) - 1): - fields = lines[i].rsplit(' | ') - dict = {"id": fields[index_id].strip(), - "status": fields[index_status].strip(), - "name": fields[index_name].strip(), - "cluster": fields[index_cluster].strip(), - "ip": fields[index_ip].strip(), - "mac": fields[index_mac].strip(), - "roles": fields[index_roles].strip(), - "online": fields[index_online].strip()} - if options and options['cluster']: - if fields[index_cluster].strip() == options['cluster']: - nodes.append(dict) - else: - nodes.append(dict) - - return nodes - - def get_controller_ips(self, options): - nodes = self.get_nodes(options=options) - controllers = [] - for node in nodes: - if "controller" in node["roles"]: - controllers.append(node['ip']) - return controllers - - def get_compute_ips(self, options=None): - nodes = self.get_nodes(options=options) - computes = [] - for node in nodes: - if "compute" in node["roles"]: - computes.append(node['ip']) - return computes - - def get_deployment_info(self): - str = "Deployment details:\n" - str += "\tInstaller: Fuel\n" - str += "\tScenario: Unknown\n" - sdn = "None" - clusters = self.get_clusters() - str += "\tN.Clusters: %s\n" % len(clusters) - for cluster in clusters: - cluster_dic = {'cluster': cluster['id']} - str += "\tCluster info:\n" - str += "\t ID: %s\n" % cluster['id'] - str += "\t NAME: %s\n" % cluster['name'] - str += "\t STATUS: %s\n" % cluster['status'] - nodes = self.get_nodes(options=cluster_dic) - num_nodes = len(nodes) - for node in nodes: - if "opendaylight" in node['roles']: - sdn = "OpenDaylight" - elif "onos" in node['roles']: - sdn = "ONOS" - num_controllers = len( - self.get_controller_ips(options=cluster_dic)) - num_computes = len(self.get_compute_ips(options=cluster_dic)) - ha = False - if num_controllers > 1: - ha = True - - str += "\t HA: %s\n" % ha - str += "\t NUM.NODES: %s\n" % num_nodes - str += "\t CONTROLLERS: %s\n" % num_controllers - str += "\t COMPUTES: %s\n" % num_computes - str += "\t SDN CONTR.: %s\n\n" % sdn - str += self.runcmd_fuel_nodes() - return str - - def get_file_from_installer(self, remote_path, local_path, options=None): - self.logger.debug("Fetching %s from %s" % - (remote_path, self.installer_ip)) - get_file_result = ssh_utils.get_file(self.installer_connection, - remote_path, - local_path) - if get_file_result is None: - self.logger.error("SFTP failed to retrieve the file.") - return 1 - self.logger.info("%s successfully copied from Fuel to %s" % - (remote_path, local_path)) - - def get_file_from_controller(self, - remote_path, - local_path, - ip=None, - user='root', - options=None): - if ip is None: - controllers = self.get_controller_ips(options=options) - if len(controllers) == 0: - self.logger.info("No controllers found in the deployment.") - return 1 - else: - target_ip = controllers[0] - else: - target_ip = ip - - installer_proxy = { - 'ip': self.installer_ip, - 'username': self.installer_user, - 'password': self.installer_password - } - controller_conn = ssh_utils.get_ssh_client( - target_ip, - user, - proxy=installer_proxy) - - self.logger.debug("Fetching %s from %s" % - (remote_path, target_ip)) - - get_file_result = ssh_utils.get_file(controller_conn, - remote_path, - local_path) - if get_file_result is None: - self.logger.error("SFTP failed to retrieve the file.") - return 1 - self.logger.info("%s successfully copied from %s to %s" % - (remote_path, target_ip, local_path)) diff --git a/modules/opnfv/installer_adapters/fuel/__init__.py b/modules/opnfv/installer_adapters/fuel/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/modules/opnfv/installer_adapters/fuel/__init__.py +++ /dev/null diff --git a/modules/opnfv/installer_adapters/fuel/example.py b/modules/opnfv/installer_adapters/fuel/example.py deleted file mode 100644 index 7fea4dfd7..000000000 --- a/modules/opnfv/installer_adapters/fuel/example.py +++ /dev/null @@ -1,22 +0,0 @@ -# This is an example of usage of this Tool -# Author: Jose Lausuch (jose.lausuch@ericsson.com) - -import opnfv.installer_adapters.InstallerHandler as ins_handler - -fuel_handler = ins_handler.InstallerHandler(installer='fuel', - installer_ip='10.20.0.2', - installer_user='root', - installer_pwd='r00tme') -print("Nodes in cluster 1:\n%s\n" % - fuel_handler.get_nodes(options={'cluster': '1'})) -print("Nodes in cluster 2:\n%s\n" % - fuel_handler.get_nodes(options={'cluster': '2'})) -print("Nodes:\n%s\n" % fuel_handler.get_nodes()) -print("Controller nodes:\n%s\n" % fuel_handler.get_controller_ips()) -print("Compute nodes:\n%s\n" % fuel_handler.get_compute_ips()) -print("\n%s\n" % fuel_handler.get_deployment_info()) -fuel_handler.get_file_from_installer('/root/deploy/dea.yaml', './dea.yaml') -fuel_handler.get_file_from_controller( - '/etc/neutron/neutron.conf', './neutron.conf') -fuel_handler.get_file_from_controller( - '/root/openrc', './openrc') diff --git a/modules/opnfv/installer_adapters/joid/JoidAdapter.py b/modules/opnfv/installer_adapters/joid/JoidAdapter.py deleted file mode 100644 index be8c2ebac..000000000 --- a/modules/opnfv/installer_adapters/joid/JoidAdapter.py +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# Author: Jose Lausuch (jose.lausuch@ericsson.com) -# 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 -############################################################################## - - -class JoidAdapter: - - def __init__(self, installer_ip): - self.installer_ip = installer_ip - - def get_deployment_info(self): - pass - - def get_nodes(self): - pass - - def get_controller_ips(self): - pass - - def get_compute_ips(self): - pass - - def get_file_from_installer(self, origin, target, options=None): - pass - - def get_file_from_controller(self, origin, target, ip=None, options=None): - pass diff --git a/modules/opnfv/installer_adapters/joid/__init__.py b/modules/opnfv/installer_adapters/joid/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/modules/opnfv/installer_adapters/joid/__init__.py +++ /dev/null diff --git a/modules/opnfv/utils/OPNFVLogger.py b/modules/opnfv/utils/opnfv_logger.py index 6fa4ef2e2..6fa4ef2e2 100644 --- a/modules/opnfv/utils/OPNFVLogger.py +++ b/modules/opnfv/utils/opnfv_logger.py diff --git a/modules/opnfv/utils/SSHUtils.py b/modules/opnfv/utils/ssh_utils.py index e0a830caa..f90045540 100644 --- a/modules/opnfv/utils/SSHUtils.py +++ b/modules/opnfv/utils/ssh_utils.py @@ -9,11 +9,12 @@ ############################################################################## -import paramiko -import opnfv.utils.OPNFVLogger as OPNFVLogger import os +import paramiko + +from opnfv.utils import opnfv_logger as logger -logger = OPNFVLogger.Logger('SSHUtils').getLogger() +logger = logger.Logger("SSH utils").getLogger() def get_ssh_client(hostname, @@ -79,7 +80,6 @@ class ProxyHopClient(paramiko.SSHClient): ''' def __init__(self, *args, **kwargs): - self.logger = OPNFVLogger.Logger("ProxyHopClient").getLogger() self.proxy_ssh = None self.proxy_transport = None self.proxy_channel = None @@ -129,4 +129,4 @@ class ProxyHopClient(paramiko.SSHClient): sock=self.proxy_channel) os.remove(self.local_ssh_key) except Exception, e: - self.logger.error(e) + logger.error(e) diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh index 14869b0e2..b73092b0f 100755 --- a/prototypes/bifrost/scripts/destroy-env.sh +++ b/prototypes/bifrost/scripts/destroy-env.sh @@ -14,12 +14,12 @@ if [[ $(whoami) != "root" ]]; then exit 1 fi -virsh destroy jumphost.opnfvlocal || true -virsh destroy controller00.opnfvlocal || true -virsh destroy compute00.opnfvlocal || true -virsh undefine jumphost.opnfvlocal || true -virsh undefine controller00.opnfvlocal || true -virsh undefine compute00.opnfvlocal || true +# Delete all VMs on the slave since proposed patchsets +# may leave undesired VM leftovers +for vm in $(virsh list --all --name); do + virsh destroy $vm || true + virsh undefine $vm || true +done service ironic-conductor stop || true diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index c1e21f316..f00e022f9 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -144,7 +144,7 @@ elif [ "$installer_type" == "compass" ]; then verify_connectivity $installer_ip controller_ip=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \ 'mysql -ucompass -pcompass -Dcompass -e"select * from cluster;"' \ - | awk -F"," '{for(i=1;i<NF;i++)if($i~/\"host[1-5]\"/) {print $(i+1);break;}}' \ + | awk -F"," '{for(i=1;i<NF;i++)if($i~/\"127.0.0.1\"/) {print $(i+2);break;}}' \ | grep -oP "\d+.\d+.\d+.\d+") if [ -z $controller_ip ]; then diff --git a/utils/push-test-logs.sh b/utils/push-test-logs.sh index ed6825be2..09861c45f 100644 --- a/utils/push-test-logs.sh +++ b/utils/push-test-logs.sh @@ -19,16 +19,16 @@ branch=${BRANCH##*/} testbed=$NODE_NAME dir_result="${HOME}/opnfv/$project/results/${branch}" # src: https://wiki.opnfv.org/display/INF/Hardware+Infrastructure -# + intel-pod3 (vsperf) +# + intel-pod12 (vsperf) node_list=(\ -'lf-pod1' 'lf-pod2' 'intel-pod2' 'intel-pod3' \ +'lf-pod1' 'lf-pod2' 'intel-pod2' 'intel-pod12' \ 'intel-pod5' 'intel-pod6' 'intel-pod7' 'intel-pod8' \ 'ericsson-pod1' 'ericsson-pod2' \ 'ericsson-virtual1' 'ericsson-virtual2' 'ericsson-virtual3' \ 'ericsson-virtual4' 'ericsson-virtual5' \ 'arm-pod1' 'arm-pod3' \ 'huawei-pod1' 'huawei-pod2' 'huawei-pod3' 'huawei-pod4' 'huawei-pod5' \ -'huawei-pod6' 'huawei-pod7' \ +'huawei-pod6' 'huawei-pod7' 'huawei-pod12'\ 'huawei-virtual1' 'huawei-virtual2' 'huawei-virtual3' 'huawei-virtual4') diff --git a/utils/test/reporting/functest/reporting-status.py b/utils/test/reporting/functest/reporting-status.py index 66bdd57c1..158ee597b 100755 --- a/utils/test/reporting/functest/reporting-status.py +++ b/utils/test/reporting/functest/reporting-status.py @@ -40,6 +40,9 @@ versions = rp_utils.get_config('general.versions') installers = rp_utils.get_config('general.installers') blacklist = rp_utils.get_config('functest.blacklist') log_level = rp_utils.get_config('general.log.log_level') +exclude_noha = rp_utils.get_config('functest.exclude_noha') +exclude_virtual = rp_utils.get_config('functest.exclude_virtual') + response = requests.get(cf) functest_yaml_config = yaml.safe_load(response.text) @@ -48,7 +51,10 @@ logger.info("*******************************************") logger.info("* *") logger.info("* Generating reporting scenario status *") logger.info("* Data retention: %s days *" % period) -logger.info("* Log level: %s *" % log_level) +logger.info("* Log level: %s *" % log_level) +logger.info("* *") +logger.info("* Virtual PODs exluded: %s *" % exclude_virtual) +logger.info("* NOHA scenarios excluded: %s *" % exclude_noha) logger.info("* *") logger.info("*******************************************") @@ -90,7 +96,6 @@ for version in versions: scenario_stats = rp_utils.getScenarioStats(scenario_results) items = {} scenario_result_criteria = {} - scenario_file_name = ("./display/" + version + "/functest/scenario_history.txt") # initiate scenario file if it does not exist diff --git a/utils/test/reporting/reporting.yaml b/utils/test/reporting/reporting.yaml index fa9862615..9db0890b2 100644 --- a/utils/test/reporting/reporting.yaml +++ b/utils/test/reporting/reporting.yaml @@ -2,13 +2,13 @@ general: installers: - apex - compass + - daisy - fuel - joid - - daisy versions: - master - - colorado + log: log_file: reporting.log log_level: ERROR @@ -30,17 +30,19 @@ general: testapi: url: testresults.opnfv.org/test/api/v1/results - + functest: blacklist: - ovno - security_scan + - rally_sanity max_scenario_criteria: 50 test_conf: https://git.opnfv.org/cgit/functest/plain/functest/ci/testcases.yaml log_level: ERROR - jenkins_url: https://build.opnfv.org/ci/view/functest/job - - + jenkins_url: https://build.opnfv.org/ci/view/functest/job/ + exclude_noha: False + exclude_virtual: True + yardstick: test_conf: https://git.opnfv.org/cgit/yardstick/plain/tests/ci/report_config.yaml log_level: ERROR diff --git a/utils/test/reporting/utils/reporting_utils.py b/utils/test/reporting/utils/reporting_utils.py index 0af60c78a..da979531b 100644 --- a/utils/test/reporting/utils/reporting_utils.py +++ b/utils/test/reporting/utils/reporting_utils.py @@ -127,7 +127,15 @@ def getScenarios(case, installer, version): # Retrieve all the scenarios per installer if not r['scenario'] in scenario_results.keys(): scenario_results[r['scenario']] = [] - scenario_results[r['scenario']].append(r) + # Do we consider results from virtual pods ... + # Do we consider results for non HA scenarios... + exclude_virtual_pod = get_config('functest.exclude_virtual') + exclude_noha = get_config('functest.exclude_noha') + if ((exclude_virtual_pod and "virtual" in r['pod_name']) or + (exclude_noha and "noha" in r['scenario'])): + print "exclude virtual pod results..." + else: + scenario_results[r['scenario']].append(r) return scenario_results @@ -254,13 +262,14 @@ def getResult(testCase, installer, scenario, version): def getJenkinsUrl(build_tag): # e.g. jenkins-functest-apex-apex-daily-colorado-daily-colorado-246 # id = 246 + # jenkins-functest-compass-huawei-pod5-daily-master-136 + # id = 136 # note it is linked to jenkins format # if this format changes...function to be adapted.... url_base = get_config('functest.jenkins_url') try: build_id = [int(s) for s in build_tag.split("-") if s.isdigit()] - jenkins_path = filter(lambda c: not c.isdigit(), build_tag) - url_id = jenkins_path[8:-1] + "/" + str(build_id[0]) + url_id = build_tag[8:-(len(build_id)+3)] + "/" + str(build_id[0]) jenkins_url = url_base + url_id + "/console" except: print 'Impossible to get jenkins url:' diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/README.md b/utils/test/vnfcatalogue/VNF_Catalogue/README.md new file mode 100644 index 000000000..32ad65416 --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/README.md @@ -0,0 +1,12 @@ +#VNF_Catalogue Nodejs + Jade + MySql server + + +## Quickstart + +First install the dependencies + + ```npm install``` + +Then Start the Server + + ```npm start``` diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/app.js b/utils/test/vnfcatalogue/VNF_Catalogue/app.js new file mode 100644 index 000000000..0f842b62d --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/app.js @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2017 Kumar Rishabh 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 + *******************************************************************************/ + +var express = require('express'); +var path = require('path'); +var favicon = require('serve-favicon'); +var logger = require('morgan'); +var cookieParser = require('cookie-parser'); +var bodyParser = require('body-parser'); + +var routes = require('./routes/index'); +var search_projects = require('./routes/search_projects'); + +var app = express(); + +// view engine setup +app.set('views', path.join(__dirname, 'views')); +app.set('view engine', 'jade'); + +// Database +var db = require('mysql2'); + +// uncomment after placing your favicon in /public +//app.use(favicon(__dirname + '/public/favicon.ico')); +app.use(logger('dev')); +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: false })); +app.use(cookieParser()); +app.use(express.static(path.join(__dirname, 'public'))); + +// Make our db accessible to our router +app.use(function(req,res,next){ + req.db = db; + next(); +}); + +app.use('/', routes); +app.use('/search_projects', search_projects); + + +// Some Error handling for now #TODO Remove + +/// catch 404 and forwarding to error handler +app.use(function(req, res, next) { + var err = new Error('Not Found'); + err.status = 404; + next(err); +}); + + +// development error handler +// will print stacktrace +if (app.get('env') === 'development') { + app.use(function(err, req, res, next) { + res.status(err.status || 500); + res.render('error', { + message: err.message, + error: err + }); + }); +} + +// production error handler +// no stacktraces leaked to user +app.use(function(err, req, res, next) { + res.status(err.status || 500); + res.render('error', { + message: err.message, + error: {} + }); +}); + +module.exports = app; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/bin/www b/utils/test/vnfcatalogue/VNF_Catalogue/bin/www new file mode 100644 index 000000000..3cfbf7796 --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/bin/www @@ -0,0 +1,9 @@ +#!/usr/bin/env node +var debug = require('debug')('my-application'); +var app = require('../app'); + +app.set('port', process.env.PORT || 3000); + +var server = app.listen(app.get('port'), function() { + debug('Express server listening on port ' + server.address().port); +}); diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/package.json b/utils/test/vnfcatalogue/VNF_Catalogue/package.json new file mode 100644 index 000000000..7c6a86730 --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/package.json @@ -0,0 +1,18 @@ +{ + "name": "VNF_Catalogue", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "node ./bin/www" + }, + "dependencies": { + "body-parser": "~1.15.1", + "cookie-parser": "~1.4.3", + "debug": "~2.2.0", + "express": "~4.13.4", + "jade": "~1.11.0", + "morgan": "~1.7.0", + "serve-favicon": "~2.3.0", + "mysql2": "*" + } +}
\ No newline at end of file diff --git a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/images/3rd_party/commits.png b/utils/test/vnfcatalogue/VNF_Catalogue/public/images/3rd_party/commits.png Binary files differindex 1247621a7..1247621a7 100644 --- a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/images/3rd_party/commits.png +++ b/utils/test/vnfcatalogue/VNF_Catalogue/public/images/3rd_party/commits.png diff --git a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/images/logo.png b/utils/test/vnfcatalogue/VNF_Catalogue/public/images/logo.png Binary files differindex fe18194ec..fe18194ec 100644 --- a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/images/logo.png +++ b/utils/test/vnfcatalogue/VNF_Catalogue/public/images/logo.png diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/public/javascripts/global.js b/utils/test/vnfcatalogue/VNF_Catalogue/public/javascripts/global.js new file mode 100644 index 000000000..73f16b67d --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/public/javascripts/global.js @@ -0,0 +1,16 @@ +/*******************************************************************************
+ * Copyright (c) 2017 Kumar Rishabh 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
+ *******************************************************************************/
+
+$(document).ready( function() {
+ $('#Search').click(function() {
+ var tags = $('#Tags').val().toLowerCase().split(/[ ,]+/);
+ window.location.href = '/search_projects?tags=' + tags;
+ return false;
+ });
+});
diff --git a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/css/3rd_party/bootstrap.css b/utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/3rd_party/bootstrap.css index b9c239621..b9c239621 100755 --- a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/css/3rd_party/bootstrap.css +++ b/utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/3rd_party/bootstrap.css diff --git a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/css/style.css b/utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/style.css index a37340cd3..e9b3c2d58 100644 --- a/utils/test/vnfcatalogue/assets/Vnf_landing/assets/css/style.css +++ b/utils/test/vnfcatalogue/VNF_Catalogue/public/stylesheets/style.css @@ -39,7 +39,7 @@ header ul li } header .logo { - background: url(../images/logo.png) no-repeat; + background: url(../../images/logo.png) no-repeat; background-size: cover; width: 155px; height: 34px; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/routes/index.js b/utils/test/vnfcatalogue/VNF_Catalogue/routes/index.js new file mode 100644 index 000000000..950fcd57e --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/routes/index.js @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright (c) 2017 Kumar Rishabh 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 + *******************************************************************************/ + +var express = require('express'); +var router = express.Router(); + +/* GET VNF_Catalogue Home Page. */ +router.get('/', function(req, res) { + res.render('index', { title: 'Express' }); +}); + +module.exports = router; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/routes/search_projects.js b/utils/test/vnfcatalogue/VNF_Catalogue/routes/search_projects.js new file mode 100644 index 000000000..49fceeb3c --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/routes/search_projects.js @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2017 Kumar Rishabh 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 + *******************************************************************************/ + +var express = require('express'); +var router = express.Router(); + +router.get('/', function(req, res) { + var tags = req.param('tags'); + console.log(tags); + res.render('search_projects', { title: 'Express' }); +}); + +module.exports = router; diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/views/error.jade b/utils/test/vnfcatalogue/VNF_Catalogue/views/error.jade new file mode 100644 index 000000000..4f7fbcaeb --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/views/error.jade @@ -0,0 +1,12 @@ +// + Copyright (c) 2017 Kumar Rishabh 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 +extends layout + +block content + h1= message + h2= error.status + pre #{error.stack} diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/views/index.jade b/utils/test/vnfcatalogue/VNF_Catalogue/views/index.jade new file mode 100644 index 000000000..b183f360f --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/views/index.jade @@ -0,0 +1,131 @@ +doctype html +// + Copyright (c) 2017 Kumar Rishabh 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 +html(lang='en') + head + meta(charset='UTF-8') + title Document + link(rel='stylesheet', href='/stylesheets/3rd_party/bootstrap.css') + link(rel='stylesheet', href='/stylesheets/style.css') + body + script(type='text/javascript' src='http://code.jquery.com/jquery.min.js') + script(src='/javascripts/global.js') + header + ul.navigation + li.logo + li.links + a(href='#') Projects + li.links + a(href='#') People + li.links + a(href='#') About + ul.navigation-right + li.signup + a(href='#') Sign up + li.option or + li.signin + a(href='#') Sign in + .search-box + h1 VNF Catalogue + form.search-form + input.search-input(type='text', placeholder='Search...', id='Tags') + .space-10 + button.search-button(type='submit', value='Search', id='Search') Search + .content + ul.most-menu + li.items.active + a(href='#') Most Popular + li.items + a(href='#') Most Active + li.items + a(href='#') Most Active Contributions + .container + .row + .box-container + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + footer + | © 2017 OPNFV +script. diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/views/layout.jade b/utils/test/vnfcatalogue/VNF_Catalogue/views/layout.jade new file mode 100644 index 000000000..7cc7dfc92 --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/views/layout.jade @@ -0,0 +1,15 @@ +doctype html +// + Copyright (c) 2017 Kumar Rishabh 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 +html + head + title= title + link(rel='stylesheet', href='/stylesheets/style.css') + body + block content + script(src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js') + script(src='/javascripts/global.js') diff --git a/utils/test/vnfcatalogue/VNF_Catalogue/views/search_projects.jade b/utils/test/vnfcatalogue/VNF_Catalogue/views/search_projects.jade new file mode 100644 index 000000000..3076543af --- /dev/null +++ b/utils/test/vnfcatalogue/VNF_Catalogue/views/search_projects.jade @@ -0,0 +1,128 @@ +doctype html +// + Copyright (c) 2017 Kumar Rishabh 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 +html(lang='en') + head + meta(charset='UTF-8') + title Document + link(rel='stylesheet', href='/stylesheets/3rd_party/bootstrap.css') + link(rel='stylesheet', href='/stylesheets/style.css') + body + header + ul.navigation + li.logo + li.links + a(href='#') Projects + li.links + a(href='#') People + li.links + a(href='#') About + ul.navigation-right + li.signup + a(href='#') Sign up + li.option or + li.signin + a(href='#') Sign in + .search-box + h1 VNF Catalogue + form.search-form + input.search-input(type='text', placeholder='Search...') + .space-10 + button.search-button(type='submit', value='Search') Search + .content + ul.most-menu + li.items.active + a(href='#') Most Popular + li.items + a(href='#') Most Active + li.items + a(href='#') Most Active Contributions + .container + .row + .box-container + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + .col-md-3 + .content-box + .content-data + h1.content-title AAA + .box + img.commit-icon(src='/images/3rd_party/commits.png') + h3.commits + | 4,845 + br + | commits + footer + | © 2017 OPNFV diff --git a/utils/test/vnfcatalogue/assets/Vnf_landing/index.html b/utils/test/vnfcatalogue/assets/Vnf_landing/index.html deleted file mode 100644 index 5aebd4681..000000000 --- a/utils/test/vnfcatalogue/assets/Vnf_landing/index.html +++ /dev/null @@ -1,145 +0,0 @@ -<!-- - Copyright (c) 2017 Kumar Rishabh 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 ---> - -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>Document</title> - <link rel="stylesheet" href="assets/css/3rd_party/bootstrap.css"> - <link rel="stylesheet" href="assets/css/style.css"> -</head> -<body> -<header> - <ul class="navigation"> - <li class="logo"></li> - <li class="links"><a href="#">Projects</a></li> - <li class="links"><a href="#">People</a></li> - <li class="links"><a href="#">About</a></li> - </ul> - <ul class="navigation-right"> - <li class="signup"><a href="#">Sign up</a></li> - <li class="option">or</li> - <li class="signin"><a href="#">Sign in</a></li> - </ul> -</header> -<div class="search-box"> - <h1>VNF Catalogue</h1> - <form class="search-form"> - <input type="text" placeholder="Search..." class="search-input"> - <div class="space-10"></div> - <button type="submit" value="Search" class="search-button">Search</button> - </form> -</div> -<div class="content"> -<ul class="most-menu"> - <li class="items active"><a href="#">Most Popular</a></li> - <li class="items"><a href="#">Most Active</a></li> - <li class="items"><a href="#">Most Active Contributions</a></li> -</ul> -<div class="container"> - <div class="row"> - <div class="box-container"> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - <div class="col-md-3"> - <div class="content-box"> - <div class="content-data"> - <h1 class="content-title">AAA</h1> - <div class="box"> - <img src="assets/images/3rd_party/commits.png" class="commit-icon"> - <h3 class="commits">4,845<br>commits</h3> - </div> - </div> - </div> - </div> - </div> -</div> -<footer> - © 2017 OPNFV -</footer> -</div> -</body> -</html> |