From 885a782ac9fcfd913bcbdbad43aec67493518107 Mon Sep 17 00:00:00 2001 From: Daniel Stoica Date: Mon, 24 Feb 2020 14:49:09 +0200 Subject: [PATCH] Move iec jenkins job in jjb/akraino-templates Signed-off-by: Daniel Stoica Change-Id: I86539d875ccb91536f79894438bc45dca474b32b --- jjb/akraino-templates/akraino-iec-macros.yaml | 119 ++++++++ jjb/akraino-templates/akraino-iec-templates.yaml | 226 +++++++++++++++ jjb/iec/iec.yaml | 350 +---------------------- 3 files changed, 349 insertions(+), 346 deletions(-) create mode 100644 jjb/akraino-templates/akraino-iec-macros.yaml create mode 100644 jjb/akraino-templates/akraino-iec-templates.yaml diff --git a/jjb/akraino-templates/akraino-iec-macros.yaml b/jjb/akraino-templates/akraino-iec-macros.yaml new file mode 100644 index 0000000..58bbbc4 --- /dev/null +++ b/jjb/akraino-templates/akraino-iec-macros.yaml @@ -0,0 +1,119 @@ +--- +############## +# PARAMETERS # +############## +- parameter: + name: 'iec-defaults' + parameters: + - string: + name: INSTALLER_IP + default: '10.20.0.2' + description: 'IP of the installer' + - string: + name: SSH_KEY + default: '/var/lib/opnfv/mcp.rsa' + description: 'Path to private SSH key to access environment nodes' + - string: + name: EXTERNAL_NETWORK + default: 'floating_net' + description: 'external network for test' + - string: + name: CI_DEBUG + default: 'false' + description: 'Show debug output information' + - string: + name: ARCHIVE_ARTIFACTS + default: '**/*.log' + description: Artifacts to archive to the logs server. + +# Usecase params are both installer and OS specific +- parameter: &k8s_fuel_ubuntu1604_parameter + name: 'fuel-ubuntu1604-defaults' + parameters: + - string: &k8s_master_ip + name: K8S_MASTER_IP + default: '172.16.10.36' + description: 'IP address to connect to the K8s master' + - string: &k8s_ssh_user + name: K8S_SSH_USER + default: 'ubuntu' + description: 'SSH username to connect to the K8s master ' + - string: &k8s_ssh_password + name: K8S_SSH_PASSWORD + default: '' + description: 'SSH password to connect to the K8s master' + - string: &k8s_ssh_key + name: K8S_SSH_KEY + default: '/var/lib/opnfv/mcp.rsa' + description: 'SSH key to connect to the K8s master' + +- parameter: + <<: *k8s_fuel_ubuntu1604_parameter + name: 'fuel-ubuntu1804-defaults' +- parameter: + name: 'fuel-centos7-defaults' + parameters: + - string: + <<: *k8s_master_ip + - string: + <<: *k8s_ssh_user + default: 'centos' + - string: + <<: *k8s_ssh_password + - string: + <<: *k8s_ssh_key + +- parameter: + name: 'compass-ubuntu1604-defaults' + parameters: + - string: + <<: *k8s_master_ip + default: '10.1.0.50' + - string: + <<: *k8s_ssh_user + default: 'root' + - string: + <<: *k8s_ssh_password + default: 'root' + - string: + <<: *k8s_ssh_key + +######################## +# trigger macros +######################## +# CI PODs +# ---------------------------------------------------------------- +# Akraino IEC CI Baremetal Triggers running against master branch +# ---------------------------------------------------------------- +- trigger: + name: 'iec-type2-fuel-virtual-ubuntu1604-daily-master-trigger' + triggers: + - timed: '0 1 * * 1,3,5' +- trigger: + name: 'iec-type2-fuel-baremetal-ubuntu1604-daily-master-trigger' + triggers: + - timed: '' +- trigger: + name: 'iec-type2-compass-virtual-ubuntu1604-daily-master-trigger' + triggers: + - timed: '0 13 * * *' +- trigger: + name: 'iec-type2-fuel-virtual-ubuntu1804-daily-master-trigger' + triggers: + - timed: '0 1 * * 2,6' +- trigger: + name: 'iec-type2-fuel-baremetal-ubuntu1804-daily-master-trigger' + triggers: + - timed: '' +- trigger: + name: 'iec-type2-fuel-virtual-centos7-daily-master-trigger' + triggers: + - timed: '0 1 * * 4,7' +- trigger: + name: 'iec-type2-fuel-baremetal-centos7-daily-master-trigger' + triggers: + - timed: '' +- trigger: + name: 'iec-type1-compass-virtual-ubuntu1604-daily-master-trigger' + triggers: + - timed: '0 19 * * *' diff --git a/jjb/akraino-templates/akraino-iec-templates.yaml b/jjb/akraino-templates/akraino-iec-templates.yaml new file mode 100644 index 0000000..0f62307 --- /dev/null +++ b/jjb/akraino-templates/akraino-iec-templates.yaml @@ -0,0 +1,226 @@ +--- +- job-template: + id: akraino-iec-install + name: 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}' + disabled: '{obj:disabled}' + concurrent: false + node: '{slave-label}' + properties: + - throttle: + enabled: true + max-total: 4 + max-per-node: 1 + option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - '.*-fuel-{deploy_type}-.*' + - '.*-compass-{deploy_type}-.*' + block-level: 'NODE' + + wrappers: + - build-name: + name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE' + + triggers: + - 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}-trigger' + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + - '{project}-defaults' + - '{installer}-{os}-defaults' + - string: + name: DEPLOY_SCENARIO + default: '{scenario}' + - string: + name: IEC_TYPE + default: '{iecType}' + + builders: + - trigger-builds: + - project: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}' + current-parameters: true + predefined-parameters: + DEPLOY_SCENARIO={scenario} + same-node: true + block: true + - project: 'validation-enea-daily-{stream}' + same-node: true + current-parameters: true + predefined-parameters: | + CLUSTER_MASTER_IP=$K8S_MASTER_IP + CLUSTER_SSH_USER=$K8S_SSH_USER + CLUSTER_SSH_PASSWORD=$K8S_SSH_PASSWORD + CLUSTER_SSH_KEY=$K8S_SSH_KEY + BLUEPRINT={project-name} + LAYER=k8s + VERSION=master + OPTIONAL=false + block: true + - project: + !j2: | + {%- for uc in usecase -%} + iec-{{ iecType }}-install-{{ uc | first }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }} + {%- if not loop.last -%},{%- endif -%} + {%- endfor %} + current-parameters: true + same-node: true + block: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' + - project: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}' + current-parameters: false + predefined-parameters: | + DEPLOY_SCENARIO={scenario} + IEC_TYPE={iecType} + same-node: true + block: true + +- job-template: + id: akraino-iec-deploy + name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}' + concurrent: true + node: '{slave-label}' + properties: &properties + - throttle: + enabled: true + max-total: 4 + max-per-node: 1 + option: 'project' + - build-blocker: + use-build-blocker: true + blocking-jobs: + - '.*-{iecType}-deploy-{installer}-{deploy_type}-.*' + - '.*-{iecType}-destroy-{installer}-{deploy_type}-.*' + - '.*-{iecType}-install-.*-{installer}-{deploy_type}-.*' + block-level: 'NODE' + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + - '{project}-defaults' + - '{installer}-{os}-defaults' + - string: + name: DEPLOY_SCENARIO + default: '{scenario}' + - string: + name: IEC_TYPE + default: '{iecType}' + - string: + name: EXTRA_ARGS + default: '-o {os}' + + wrappers: &wrappers + - build-name: + name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE' + + scm: &scm + - git: + credentials-id: '{jenkins-ssh-credential}' + url: '{git-url}/{project}.git' + refspec: '' + branches: + - 'refs/heads/{branch}' + skip-tag: true + wipe-workspace: true + submodule: + disable: true + recursive: false + timeout: '{submodule-timeout}' + choosing-strategy: default + + builders: + - description-setter: + description: "POD: $NODE_NAME" + - conditional-step: + condition-kind: regex-match + regex: 'compass' + label: '{installer}' + steps: + - shell: + !include-raw-escape: ../iec/iec-compass-build.sh + - shell: + !include-raw-escape: ../iec/iec-compass-deploy.sh + - shell: + !include-raw-escape: ../iec/iec-fdn-install.sh + - conditional-step: + condition-kind: regex-match + regex: 'fuel' + label: '{installer}' + steps: + - shell: + !include-raw-escape: ../iec/iec-fuel-deploy.sh + + publishers: &publishers + - email: + recipients: armband@enea.com + - lf-infra-publish + +- job-template: + id: akraino-iec-destroy + name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}' + concurrent: true + node: '{slave-label}' + properties: *properties + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + - '{project}-defaults' + - '{installer}-{os}-defaults' + - string: + name: DEPLOY_SCENARIO + default: '{scenario}' + - string: + name: IEC_TYPE + default: '{iecType}' + - string: + name: EXTRA_ARGS + default: '-EEE -o {os}' + + wrappers: *wrappers + scm: *scm + + builders: + - description-setter: + description: "POD: $NODE_NAME" + - shell: + !include-raw-escape: ../iec/iec-{installer}-destroy.sh + + publishers: *publishers + +- job-template: + id: akraino-iec-install-usecase + name: 'iec-{iecType}-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}' + concurrent: true + node: '{slave-label}' + properties: *properties + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + - '{project}-defaults' + - '{installer}-{os}-defaults' + + wrappers: + - build-name: + name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}' + + scm: *scm + + builders: + - shell: + !include-raw-escape: ../iec/iec-{usecase}.sh + + publishers: *publishers + diff --git a/jjb/iec/iec.yaml b/jjb/iec/iec.yaml index 573faf1..625017d 100644 --- a/jjb/iec/iec.yaml +++ b/jjb/iec/iec.yaml @@ -69,10 +69,10 @@ scenario: 'k8-calico-iec-noha' jobs: - - 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}' - - 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}' - - 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}' - - 'iec-{iecType}-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}' + - akraino-iec-install + - akraino-iec-deploy + - akraino-iec-destroy + - akraino-iec-install-usecase - gerrit-sonar: sonar-project-file: "" build-node: centos7-builder-2c-1g @@ -99,345 +99,3 @@ sonar.tests=. sonar.test.inclusions=**/*_test.go sonar.test.exclusions=**/vendor/** - - -############## -# PARAMETERS # -############## -- parameter: - name: 'iec-defaults' - parameters: - - string: - name: INSTALLER_IP - default: '10.20.0.2' - description: 'IP of the installer' - - string: - name: SSH_KEY - default: '/var/lib/opnfv/mcp.rsa' - description: 'Path to private SSH key to access environment nodes' - - string: - name: EXTERNAL_NETWORK - default: 'floating_net' - description: 'external network for test' - - string: - name: CI_DEBUG - default: 'false' - description: 'Show debug output information' - - string: - name: ARCHIVE_ARTIFACTS - default: '**/*.log' - description: Artifacts to archive to the logs server. -# Usecase params are both installer and OS specific -- parameter: &k8s_fuel_ubuntu1604_parameter - name: 'fuel-ubuntu1604-defaults' - parameters: - - string: &k8s_master_ip - name: K8S_MASTER_IP - default: '172.16.10.36' - description: 'IP address to connect to the K8s master' - - string: &k8s_ssh_user - name: K8S_SSH_USER - default: 'ubuntu' - description: 'SSH username to connect to the K8s master ' - - string: &k8s_ssh_password - name: K8S_SSH_PASSWORD - default: '' - description: 'SSH password to connect to the K8s master' - - string: &k8s_ssh_key - name: K8S_SSH_KEY - default: '/var/lib/opnfv/mcp.rsa' - description: 'SSH key to connect to the K8s master' -- parameter: - <<: *k8s_fuel_ubuntu1604_parameter - name: 'fuel-ubuntu1804-defaults' -- parameter: - name: 'fuel-centos7-defaults' - parameters: - - string: - <<: *k8s_master_ip - - string: - <<: *k8s_ssh_user - default: 'centos' - - string: - <<: *k8s_ssh_password - - string: - <<: *k8s_ssh_key -- parameter: - name: 'compass-ubuntu1604-defaults' - parameters: - - string: - <<: *k8s_master_ip - default: '10.1.0.50' - - string: - <<: *k8s_ssh_user - default: 'root' - - string: - <<: *k8s_ssh_password - default: 'root' - - string: - <<: *k8s_ssh_key - -######################## -# job templates -######################## -- job-template: - name: 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}' - disabled: '{obj:disabled}' - concurrent: false - node: '{slave-label}' - properties: - - throttle: - enabled: true - max-total: 4 - max-per-node: 1 - option: 'project' - - build-blocker: - use-build-blocker: true - blocking-jobs: - - '.*-fuel-{deploy_type}-.*' - - '.*-compass-{deploy_type}-.*' - block-level: 'NODE' - - wrappers: - - build-name: - name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE' - - triggers: - - 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}-trigger' - - parameters: - - lf-infra-parameters: - project: '{project}' - stream: '{stream}' - branch: '{branch}' - - '{project}-defaults' - - '{installer}-{os}-defaults' - - string: - name: DEPLOY_SCENARIO - default: '{scenario}' - - string: - name: IEC_TYPE - default: '{iecType}' - - builders: - - trigger-builds: - - project: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}' - current-parameters: true - predefined-parameters: - DEPLOY_SCENARIO={scenario} - same-node: true - block: true - - project: 'validation-enea-daily-{stream}' - same-node: true - current-parameters: true - predefined-parameters: | - CLUSTER_MASTER_IP=$K8S_MASTER_IP - CLUSTER_SSH_USER=$K8S_SSH_USER - CLUSTER_SSH_PASSWORD=$K8S_SSH_PASSWORD - CLUSTER_SSH_KEY=$K8S_SSH_KEY - BLUEPRINT={project-name} - LAYER=k8s - VERSION=master - OPTIONAL=yes - block: true - - project: - !j2: | - {%- for uc in usecase -%} - iec-{{ iecType }}-install-{{ uc | first }}-{{ installer }}-{{ deploy_type }}-{{ os }}-daily-{{ stream }} - {%- if not loop.last -%},{%- endif -%} - {%- endfor %} - current-parameters: true - same-node: true - block: true - block-thresholds: - build-step-failure-threshold: 'never' - failure-threshold: 'never' - unstable-threshold: 'FAILURE' - - project: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}' - current-parameters: false - predefined-parameters: | - DEPLOY_SCENARIO={scenario} - IEC_TYPE={iecType} - same-node: true - block: true - -- job-template: - name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}' - concurrent: true - node: '{slave-label}' - properties: &properties - - throttle: - enabled: true - max-total: 4 - max-per-node: 1 - option: 'project' - - build-blocker: - use-build-blocker: true - blocking-jobs: - - '.*-{iecType}-deploy-{installer}-{deploy_type}-.*' - - '.*-{iecType}-destroy-{installer}-{deploy_type}-.*' - - '.*-{iecType}-install-.*-{installer}-{deploy_type}-.*' - block-level: 'NODE' - - parameters: - - lf-infra-parameters: - project: '{project}' - stream: '{stream}' - branch: '{branch}' - - '{project}-defaults' - - '{installer}-{os}-defaults' - - string: - name: DEPLOY_SCENARIO - default: '{scenario}' - - string: - name: IEC_TYPE - default: '{iecType}' - - string: - name: EXTRA_ARGS - default: '-o {os}' - - wrappers: &wrappers - - build-name: - name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO $IEC_TYPE' - - scm: &scm - - git: - credentials-id: '{jenkins-ssh-credential}' - url: '{git-url}/{project}.git' - refspec: '' - branches: - - 'refs/heads/{branch}' - skip-tag: true - wipe-workspace: true - submodule: - disable: true - recursive: false - timeout: '{submodule-timeout}' - choosing-strategy: default - - builders: - - description-setter: - description: "POD: $NODE_NAME" - - conditional-step: - condition-kind: regex-match - regex: 'compass' - label: '{installer}' - steps: - - shell: - !include-raw-escape: ./iec-compass-build.sh - - shell: - !include-raw-escape: ./iec-compass-deploy.sh - - shell: - !include-raw-escape: ./iec-fdn-install.sh - - conditional-step: - condition-kind: regex-match - regex: 'fuel' - label: '{installer}' - steps: - - shell: - !include-raw-escape: ./iec-fuel-deploy.sh - - publishers: &publishers - - email: - recipients: armband@enea.com - - lf-infra-publish - -- job-template: - name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}' - concurrent: true - node: '{slave-label}' - properties: *properties - parameters: - - lf-infra-parameters: - project: '{project}' - stream: '{stream}' - branch: '{branch}' - - '{project}-defaults' - - '{installer}-{os}-defaults' - - string: - name: DEPLOY_SCENARIO - default: '{scenario}' - - string: - name: IEC_TYPE - default: '{iecType}' - - string: - name: EXTRA_ARGS - default: '-EEE -o {os}' - - wrappers: *wrappers - scm: *scm - - builders: - - description-setter: - description: "POD: $NODE_NAME" - - shell: - !include-raw-escape: ./iec-{installer}-destroy.sh - - publishers: *publishers - -- job-template: - name: 'iec-{iecType}-install-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}' - concurrent: true - node: '{slave-label}' - properties: *properties - - parameters: - - lf-infra-parameters: - project: '{project}' - stream: '{stream}' - branch: '{branch}' - - '{project}-defaults' - - '{installer}-{os}-defaults' - - wrappers: - - build-name: - name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}' - - scm: *scm - - builders: - - shell: - !include-raw-escape: ./iec-{usecase}.sh - - publishers: *publishers - - -######################## -# trigger macros -######################## -# CI PODs -# ---------------------------------------------------------------- -# Akraino IEC CI Baremetal Triggers running against master branch -# ---------------------------------------------------------------- -- trigger: - name: 'iec-type2-fuel-virtual-ubuntu1604-daily-master-trigger' - triggers: - - timed: '0 1 * * 1,3,5' -- trigger: - name: 'iec-type2-fuel-baremetal-ubuntu1604-daily-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'iec-type2-compass-virtual-ubuntu1604-daily-master-trigger' - triggers: - - timed: '0 13 * * *' -- trigger: - name: 'iec-type2-fuel-virtual-ubuntu1804-daily-master-trigger' - triggers: - - timed: '0 1 * * 2,6' -- trigger: - name: 'iec-type2-fuel-baremetal-ubuntu1804-daily-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'iec-type2-fuel-virtual-centos7-daily-master-trigger' - triggers: - - timed: '0 1 * * 4,7' -- trigger: - name: 'iec-type2-fuel-baremetal-centos7-daily-master-trigger' - triggers: - - timed: '' -- trigger: - name: 'iec-type1-compass-virtual-ubuntu1604-daily-master-trigger' - triggers: - - timed: '0 19 * * *' -- 2.16.6