diff options
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/container4nfv/container4nfv-project.yml | 14 | ||||
-rw-r--r-- | jjb/daisy4nfv/daisy-daily-jobs.yml | 3 | ||||
-rw-r--r-- | jjb/daisy4nfv/daisy-project-jobs.yml | 67 | ||||
-rwxr-xr-x | jjb/daisy4nfv/daisy4nfv-build-kolla-image.sh | 94 | ||||
-rw-r--r-- | jjb/doctor/doctor.yml | 134 | ||||
-rw-r--r-- | jjb/global/releng-macros.yml | 81 | ||||
-rw-r--r-- | jjb/global/slave-params.yml | 15 | ||||
-rw-r--r-- | jjb/opnfvdocs/docs-rtd.yaml | 3 | ||||
-rw-r--r-- | jjb/opnfvdocs/opnfvdocs.yml | 29 | ||||
-rw-r--r-- | jjb/qtip/qtip-validate-jobs.yml | 4 | ||||
-rw-r--r-- | jjb/releng/functest-docker.yml | 268 | ||||
-rw-r--r-- | jjb/releng/opnfv-docker-arm.yml | 12 | ||||
-rw-r--r-- | jjb/releng/opnfv-docker.sh | 22 | ||||
-rw-r--r-- | jjb/releng/opnfv-docker.yml | 13 | ||||
-rw-r--r-- | jjb/releng/opnfv-docs.yml | 115 | ||||
-rwxr-xr-x | jjb/releng/opnfv-manifest.sh | 42 | ||||
-rw-r--r-- | jjb/releng/opnfv-repo-archiver.sh | 2 |
17 files changed, 640 insertions, 278 deletions
diff --git a/jjb/container4nfv/container4nfv-project.yml b/jjb/container4nfv/container4nfv-project.yml index ffdbf9551..9e2d313c8 100644 --- a/jjb/container4nfv/container4nfv-project.yml +++ b/jjb/container4nfv/container4nfv-project.yml @@ -31,6 +31,12 @@ - project-parameter: project: '{project}' branch: '{branch}' + # yamllint disable rule:line-length + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW." + # yamllint enable rule:line-length - 'opnfv-build-ubuntu-defaults' scm: @@ -82,6 +88,12 @@ - project-parameter: project: '{project}' branch: '{branch}' + # yamllint disable rule:line-length + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW." + # yamllint enable rule:line-length - node: name: SLAVE_NAME description: 'Slave name on Jenkins' @@ -97,6 +109,6 @@ - timed: '@midnight' builders: - - shell: + - shell: | cd $WORKSPACE/ci ./deploy.sh diff --git a/jjb/daisy4nfv/daisy-daily-jobs.yml b/jjb/daisy4nfv/daisy-daily-jobs.yml index f2626db1c..090d2e1f2 100644 --- a/jjb/daisy4nfv/daisy-daily-jobs.yml +++ b/jjb/daisy4nfv/daisy-daily-jobs.yml @@ -93,7 +93,9 @@ - build-blocker: use-build-blocker: true blocking-jobs: + - 'daisy-os-.*?-{pod}-daily-.*?' - 'daisy-daily-.*' + - 'daisy-kolla-build-.*' block-level: 'NODE' wrappers: @@ -177,6 +179,7 @@ use-build-blocker: true blocking-jobs: - 'daisy.*-deploy-({pod})?-daily-.*' + - 'daisy-kolla-build-.*' block-level: 'NODE' parameters: diff --git a/jjb/daisy4nfv/daisy-project-jobs.yml b/jjb/daisy4nfv/daisy-project-jobs.yml index b6e9526e3..006153f6f 100644 --- a/jjb/daisy4nfv/daisy-project-jobs.yml +++ b/jjb/daisy4nfv/daisy-project-jobs.yml @@ -37,6 +37,72 @@ jobs: - '{installer}-daily-{stream}' - '{installer}-{phase}-daily-{stream}' + - '{installer}-kolla-build-{stream}' + +############################# +# docker build job templates +############################# +- job-template: + name: '{installer}-kolla-build-{stream}' + disabled: false + concurrent: true + + properties: + - logrotate-default + - throttle: + enabled: true + max-total: 4 + option: 'project' + - build-blocker: + use-build-blocker: true + # Note: Need to block all jobs which may create daisy VM. + blocking-jobs: + - '{installer}-kolla-build-.*' + - 'daisy-deploy-.*' + - 'daisy-daily-.*' + block-level: 'NODE' + + scm: + - git-scm + + triggers: + - 'daisy-kolla-build-{stream}-trigger' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'daisy-virtual-defaults' + - '{installer}-defaults' + - '{installer}-project-parameter': + gs-pathname: '{gs-pathname}' + + wrappers: + - ssh-agent-wrapper + - timeout: + timeout: 720 + fail: true + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - shell: + !include-raw-escape: ./daisy4nfv-build-kolla-image.sh + + publishers: + - '{installer}-recipients' + - email-jenkins-admins-on-failure + +- trigger: + name: 'daisy-kolla-build-euphrates-trigger' + triggers: + - timed: '0 0 * * 0' + +- trigger: + name: 'daisy-kolla-build-master-trigger' + triggers: + - timed: '0 12 * * 0' + ######################## # job templates @@ -60,6 +126,7 @@ use-build-blocker: true blocking-jobs: - '{installer}-daily-.*' + - '{installer}-kolla-build-.*' - 'daisy4nfv-merge-build-.*' - 'daisy4nfv-verify-build-.*' block-level: 'NODE' diff --git a/jjb/daisy4nfv/daisy4nfv-build-kolla-image.sh b/jjb/daisy4nfv/daisy4nfv-build-kolla-image.sh new file mode 100755 index 000000000..9a1e2fc20 --- /dev/null +++ b/jjb/daisy4nfv/daisy4nfv-build-kolla-image.sh @@ -0,0 +1,94 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2016 ZTE Coreporation and others. +# hu.zhijiang@zte.com.cn +# sun.jing22@zte.com.cn +# 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 -o errexit +set -o nounset +set -o pipefail + +importkey () { + # clone releng repository + echo "Cloning releng repository..." + [ -d releng ] && rm -rf releng + git clone https://gerrit.opnfv.org/gerrit/releng ./releng/ &> /dev/null + #this is where we import the siging key + if [ -f ./releng/utils/gpg_import_key.sh ]; then + source ./releng/utils/gpg_import_key.sh + fi +} + +upload_image_to_opnfv () { + image=$1 + + importkey + if gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then + echo "Signing Key avaliable" + SIGN_ARTIFACT="true" + fi + + if [[ -n "$SIGN_ARTIFACT" && "$SIGN_ARTIFACT" == "true" ]]; then + gpg2 -vvv --batch --yes --no-tty \ + --default-key opnfv-helpdesk@rt.linuxfoundation.org \ + --passphrase besteffort \ + --detach-sig $image + gsutil cp $image.sig gs://$GS_URL/upstream/$image.sig + echo "Image signature upload complete!" + fi + + sha512sum -b $image > $image.sha512sum + gsutil cp $image.sha512sum gs://$GS_URL/upstream/$image.sha512sum + + echo "Uploading $INSTALLER_TYPE artifact. This could take some time..." + echo + gsutil cp $image gs://$GS_URL/upstream/$image + gsutil -m setmeta \ + -h "Cache-Control:private, max-age=0, no-transform" \ + gs://$GS_URL/upstream/$image + + # check if we uploaded the file successfully to see if things are fine + gsutil ls gs://$GS_URL/upstream/$image + if [[ $? -ne 0 ]]; then + echo "Problem while uploading artifact!" + exit 1 + fi +} + + + +echo "--------------------------------------------------------" +echo "This is diasy4nfv kolla image build job!" +echo "--------------------------------------------------------" + +# start the build +cd $WORKSPACE +rm -rf docker_build_dir +mkdir -p docker_build_dir + +# -j is for deciding which branch will be used when building, +# only for OPNFV +sudo -E ./ci/kolla-build.sh -j $JOB_NAME -w $WORKSPACE/docker_build_dir + +if [ $? -ne 0 ]; then + echo + echo "Kolla build failed!" + deploy_ret=1 +else + echo + echo "--------------------------------------------------------" + echo "Kolla build done!" +fi + +image=$(ls $WORKSPACE/docker_build_dir/kolla-build-output/kolla-image-*.tgz) +upload_image_to_opnfv $image + +echo +echo "--------------------------------------------------------" +echo "All done!" diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index 6a04c5fbc..e28f74431 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -25,6 +25,12 @@ # slave-label: 'ool-virtual3' # pod: 'ool-virtual3' + phase: + - 'build-x86_64': + slave-label: 'opnfv-build-ubuntu' + - 'build-aarch64': + slave-label: 'opnfv-build-ubuntu-arm' + inspector: - 'sample' - 'congress' @@ -37,22 +43,23 @@ auto-trigger-name: 'doctor-verify' is-python: true - pod: - - armband-baremetal: - slave-label: '{pod}' - - armband-virtual: - slave-label: '{pod}' + exclude: + - installer: 'apex' + phase: 'build-aarch64' jobs: - 'doctor-verify-{stream}' - - 'doctor-{task}-{installer}-{inspector}-{pod}-{stream}' + - 'doctor-verify-unit-test-{stream}' - 'doctor-{task}-{installer}-{inspector}-{stream}' + - 'doctor-{task}-{installer}-{inspector}-{phase}-{stream}' - job-template: name: 'doctor-verify-{stream}' disabled: '{obj:disabled}' + project-type: 'multijob' + parameters: - project-parameter: project: '{project}' @@ -86,38 +93,54 @@ pattern: 'doctor_tests/**' builders: - - shell: "[ -e tests/run.sh ] && bash -n ./tests/run.sh" + - shell: | + #!/bin/bash + # we do nothing here as the main stuff will be done + # in phase jobs + echo "Triggering phase jobs!" + - multijob: + name: 'doctor-build-and-unittest' + execution-type: PARALLEL + projects: + - name: 'doctor-verify-unit-test-{stream}' + current-parameters: false + predefined-parameters: | + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + git-revision: true + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: false - job-template: - name: 'doctor-{task}-{installer}-{inspector}-{pod}-{stream}' - - node: '{slave-label}' - + name: 'doctor-verify-unit-test-{stream}' disabled: '{obj:disabled}' - + wrappers: + - ssh-agent-wrapper + - build-timeout: + timeout: 60 parameters: - project-parameter: project: '{project}' branch: '{branch}' - 'opnfv-build-ubuntu-defaults' - scm: - git-scm-gerrit - - - triggers: - - '{auto-trigger-name}': - project: '{project}' - branch: '{branch}' - files: 'doctor_tests/**' - builders: - - shell: "[ -e tests/run.sh ] && bash -n ./tests/run.sh" + - 'doctor-verify-unit-test-builders-macro' + publishers: + - 'doctor-verify-unit-test-publishers-macro' - job-template: name: 'doctor-{task}-{installer}-{inspector}-{stream}' + disabled: '{obj:disabled}' + + project-type: 'multijob' + node: '{slave-label}' parameters: @@ -151,13 +174,17 @@ default: 'doctor-notification' - string: name: TESTCASE_OPTIONS + # yamllint disable rule:line-length default: '-e INSPECTOR_TYPE={inspector} -e PYTHON_ENABLE={is-python} -v $WORKSPACE:/home/opnfv/repos/doctor' + # yamllint enable rule:line-length description: 'Addtional parameters specific to test case(s)' # functest-parameter - string: name: GS_PATHNAME default: '{gs-pathname}' + # yamllint disable rule:line-length description: "Version directory where the opnfv documents will be stored in gs repository" + # yamllint enable rule:line-length - string: name: FUNCTEST_REPO_DIR default: "/home/opnfv/repos/functest" @@ -181,7 +208,59 @@ files: 'doctor_tests/**' builders: + - shell: | + #!/bin/bash + # we do nothing here as the main stuff will be done + # in phase jobs + echo "Triggering phase jobs!" + - multijob: + name: 'doctor-verify-installer-inspector' + execution-type: PARALLEL + projects: + - name: 'doctor-{task}-{installer}-{inspector}-build-x86_64-{stream}' + current-parameters: false + git-revision: true + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: false + - name: 'doctor-{task}-{installer}-{inspector}-build-aarch64-{stream}' + current-parameters: false + git-revision: true + node-parameters: false + kill-phase-on: FAILURE + abort-all-job: false + +- job-template: + name: 'doctor-{task}-{installer}-{inspector}-{phase}-{stream}' + disabled: '{obj:disabled}' + wrappers: + - ssh-agent-wrapper + - build-timeout: + timeout: 30 + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - '{slave-label}-defaults' + scm: + - git-scm-gerrit + builders: + - 'doctor-verify-installer-inspector-builders-macro' + publishers: + - 'doctor-verify-publishers-macro' +# ------------------------------- +# builder macros +# ------------------------------- + +- builder: + name: 'doctor-verify-unit-test-builders-macro' + builders: + - shell: "[ -e tests/run.sh ] && bash -n ./tests/run.sh" +- builder: + name: 'doctor-verify-installer-inspector-builders-macro' + builders: - 'clean-workspace-log' + # yamllint disable rule:line-length - shell: | # NOTE: Create symbolic link, so that we can archive file outside # of $WORKSPACE . @@ -200,14 +279,23 @@ # NOTE: checking the test result, as the previous job could return # 0 regardless the result of doctor test scenario. grep -e 'doctor test successfully' $functest_log || exit 1 + # yamllint enable rule:line-length +# ------------------------------- +# publisher macros +# ------------------------------- +- publisher: + name: 'doctor-verify-publishers-macro' publishers: - archive: artifacts: 'doctor_tests/*.log' - archive: artifacts: 'functest_results/$FUNCTEST_SUITE_NAME.log' - email-jenkins-admins-on-failure - +- publisher: + name: 'doctor-verify-unit-test-publishers-macro' + publishers: + - email-jenkins-admins-on-failure ##################################### # trigger macros diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index e00047ba0..62c22bd3f 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -196,17 +196,6 @@ sudo chown -R $USER:$USER $WORKSPACE || exit 1 - builder: - name: build-html-and-pdf-docs-output - builders: - - shell: | - #!/bin/bash - set -o errexit - set -o xtrace - export PATH=$PATH:/usr/local/bin/ - git clone ssh://gerrit.opnfv.org:29418/opnfvdocs docs_build/_opnfvdocs - GERRIT_COMMENT=gerrit_comment.txt ./docs_build/_opnfvdocs/scripts/docs-build.sh - -- builder: name: upload-under-review-docs-to-opnfv-artifacts builders: - shell: | @@ -217,7 +206,7 @@ export PATH=$PATH:/usr/local/bin/ [[ $GERRIT_CHANGE_NUMBER =~ .+ ]] - [[ -d docs_output ]] || exit 0 + [[ -d docs/_build/ ]] || exit 0 echo echo "###########################" @@ -230,7 +219,7 @@ local_path="upload/$GERRIT_CHANGE_NUMBER" mkdir -p upload - mv docs_output "$local_path" + mv docs/_build/html/ "$local_path" gsutil -m cp -r "$local_path" "gs://$gs_base" gsutil -m setmeta \ @@ -242,46 +231,6 @@ find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \ sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt -- builder: - name: upload-generated-docs-to-opnfv-artifacts - builders: - - shell: | - #!/bin/bash - set -o errexit - set -o pipefail - set -o xtrace - export PATH=$PATH:/usr/local/bin/ - - [[ -d docs_output ]] || exit 0 - - echo - echo "########################" - echo "UPLOADING GENERATED DOCS" - echo "########################" - echo - - echo "gs_path="$GS_URL/docs"" - echo "local_path="upload/docs"" - - gs_path="$GS_URL/docs" - local_path="upload/docs" - - mkdir -p upload - mv docs_output "$local_path" - ls "$local_path" - - echo "gsutil -m cp -r "$local_path"/* "gs://$gs_path"" - gsutil -m cp -r "$local_path"/* "gs://$gs_path" - - gsutil -m setmeta \ - -h "Content-Type:text/html" \ - -h "Cache-Control:private, max-age=0, no-transform" \ - "gs://$gs_path"/**.html > /dev/null 2>&1 - - echo "Document link(s):" >> gerrit_comment.txt - find "$local_path" | grep -e 'index.html$' -e 'pdf$' | \ - sed -e "s|^$local_path| http://$gs_path|" >> gerrit_comment.txt - # To take advantage of this macro, have your build write # out the file 'gerrit_comment.txt' with information to post # back to gerrit and include this macro in the list of builders. @@ -431,19 +380,10 @@ - builder: name: upload-review-docs builders: - - build-html-and-pdf-docs-output - upload-under-review-docs-to-opnfv-artifacts - report-build-result-to-gerrit - builder: - name: upload-merged-docs - builders: - - build-html-and-pdf-docs-output - - upload-generated-docs-to-opnfv-artifacts - - report-build-result-to-gerrit - - remove-old-docs-from-opnfv-artifacts - -- builder: name: check-bash-syntax builders: - shell: "find . -name '*.sh' | xargs bash -n" @@ -459,23 +399,24 @@ export PATH=$PATH:/usr/local/bin/ # install python packages - pip install "yamllint==1.6.0" + sudo pip install "yamllint==1.8.2" # generate and upload lint log echo "Running yaml code on $PROJECT ..." + # Get list of yaml files + YAML_FILES=$(git --no-pager diff --diff-filter=MCRAT --name-only HEAD^1 | egrep "ya?ml$") + # 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 . \ - -type f -name "*.yml" -print \ - -o -name "*.yaml" -print | \ - xargs yamllint > yaml-violation.log || true + # Yamllint files only in patchset + for yamlfile in $YAML_FILES; do + yamllint $yamlfile >> yaml-violation.log || true + done if [ -s "yaml-violation.log" ]; then - SHOWN=$(cat yaml-violation.log| grep -v "^$" |wc -l) + SHOWN=$(grep -c -v "^$" yaml-violation.log) echo -e "First $SHOWN shown\n---" > lint.log cat yaml-violation.log >> lint.log sed -r -i '4,$s/^/ /g' lint.log diff --git a/jjb/global/slave-params.yml b/jjb/global/slave-params.yml index 0ea37d941..04de1e091 100644 --- a/jjb/global/slave-params.yml +++ b/jjb/global/slave-params.yml @@ -757,6 +757,21 @@ description: 'Git URL to use on this Jenkins Slave' - parameter: + name: zte-virtual6-defaults + parameters: + - node: + name: SLAVE_NAME + description: 'Slave name on Jenkins' + allowed-slaves: + - zte-virtual6 + default-slaves: + - zte-virtual6 + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + +- parameter: name: 'juniper-pod1-defaults' parameters: - node: diff --git a/jjb/opnfvdocs/docs-rtd.yaml b/jjb/opnfvdocs/docs-rtd.yaml index e15b09812..28f9354fa 100644 --- a/jjb/opnfvdocs/docs-rtd.yaml +++ b/jjb/opnfvdocs/docs-rtd.yaml @@ -38,6 +38,7 @@ files: 'docs/**/*.*' builders: + - 'remove-old-docs-from-opnfv-artifacts' - shell: | if [ $GERRIT_BRANCH == "master" ]; then RTD_BUILD_VERSION=latest @@ -91,4 +92,6 @@ pip install --upgrade pip pip freeze pip install tox + sed -i s,\-b\ html,\-b\ singlehtml,g tox.ini tox -edocs + - 'upload-review-docs' diff --git a/jjb/opnfvdocs/opnfvdocs.yml b/jjb/opnfvdocs/opnfvdocs.yml index 95bc8a9dd..3dfb9d155 100644 --- a/jjb/opnfvdocs/opnfvdocs.yml +++ b/jjb/opnfvdocs/opnfvdocs.yml @@ -11,7 +11,6 @@ jobs: - 'opnfvdocs-verify-shellcheck-{stream}' - 'opnfvdocs-merge-shellcheck-{stream}' - - 'opnfvdocs-daily-{stream}' stream: - master: @@ -109,31 +108,3 @@ builders: - check-bash-syntax - -- job-template: - name: 'opnfvdocs-daily-{stream}' - - disabled: true - - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - string: - name: GS_URL - default: '$GS_BASE{gs-pathname}' - description: "Directory where the build artifact will be located upon the completion of the build." - - string: - name: GIT_CLONE_BASE - default: ssh://gerrit.opnfv.org:29418 - description: "Used for overriding the GIT URL coming from parameters macro." - - scm: - - git-scm - - triggers: - - timed: '0 H/6 * * *' - - builders: - - build-html-and-pdf-docs-output -# - upload-generated-docs-to-opnfv-artifacts diff --git a/jjb/qtip/qtip-validate-jobs.yml b/jjb/qtip/qtip-validate-jobs.yml index febe28619..07f2431bc 100644 --- a/jjb/qtip/qtip-validate-jobs.yml +++ b/jjb/qtip/qtip-validate-jobs.yml @@ -40,6 +40,10 @@ installer: apex pod: zte-virtual5 <<: *euphrates + - compute: + installer: fuel + pod: zte-virtual6 + <<: *master # ------------------------------- # JOB LIST diff --git a/jjb/releng/functest-docker.yml b/jjb/releng/functest-docker.yml new file mode 100644 index 000000000..6c131604b --- /dev/null +++ b/jjb/releng/functest-docker.yml @@ -0,0 +1,268 @@ +--- +############################################## +# job configuration for docker build and push +############################################## +- project: + + name: functest-docker + + project: functest + + stream: + - master: + branch: '{stream}' + disabled: false + - euphrates: + branch: 'stable/{stream}' + disabled: false + + arch_tag: + - 'amd64': + slave_label: 'opnfv-build-ubuntu' + - 'arm64': + slave_label: 'opnfv-build-ubuntu-arm' + + # yamllint disable rule:key-duplicates + image: + - 'core' + - 'healthcheck' + - 'features' + - 'components' + - 'parser' + - 'smoke' + - 'vnf' + - 'restapi' + + # settings for jobs run in multijob phases + build-job-settings: &build-job-settings + current-parameters: false + git-revision: true + node-parameters: true + predefined-parameters: | + PUSH_IMAGE=$PUSH_IMAGE + COMMIT_ID=$COMMIT_ID + RELEASE_VERSION=$RELEASE_VERSION + DOCKERFILE=$DOCKERFILE + ARCH_TAG=$ARCH_TAG + kill-phase-on: FAILURE + abort-all-jobs: false + + manifest-job-settings: &manifest-job-settings + current-parameters: false + git-revision: true + node-parameters: true + predefined-parameters: | + RELEASE_VERSION=$RELEASE_VERSION + ARCH_TAG=$ARCH_TAG + kill-phase-on: FAILURE + abort-all-jobs: false + + # yamllint enable rule:key-duplicates + jobs: + - "functest-docker-build-push-{arch_tag}-{stream}" + - "functest-{image}-build-push-{arch_tag}-{stream}" + - "functest-{image}-create-manifest-{arch_tag}-{stream}" +######################## +# job templates +######################## +- job-template: + name: 'functest-docker-build-push-{arch_tag}-{stream}' + + project-type: multijob + + disabled: '{obj:disabled}' + + parameters: + - job-parameters: + project: '{project}' + branch: '{branch}' + slave_label: '{slave_label}' + arch_tag: '{arch_tag}' + - string: + name: ARCH_TAG + default: "{arch_tag}" + description: "If set, this value will be added to the docker image tag as a prefix" + + properties: + - throttle: + max-per-node: 1 + option: 'project' + + scm: + - git-scm + + triggers: + - pollscm: + cron: "*/30 * * * *" + + builders: + - multijob: + name: 'build-base-img-create-manifest' + execution-type: SEQUENTIAL + projects: + - name: 'functest-core-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-core-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - multijob: + name: 'build-child-img' + condition: SUCCESSFUL + execution-type: PARALLEL + projects: + - name: 'functest-healthcheck-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-features-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-components-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-parser-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-smoke-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-vnf-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - name: 'functest-restapi-build-push-{arch_tag}-{stream}' + <<: *build-job-settings + - multijob: + name: 'create-img-manifest' + condition: SUCCESSFUL + execution-type: PARALLEL + projects: + - name: 'functest-healthcheck-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - name: 'functest-features-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - name: 'functest-components-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - name: 'functest-parser-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - name: 'functest-smoke-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - name: 'functest-vnf-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + - name: 'functest-restapi-create-manifest-{arch_tag}-{stream}' + <<: *manifest-job-settings + + publishers: + - 'functest-{arch_tag}-recipients' + +- job-template: + + name: 'functest-{image}-build-push-{arch_tag}-{stream}' + + disabled: '{obj:disabled}' + + parameters: + - job-parameters: + project: '{project}' + branch: '{branch}' + slave_label: '{slave_label}' + arch_tag: '{arch_tag}' + - string: + name: DOCKER_REPO_NAME + default: "opnfv/functest-{image}" + description: "Dockerhub repo to be pushed to." + - string: + name: DOCKER_DIR + default: "docker/{image}" + description: "Directory containing files needed by the Dockerfile" + + scm: + - git-scm + + publishers: + - 'functest-{arch_tag}-recipients' + + builders: + - shell: + !include-raw-escape: ./opnfv-docker.sh + +- job-template: + + name: 'functest-{image}-create-manifest-{arch_tag}-{stream}' + + disabled: '{obj:disabled}' + + parameters: + - job-parameters: + project: '{project}' + branch: '{branch}' + slave_label: '{slave_label}' + arch_tag: '{arch_tag}' + - string: + name: DOCKER_REPO_NAME + default: "opnfv/functest-{image}" + description: "Dockerhub repo to be pushed to." + - string: + name: DOCKER_DIR + default: "docker/{image}" + description: "Directory containing files needed by the Dockerfile" + + builders: + - shell: + !include-raw-escape: ./opnfv-manifest.sh + + scm: + - git-scm + + publishers: + - 'functest-{arch_tag}-recipients' + +# parameter macro +- parameter: + name: job-parameters + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - label: + name: SLAVE_LABEL + default: '{slave_label}' + 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: PUSH_IMAGE + default: "true" + description: "To enable/disable pushing the image to Dockerhub." + - string: + name: COMMIT_ID + default: "" + description: "commit id to make a snapshot docker image" + - string: + name: RELEASE_VERSION + default: "" + description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1" + - string: + name: DOCKERFILE + default: "Dockerfile" + description: "Dockerfile to use for creating the image." + - string: + name: ARCH_TAG + default: "{arch_tag}" + description: "If set, this value will be added to the docker image tag as a prefix" + - string: + name: PROJECT + default: "{project}" + description: "Project name used to enable job conditions" + +# publisher macros +- publisher: + name: 'functest-arm64-recipients' + publishers: + - email: + recipients: > + cristina.pauna@enea.com + alexandru.avadanii@enea.com + delia.popescu@enea.com + +- publisher: + name: 'functest-amd64-recipients' + publishers: + - email: + recipients: > + jalausuch@suse.com morgan.richomme@orange.com + cedric.ollivier@orange.com feng.xiaowei@zte.com.cn + juha.kosonen@nokia.com wangwulin@huawei.com diff --git a/jjb/releng/opnfv-docker-arm.yml b/jjb/releng/opnfv-docker-arm.yml index b488592db..3486a0775 100644 --- a/jjb/releng/opnfv-docker-arm.yml +++ b/jjb/releng/opnfv-docker-arm.yml @@ -40,7 +40,7 @@ other-receivers: &other-receivers receivers: '' - dockerfile: "Dockerfile.aarch64" + dockerfile: "Dockerfile" dockerdir: "docker" docker_repo_name: "opnfv/{project}_aarch64" arch_tag: "" @@ -59,7 +59,6 @@ - 'storperf-master': project: 'storperf' dockerdir: 'docker/storperf-master' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-master' arch_tag: 'aarch64' <<: *master @@ -67,7 +66,6 @@ - 'storperf-graphite': project: 'storperf' dockerdir: 'docker/storperf-graphite' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-graphite' arch_tag: 'aarch64' <<: *master @@ -75,7 +73,6 @@ - 'storperf-httpfrontend': project: 'storperf' dockerdir: 'docker/storperf-httpfrontend' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-httpfrontend' arch_tag: 'aarch64' <<: *master @@ -83,7 +80,6 @@ - 'storperf-reporting': project: 'storperf' dockerdir: 'docker/storperf-reporting' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-reporting' arch_tag: 'aarch64' <<: *master @@ -91,7 +87,6 @@ - 'storperf-swaggerui': project: 'storperf' dockerdir: 'docker/storperf-swaggerui' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-swaggerui' arch_tag: 'aarch64' <<: *master @@ -112,7 +107,6 @@ - 'storperf-master': project: 'storperf' dockerdir: 'docker/storperf-master' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-master' arch_tag: 'aarch64' <<: *euphrates @@ -120,7 +114,6 @@ - 'storperf-graphite': project: 'storperf' dockerdir: 'docker/storperf-graphite' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-graphite' arch_tag: 'aarch64' <<: *euphrates @@ -128,7 +121,6 @@ - 'storperf-httpfrontend': project: 'storperf' dockerdir: 'docker/storperf-httpfrontend' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-httpfrontend' arch_tag: 'aarch64' <<: *euphrates @@ -136,7 +128,6 @@ - 'storperf-reporting': project: 'storperf' dockerdir: 'docker/storperf-reporting' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-reporting' arch_tag: 'aarch64' <<: *euphrates @@ -144,7 +135,6 @@ - 'storperf-swaggerui': project: 'storperf' dockerdir: 'docker/storperf-swaggerui' - dockerfile: 'Dockerfile' docker_repo_name: 'opnfv/storperf-swaggerui' arch_tag: 'aarch64' <<: *euphrates diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index 402099a91..c179b1d8e 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -54,20 +54,13 @@ if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then done fi -cd $WORKSPACE/$DOCKER_DIR -HOST_ARCH=$(uname -m) -if [ ! -f "${DOCKERFILE}" ]; then - # If this is expected to be a Dockerfile for other arch than x86 - # and it does not exist, but there is a patch for the said arch, - # then apply the patch and create the Dockerfile.${HOST_ARCH} file - if [[ "${DOCKERFILE}" == *"${HOST_ARCH}" && \ - -f "Dockerfile.${HOST_ARCH}.patch" ]]; then - patch -o Dockerfile."${HOST_ARCH}" Dockerfile \ - Dockerfile."${HOST_ARCH}".patch - else - echo "ERROR: No Dockerfile or ${HOST_ARCH} patch found." - exit 1 - fi +cd "$WORKSPACE/$DOCKER_DIR" || exit 1 +HOST_ARCH="$(uname -m)" +#If there is a patch for other arch then x86, apply the patch and +#replace Dockerfile file +dockerfile_patch="Dockerfile.${HOST_ARCH}.patch" +if [[ -f "${dockerfile_patch}" ]]; then + patch -f Dockerfile -p1 < "${dockerfile_patch}" fi # Get tag version @@ -107,7 +100,6 @@ 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=$BUILD_BRANCH - $ARCH_BUILD_ARG -f $DOCKERFILE ." echo ${cmd} diff --git a/jjb/releng/opnfv-docker.yml b/jjb/releng/opnfv-docker.yml index 862e77ac8..8250bfea4 100644 --- a/jjb/releng/opnfv-docker.yml +++ b/jjb/releng/opnfv-docker.yml @@ -19,11 +19,6 @@ stream: euphrates branch: 'stable/{stream}' disabled: false - functest-receivers: &functest-receivers - receivers: > - jalausuch@suse.com morgan.richomme@orange.com - cedric.ollivier@orange.com feng.xiaowei@zte.com.cn - juha.kosonen@nokia.com wangwulin@huawei.com storperf-receivers: &storperf-receivers receivers: > mark.beierl@emc.com @@ -56,10 +51,6 @@ project: 'dovetail' <<: *master <<: *other-receivers - - 'functest': - project: 'functest' - <<: *master - <<: *functest-receivers - 'nfvbench': project: 'nfvbench' <<: *master @@ -116,10 +107,6 @@ project: 'bottlenecks' <<: *euphrates <<: *other-receivers - - 'functest': - project: 'functest' - <<: *euphrates - <<: *functest-receivers - 'storperf-master': project: 'storperf' dockerdir: 'docker/storperf-master' diff --git a/jjb/releng/opnfv-docs.yml b/jjb/releng/opnfv-docs.yml deleted file mode 100644 index 740274518..000000000 --- a/jjb/releng/opnfv-docs.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- -######################## -# Job configuration for opnfv-docs -######################## -- project: - - name: opnfv-docs - - project: opnfv-docs - - jobs: - - 'opnfv-docs-verify-{stream}' - - 'opnfv-docs-merge-{stream}' - - stream: - - master: - branch: '{stream}' - doc-version: '' - gs-pathname: '' - disabled: false - - euphrates: - branch: 'stable/{stream}' - doc-version: '5.0.0' - gs-pathname: '/{stream}/{doc-version}' - disabled: false - -######################## -# job templates -######################## - -- job-template: - name: 'opnfv-docs-verify-{stream}' - - disabled: '{obj:disabled}' - - parameters: - - project-parameter: - project: $GERRIT_PROJECT - branch: '{branch}' - - 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: '*' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: docs/** - - compare-type: ANT - pattern: yardstick/** - - builders: - - upload-review-docs - -- job-template: - name: 'opnfv-docs-merge-{stream}' - - disabled: '{obj:disabled}' - - parameters: - - project-parameter: - project: $GERRIT_PROJECT - branch: '{branch}' - - string: - name: GS_URL - default: '$GS_BASE{gs-pathname}' - description: "Directory where the build artifact will be located upon the completion of the build." - - string: - name: GERRIT_REFSPEC - default: 'refs/heads/{branch}' - description: "JJB configured GERRIT_REFSPEC parameter" - - scm: - - git-scm - - triggers: - - gerrit: - server-name: 'gerrit.opnfv.org' - trigger-on: - - change-merged-event - - comment-added-contains-event: - comment-contains-value: 'remerge' - - comment-added-contains-event: - comment-contains-value: 'rebuild docs' - projects: - - project-compare-type: 'ANT' - project-pattern: '*' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**/{branch}' - file-paths: - - compare-type: ANT - pattern: docs/** - - compare-type: ANT - pattern: yardstick/** - - builders: - - upload-merged-docs diff --git a/jjb/releng/opnfv-manifest.sh b/jjb/releng/opnfv-manifest.sh new file mode 100755 index 000000000..a740491c2 --- /dev/null +++ b/jjb/releng/opnfv-manifest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# 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 -o errexit +set -o nounset +set -o pipefail + +# Starting creating manifest image for $DOCKER_REPO_NAME + +ARCH=(amd64 arm64) +DOCKER_REPO_NAME=${DOCKER_REPO_NAME-} +RELEASE_VERSION=${RELEASE_VERSION-} +BRANCH=${BRANCH-} +ARCH_TAG=${ARCH_TAG-} + +# Before script install manifest-tool: +# cd .. && git clone https://github.com/estesp/manifest-tool +# cd ../manifest-tool && sudo -E make && sudo -E make install + +if [[ "$BRANCH" == "master" ]]; then + DOCKER_TAG="latest" +elif [[ "$BRANCH" == "euphrates" ]]; then + DOCKER_TAG="euphrates" +elif [[ -n "${RELEASE_VERSION}" ]]; then + DOCKER_TAG="${RELEASE_VERSION}" +else + DOCKER_TAG="stable" +fi +if [[ "${ARCH_TAG}" =~ "arm64" || "${ARCH_TAG}" =~ "amd64" ]]; then + sudo manifest-tool push from-args --platforms linux/amd64,linux/arm64 \ + --template "${DOCKER_REPO_NAME}":"${ARCH[0]}"-"${DOCKER_TAG}" \ + --template "${DOCKER_REPO_NAME}":"${ARCH[1]}"-"${DOCKER_TAG}" \ + --target "${DOCKER_REPO_NAME}":"${DOCKER_TAG}" +fi + diff --git a/jjb/releng/opnfv-repo-archiver.sh b/jjb/releng/opnfv-repo-archiver.sh index c9fdba379..2408c2a83 100644 --- a/jjb/releng/opnfv-repo-archiver.sh +++ b/jjb/releng/opnfv-repo-archiver.sh @@ -35,7 +35,7 @@ for PROJECT in "${PROJECT_LIST[@]}"; do # Don't license scan kernel or qemu in kvmfornfv if [ "$PROJECT" == "kvmfornfv" ]; then - rm -rf "$CLONE_PATH/$PROJECT/{kernel,qemu}" + rm -rf "$CLONE_PATH/$PROJECT/"{kernel,qemu} fi done |