From 85c921743f2bba47655f18f08cb2b55009013f2f Mon Sep 17 00:00:00 2001 From: Cristina Pauna Date: Mon, 18 Nov 2019 15:23:17 +0200 Subject: [PATCH] [validation] Build release images The tag for the release has been made for the validation project at [1] Added the jobs that will build the container images from this tag Also moved the project templates in the akraino-templates folder [1] https://gerrit.akraino.org/r/admin/repos/validation,tags Signed-off-by: Cristina Pauna Change-Id: Ia6a1750a37ff8deabfe87667a0d8d91efe4ca8ce --- .../akraino-validation-macros.yaml | 45 ++++++ .../akraino-validation-templates.yaml | 157 ++++++++++++++++++++ jjb/validation/validation-docker.yaml | 164 +-------------------- 3 files changed, 210 insertions(+), 156 deletions(-) create mode 100644 jjb/akraino-templates/akraino-validation-macros.yaml create mode 100644 jjb/akraino-templates/akraino-validation-templates.yaml diff --git a/jjb/akraino-templates/akraino-validation-macros.yaml b/jjb/akraino-templates/akraino-validation-macros.yaml new file mode 100644 index 0000000..844cfbe --- /dev/null +++ b/jjb/akraino-templates/akraino-validation-macros.yaml @@ -0,0 +1,45 @@ +--- +####### +# SCM # +####### +- scm: + # Enhanced version of the global-jjb + name: validation-infra-gerrit-scm + scm: + - git: + credentials-id: '{jenkins-ssh-credential}' + url: '{git-url}' + refspec: '{refspec}' + branches: + - 'refs/{refs_tag}/{stream}' + skip-tag: false + wipe-workspace: true + submodule: + recursive: '{submodule-recursive}' + timeout: '{submodule-timeout}' + choosing-strategy: '{choosing-strategy}' + +############## +# PARAMETERS # +############## +- parameter: + name: validation-job-parameters + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + +############ +# SETTINGS # +############ +# settings for jobs run in multijob phases +- docker-build-job-settings: &docker-build-job-settings + name: docker_build_job_settings + current-parameters: false + git-revision: true + node-parameters: false + predefined-parameters: | + GERRIT_REFNAME=$GERRIT_REFNAME + kill-phase-on: FAILURE + abort-all-jobs: false diff --git a/jjb/akraino-templates/akraino-validation-templates.yaml b/jjb/akraino-templates/akraino-validation-templates.yaml new file mode 100644 index 0000000..e8c96b4 --- /dev/null +++ b/jjb/akraino-templates/akraino-validation-templates.yaml @@ -0,0 +1,157 @@ +--- +- job-template: + id: akraino-validation-docker-multiarch + name: 'validation-{stream}-docker' + project-type: multijob + disabled: '{obj:disabled}' + node: 'centos7-builder-2c-1g' + build-timeout: 90 + + parameters: + - validation-job-parameters: + project: '{project}' + branch: '{branch}' + stream: '{stream}' + + properties: + - throttle: + max-per-node: 1 + option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'validation-docker-.*' + blocking-level: 'NODE' + scm: + - validation-infra-gerrit-scm: + jenkins-ssh-credential: '{jenkins-ssh-credential}' + git-url: '{git-url}/{project}.git' + refspec: '' + refs_tag: '{refs_tag}' + stream: '{stream}' + submodule-recursive: false + submodule-timeout: '{submodule-timeout}' + submodule-disable: false + choosing-strategy: default + + triggers: + # Build nigtly at 12:10 AM + - timed: '10 0 * * *' + + builders: + - multijob: + name: 'build validation images' + execution-type: PARALLEL + projects: + - name: 'validation-docker-build-amd64-{stream}' + <<: *docker-build-job-settings + - name: 'validation-docker-build-arm64-{stream}' + <<: *docker-build-job-settings + - multijob: + name: 'publish validation manifests' + condition: SUCCESSFUL + execution-type: PARALLEL + projects: + - name: 'validation-docker-manifest-{stream}' + <<: *docker-build-job-settings + + publishers: + - email: + recipients: 'cristina.pauna@enea.com' + +- job-template: + id: akraino-validation-docker-specific-arch + name: 'validation-docker-build-{arch_tag}-{stream}' + disabled: '{obj:disabled}' + node: '{slave_label}' + build-timeout: 75 + + parameters: + - validation-job-parameters: + project: '{project}' + branch: '{branch}' + stream: '{stream}' + arch_tag: '{arch_tag}' + + properties: + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'validation-docker-build-.*' + blocking-level: 'NODE' + scm: + - validation-infra-gerrit-scm: + jenkins-ssh-credential: '{jenkins-ssh-credential}' + git-url: '{git-url}/{project}.git' + refspec: '' + refs_tag: '{refs_tag}' + stream: '{stream}' + submodule-recursive: false + submodule-timeout: '{submodule-timeout}' + submodule-disable: false + choosing-strategy: default + + builders: + - lf-infra-docker-login: + global-settings-file: global-settings + settings-file: '{mvn-settings}' + - conditional-step: + condition-kind: regex-match + regex: '^tags$' + label: '{refs_tag}' + steps: + - shell: | + #!/bin/bash -ex + echo "export TAG_VER=$STREAM" >> tag_version.sh + - shell: | + #!/bin/bash -ex + if [ -f tag_version.sh ]; then source tag_version.sh; fi + make -k -C docker push-all + rm -f tag_version.sh + - shell: | + #!/bin/bash -ex + docker system prune -af + +- job-template: + id: akraino-validation-docker-manifest + name: 'validation-docker-manifest-{stream}' + node: 'ubuntu1604-docker-8c-8g' + build-timeout: 15 + + parameters: + - validation-job-parameters: + project: '{project}' + branch: '{branch}' + stream: '{stream}' + + disabled: '{obj:disabled}' + + scm: + - validation-infra-gerrit-scm: + jenkins-ssh-credential: '{jenkins-ssh-credential}' + git-url: '{git-url}/{project}.git' + refspec: '' + refs_tag: '{refs_tag}' + stream: '{stream}' + submodule-recursive: false + submodule-timeout: '{submodule-timeout}' + submodule-disable: false + choosing-strategy: default + + builders: + - lf-infra-docker-login: + global-settings-file: global-settings + settings-file: '{mvn-settings}' + - conditional-step: + condition-kind: regex-match + regex: '^tags$' + label: '{refs_tag}' + steps: + - shell: | + #!/bin/bash -ex + echo "export TAG_VER=$STREAM" >> tag_version.sh + - shell: | + #!/bin/bash -ex + if [ -f tag_version.sh ]; then source tag_version.sh; fi + for sd in docker/*/.; do make -k -C $sd .push_manifest; done + rm -f tag_version.sh diff --git a/jjb/validation/validation-docker.yaml b/jjb/validation/validation-docker.yaml index 481aa59..14aac1c 100644 --- a/jjb/validation/validation-docker.yaml +++ b/jjb/validation/validation-docker.yaml @@ -6,6 +6,11 @@ stream: - master: branch: '{stream}' + refs_tag: 'heads' + disabled: false + - 2.0.0: + branch: 'master' + refs_tag: 'tags' disabled: false arch_tag: @@ -14,160 +19,7 @@ - 'arm64': slave_label: 'aarch64_dev' - # settings for jobs run in multijob phases - docker-build-job-settings: &docker-build-job-settings - current-parameters: false - git-revision: true - node-parameters: false - predefined-parameters: | - GERRIT_REFNAME=$GERRIT_REFNAME - kill-phase-on: FAILURE - abort-all-jobs: false - jobs: - - "validation-{stream}-docker" - - "validation-docker-build-{arch_tag}-{stream}" - - "validation-docker-manifest-{stream}" - -######################## -# job templates -######################## -- job-template: - name: 'validation-{stream}-docker' - project-type: multijob - disabled: '{obj:disabled}' - node: 'centos7-builder-2c-1g' - build-timeout: 90 - - parameters: - - validation-job-parameters: - project: '{project}' - branch: '{branch}' - stream: '{stream}' - - properties: - - throttle: - max-per-node: 1 - option: 'project' - - build-blocker: - use-build-blocker: true - blocking-jobs: - - 'validation-docker-.*' - blocking-level: 'NODE' - scm: - - lf-infra-gerrit-scm: - jenkins-ssh-credential: '{jenkins-ssh-credential}' - git-url: '{git-url}/{project}.git' - refspec: '' - branch: '{branch}' - submodule-recursive: false - submodule-timeout: '{submodule-timeout}' - submodule-disable: false - choosing-strategy: default - - triggers: - # Build nigtly at 12:10 AM - - timed: '10 0 * * *' - - builders: - - multijob: - name: 'build validation images' - execution-type: PARALLEL - projects: - - name: 'validation-docker-build-amd64-{stream}' - <<: *docker-build-job-settings - - name: 'validation-docker-build-arm64-{stream}' - <<: *docker-build-job-settings - - multijob: - name: 'publish validation manifests' - condition: SUCCESSFUL - execution-type: PARALLEL - projects: - - name: 'validation-docker-manifest-{stream}' - <<: *docker-build-job-settings - - publishers: - - email: - recipients: 'cristina.pauna@enea.com' - -- job-template: - name: 'validation-docker-build-{arch_tag}-{stream}' - disabled: '{obj:disabled}' - node: '{slave_label}' - build-timeout: 75 - - parameters: - - validation-job-parameters: - project: '{project}' - branch: '{branch}' - stream: '{stream}' - arch_tag: '{arch_tag}' - - properties: - - build-blocker: - use-build-blocker: true - blocking-jobs: - - 'validation-docker-build-.*' - blocking-level: 'NODE' - scm: - - lf-infra-gerrit-scm: - jenkins-ssh-credential: '{jenkins-ssh-credential}' - git-url: '{git-url}/{project}.git' - refspec: '' - branch: '{branch}' - submodule-recursive: false - submodule-timeout: '{submodule-timeout}' - submodule-disable: false - choosing-strategy: default - - builders: - - lf-infra-docker-login: - global-settings-file: global-settings - settings-file: '{mvn-settings}' - - shell: | - #!/bin/bash -ex - make -k -C docker push-all - - shell: | - #!/bin/bash -ex - docker system prune -af - -- job-template: - name: 'validation-docker-manifest-{stream}' - node: 'ubuntu1604-docker-8c-8g' - build-timeout: 15 - - parameters: - - validation-job-parameters: - project: '{project}' - branch: '{branch}' - stream: '{stream}' - - disabled: '{obj:disabled}' - - scm: - - lf-infra-gerrit-scm: - jenkins-ssh-credential: '{jenkins-ssh-credential}' - git-url: '{git-url}/{project}.git' - refspec: '' - branch: '{branch}' - submodule-recursive: false - submodule-timeout: '{submodule-timeout}' - submodule-disable: false - choosing-strategy: default - - builders: - - lf-infra-docker-login: - global-settings-file: global-settings - settings-file: '{mvn-settings}' - - shell: | - #!/bin/bash -ex - for sd in docker/*/.; do make -k -C $sd .push_manifest; done - -# parameter macro -- parameter: - name: validation-job-parameters - parameters: - - lf-infra-parameters: - project: '{project}' - stream: '{stream}' - branch: '{branch}' + - akraino-validation-docker-multiarch + - akraino-validation-docker-specific-arch + - akraino-validation-docker-manifest -- 2.16.6