diff options
Diffstat (limited to 'jjb')
-rwxr-xr-x | jjb/dovetail/dovetail-artifacts-upload.sh | 24 | ||||
-rwxr-xr-x | jjb/dovetail/dovetail-cleanup.sh | 27 | ||||
-rw-r--r-- | jjb/fuel/fuel-verify-jobs.yml | 8 | ||||
-rwxr-xr-x | jjb/functest/functest-cleanup.sh | 2 | ||||
-rw-r--r-- | jjb/global/releng-macros.yml | 33 | ||||
-rw-r--r-- | jjb/kvmfornfv/kvmfornfv.yml | 30 | ||||
-rw-r--r-- | jjb/releng/opnfv-lint.yml | 53 | ||||
-rw-r--r-- | jjb/vswitchperf/vswitchperf.yml | 6 | ||||
-rw-r--r-- | jjb/yardstick/yardstick-ci-jobs.yml | 7 | ||||
-rwxr-xr-x | jjb/yardstick/yardstick-daily.sh | 9 |
10 files changed, 171 insertions, 28 deletions
diff --git a/jjb/dovetail/dovetail-artifacts-upload.sh b/jjb/dovetail/dovetail-artifacts-upload.sh index 94e4129fc..ce02dd569 100755 --- a/jjb/dovetail/dovetail-artifacts-upload.sh +++ b/jjb/dovetail/dovetail-artifacts-upload.sh @@ -17,6 +17,17 @@ cd ${CACHE_DIR} sudo docker pull ${DOCKER_REPO_NAME}:${DOCKER_TAG} sudo docker save -o ${STORE_FILE_NAME} ${DOCKER_REPO_NAME}:${DOCKER_TAG} +OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S") +GS_UPLOAD_LOCATION="${STORE_URL}/${OPNFV_ARTIFACT_VERSION}" +( + echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION" + echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)" + echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)" + echo "OPNFV_ARTIFACT_URL=$GS_UPLOAD_LOCATION" + echo "OPNFV_BUILD_URL=$BUILD_URL" +) > $WORKSPACE/opnfv.properties +source $WORKSPACE/opnfv.properties + importkey () { # clone releng repository echo "Cloning releng repository..." @@ -45,7 +56,18 @@ echo cd $WORKSPACE # upload artifact and additional files to google storage -gsutil cp ${CACHE_DIR}/${STORE_FILE_NAME} ${STORE_URL}/${STORE_FILE_NAME} +gsutil cp ${CACHE_DIR}/${STORE_FILE_NAME} \ +${STORE_URL}/${STORE_FILE_NAME} > gsutil.dockerfile.log 2>&1 +gsutil cp $WORKSPACE/opnfv.properties \ +${STORE_URL}/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1 +gsutil cp $WORKSPACE/opnfv.properties \ + ${STORE_URL}/latest.properties > gsutil.latest.log 2>&1 + +gsutil -m setmeta \ + -h "Content-Type:text/html" \ + -h "Cache-Control:private, max-age=0, no-transform" \ + ${STORE_URL}/latest.properties \ + ${STORE_URL}/opnfv-$OPNFV_ARTIFACT_VERSION.properties > /dev/null 2>&1 gsutil -m setmeta \ -h "Cache-Control:private, max-age=0, no-transform" \ diff --git a/jjb/dovetail/dovetail-cleanup.sh b/jjb/dovetail/dovetail-cleanup.sh index f215278db..22b2ba2ce 100755 --- a/jjb/dovetail/dovetail-cleanup.sh +++ b/jjb/dovetail/dovetail-cleanup.sh @@ -2,14 +2,35 @@ [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" -echo "Cleaning up docker containers/images..." -# Remove previous running containers if exist +#clean up dependent project docker images, which has no containers and image tag None +clean_images=(opnfv/functest opnfv/yardstick) +for clean_image in "${clean_images[@]}"; do + echo "Removing image $image_id, which has no containers and image tag is None" + dangling_images=($(docker images -f "dangling=true" | grep ${clean_image} | awk '{print $3}')) + if [[ -n ${dangling_images} ]]; then + for image_id in "${dangling_images[@]}"; do + docker rmi $image_id >${redirect} + done + fi +done + +echo "Remove containers with image dovetail:<None>..." +dangling_images=($(docker images -f "dangling=true" | grep opnfv/dovetail | awk '{print $3}')) +if [[ -n ${dangling_images} ]]; then + for image_id in "${dangling_images[@]}"; do + echo "Removing image $image_id with tag None and its related containers" + docker ps -a | grep $image_id | awk '{print $1}'| xargs docker rm -f >${redirect} + docker rmi $image_id >${redirect} + done +fi + +echo "Cleaning up dovetail docker containers/images..." if [[ ! -z $(docker ps -a | grep opnfv/dovetail) ]]; then echo "Removing existing opnfv/dovetail containers..." docker ps -a | grep opnfv/dovetail | awk '{print $1}' | xargs docker rm -f >${redirect} fi -# Remove existing images if exist +echo "Remove dovetail existing images if exist..." if [[ ! -z $(docker images | grep opnfv/dovetail) ]]; then echo "Docker images to remove:" docker images | head -1 && docker images | grep opnfv/dovetail >${redirect} diff --git a/jjb/fuel/fuel-verify-jobs.yml b/jjb/fuel/fuel-verify-jobs.yml index fe8985392..4a76d9da7 100644 --- a/jjb/fuel/fuel-verify-jobs.yml +++ b/jjb/fuel/fuel-verify-jobs.yml @@ -21,13 +21,13 @@ ##################################### phase: - 'basic': - slave-label: 'opnfv-build' + slave-label: 'opnfv-build-ubuntu' - 'build': slave-label: 'opnfv-build-ubuntu' - 'deploy-virtual': - slave-label: 'opnfv-build' + slave-label: 'opnfv-build-ubuntu' - 'smoke-test': - slave-label: 'opnfv-build' + slave-label: 'opnfv-build-ubuntu' ##################################### # jobs ##################################### @@ -97,7 +97,7 @@ project: '{project}' - gerrit-parameter: branch: '{branch}' - - 'opnfv-build-defaults' + - 'opnfv-build-ubuntu-defaults' - 'fuel-verify-defaults': gs-pathname: '{gs-pathname}' diff --git a/jjb/functest/functest-cleanup.sh b/jjb/functest/functest-cleanup.sh index f8140e058..b03d4778d 100755 --- a/jjb/functest/functest-cleanup.sh +++ b/jjb/functest/functest-cleanup.sh @@ -5,7 +5,7 @@ echo "Cleaning up docker containers/images..." FUNCTEST_IMAGE=opnfv/functest # Remove containers along with image opnfv/functest:<none> -dangling_images=($(docker images -f "dangling=true" | grep $FUNCTEST_IMAGE | awk '{print $1}')) +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..." for image_id in "${dangling_images[@]}"; do diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index cd92480d4..7647a35d3 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -355,3 +355,36 @@ name: check-bash-syntax builders: - shell: "find . -name '*.sh' | xargs bash -n" + +- builder: + name: lint-yaml-code + builders: + - shell: | + #!/bin/bash + set -o errexit + set -o pipefail + set -o xtrace + export PATH=$PATH:/usr/local/bin/ + + # generate and upload lint log + echo "Running yaml code on $PROJECT ..." + + # Ensure we start with a clean environment + rm -f yaml-violation.log lint.log + + # Get number of yaml violations. If none, this will be an + # empty string: "" + find . \ + -path './releng_yamllint' -prune -o \ + -path './.tox' -prune -o \ + -type f -name "*.yml" -print \ + -o -name "*.yaml" -print | \ + xargs yamllint > yaml-violation.log || true + + if [ -s "yaml-violation.log" ]; then + SHOWN=$(cat yaml-violation.log| grep -v "^$" |wc -l) + echo -e "First $SHOWN shown\n---" > lint.log + cat yaml-violation.log >> lint.log + sed -r -i '4,$s/^/ /g' lint.log + fi + diff --git a/jjb/kvmfornfv/kvmfornfv.yml b/jjb/kvmfornfv/kvmfornfv.yml index 33c73f9a7..8ab821c9b 100644 --- a/jjb/kvmfornfv/kvmfornfv.yml +++ b/jjb/kvmfornfv/kvmfornfv.yml @@ -96,19 +96,19 @@ node-parameters: false kill-phase-on: FAILURE abort-all-job: true - - multijob: - name: test - condition: SUCCESSFUL - projects: - - name: 'kvmfornfv-verify-test-{stream}' - current-parameters: false - predefined-parameters: | - GERRIT_BRANCH=$GERRIT_BRANCH - GERRIT_REFSPEC=$GERRIT_REFSPEC - GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER - node-parameters: false - kill-phase-on: FAILURE - abort-all-job: true +# - multijob: +# name: test +# condition: SUCCESSFUL +# projects: +# - name: 'kvmfornfv-verify-test-{stream}' +# current-parameters: false +# predefined-parameters: | +# GERRIT_BRANCH=$GERRIT_BRANCH +# GERRIT_REFSPEC=$GERRIT_REFSPEC +# GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER +# node-parameters: false +# kill-phase-on: FAILURE +# abort-all-job: true - job-template: name: 'kvmfornfv-verify-{phase}-{stream}' @@ -194,8 +194,8 @@ scm: - git-scm - triggers: - - timed: '@midnight' +# triggers: +# - timed: '@midnight' builders: - description-setter: diff --git a/jjb/releng/opnfv-lint.yml b/jjb/releng/opnfv-lint.yml index 7115cce48..a96fce6b0 100644 --- a/jjb/releng/opnfv-lint.yml +++ b/jjb/releng/opnfv-lint.yml @@ -9,6 +9,7 @@ jobs: - 'opnfv-lint-verify-{stream}' + - 'opnfv-yamllint-verify-{stream}' stream: - master: @@ -64,3 +65,55 @@ builders: - lint-python-code - report-lint-result-to-gerrit + +- job-template: + name: 'opnfv-yamllint-verify-{stream}' + + disabled: '{obj:disabled}' + + concurrent: true + + parameters: + - project-parameter: + project: $GERRIT_PROJECT + - gerrit-parameter: + branch: '{branch}' + - node: + name: SLAVE_NAME + description: Slaves to execute yamllint + default-slaves: + - lf-build1 + allowed-multiselect: true + ignore-offline-nodes: true + + 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: 'REG_EXP' + project-pattern: 'compass4nfv' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: '**/*.yml' + - compare-type: ANT + pattern: '**/*.yaml' + + builders: + - lint-yaml-code + - report-lint-result-to-gerrit diff --git a/jjb/vswitchperf/vswitchperf.yml b/jjb/vswitchperf/vswitchperf.yml index 0d2c67b3f..fe8ea5381 100644 --- a/jjb/vswitchperf/vswitchperf.yml +++ b/jjb/vswitchperf/vswitchperf.yml @@ -46,7 +46,7 @@ pwd cd src make clobber - make + make MORE_MAKE_FLAGS="-j 10" # run basic sanity test make sanity cd ../ci @@ -107,7 +107,7 @@ pwd cd src make clobber - make + make MORE_MAKE_FLAGS="-j 5" # run basic sanity test make sanity cd ../ci @@ -162,6 +162,6 @@ pwd cd src make clobber - make + make MORE_MAKE_FLAGS="-j 5" cd ../ci ./build-vsperf.sh merge diff --git a/jjb/yardstick/yardstick-ci-jobs.yml b/jjb/yardstick/yardstick-ci-jobs.yml index 33f557a33..1ad5417d4 100644 --- a/jjb/yardstick/yardstick-ci-jobs.yml +++ b/jjb/yardstick/yardstick-ci-jobs.yml @@ -268,6 +268,7 @@ - 'yardstick-cleanup' #- 'yardstick-fetch-os-creds' - 'yardstick-{testsuite}' + - 'yardstick-store-results' publishers: - email: @@ -295,6 +296,12 @@ !include-raw: ../../utils/fetch_os_creds.sh - builder: + name: yardstick-store-results + builders: + - shell: + !include-raw: ../../utils/push-test-logs.sh + +- builder: name: yardstick-cleanup builders: - shell: diff --git a/jjb/yardstick/yardstick-daily.sh b/jjb/yardstick/yardstick-daily.sh index b3705415f..da9042bbc 100755 --- a/jjb/yardstick/yardstick-daily.sh +++ b/jjb/yardstick/yardstick-daily.sh @@ -37,8 +37,15 @@ envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \ echo "Yardstick: Pulling image opnfv/yardstick:${DOCKER_TAG}" docker pull opnfv/yardstick:$DOCKER_TAG >$redirect +# map log directory +branch=${GIT_BRANCH##*/} +dir_result="${HOME}/opnfv/yardstick/results/${branch}" +mkdir -p ${dir_result} +sudo rm -rf ${dir_result}/* +map_log_dir="-v ${dir_result}:/tmp/yardstick" + # Run docker -cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick:${DOCKER_TAG} \ +cmd="sudo docker run ${opts} ${envs} ${labconfig} ${map_log_dir} ${sshkey} opnfv/yardstick:${DOCKER_TAG} \ exec_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SCENARIO_SUITE_NAME}" echo "Yardstick: Running docker cmd: ${cmd}" ${cmd} |