engine: Create job skeleton for release jobs 91/4091/5
authorFatih Degirmenci <fdegir@gmail.com>
Thu, 19 Mar 2020 12:46:33 +0000 (12:46 +0000)
committerFatih Degirmenci <fdegir@gmail.com>
Thu, 19 Mar 2020 13:59:29 +0000 (13:59 +0000)
Change-Id: I282620c35b9a7d443190c7755aaaf59b06d88db2

13 files changed:
jjb/engine/engine-macros.yaml [moved from jjb/engine/engine-verify-jobs/engine-verify-macros.yaml with 92% similarity]
jjb/engine/engine-periodic-jobs/engine-periodic-offline-deploy-test.yaml [new file with mode: 0644]
jjb/engine/engine-periodic-jobs/engine-periodic-release-jobs.yaml [new file with mode: 0644]
jjb/engine/scripts/delete-heat-stack.sh [moved from jjb/engine/engine-verify-jobs/scripts/delete-heat-stack.sh with 100% similarity]
jjb/engine/scripts/deploy.sh [moved from jjb/engine/engine-verify-jobs/scripts/deploy.sh with 100% similarity]
jjb/engine/scripts/download-artifact.sh [moved from jjb/engine/engine-verify-jobs/scripts/download-artifact.sh with 100% similarity]
jjb/engine/scripts/generate-job-metadata.sh [new file with mode: 0755]
jjb/engine/scripts/generate-ssh-keypair.sh [moved from jjb/engine/engine-verify-jobs/scripts/generate-ssh-keypair.sh with 100% similarity]
jjb/engine/scripts/package.sh [moved from jjb/engine/engine-verify-jobs/scripts/package.sh with 100% similarity]
jjb/engine/scripts/test.sh [moved from jjb/engine/engine-verify-jobs/scripts/test.sh with 100% similarity]
jjb/engine/scripts/tox.sh [moved from jjb/engine/engine-verify-jobs/scripts/engine-verify-tox.sh with 100% similarity]
jjb/engine/scripts/upload-artifact.sh [moved from jjb/engine/engine-verify-jobs/scripts/upload-artifact.sh with 100% similarity]
jjb/engine/scripts/wait-for-pkg-manager.sh [moved from jjb/engine/engine-verify-jobs/scripts/wait-for-pkg-manager.sh with 100% similarity]

similarity index 92%
rename from jjb/engine/engine-verify-jobs/engine-verify-macros.yaml
rename to jjb/engine/engine-macros.yaml
index f7f443caf4cf8af1b5da650b18f740cc1d8364da..d9fd1714755ee466611ea9988b4dfc3e625b6a59 100644 (file)
@@ -25,7 +25,7 @@
     name: 'engine-verify-tox-macro'
     builders:
       - shell:
-          !include-raw: ./scripts/engine-verify-tox.sh
+          !include-raw: ./scripts/tox.sh
 
 
 - builder:
@@ -75,3 +75,9 @@
     builders:
       - shell:
           !include-raw: ./scripts/wait-for-pkg-manager.sh
+- builder:
+    name: 'engine-generate-job-metadata-macro'
+    builders:
+      - shell:
+          !include-raw: ./scripts/generate-job-metadata.sh
+
diff --git a/jjb/engine/engine-periodic-jobs/engine-periodic-offline-deploy-test.yaml b/jjb/engine/engine-periodic-jobs/engine-periodic-offline-deploy-test.yaml
new file mode 100644 (file)
index 0000000..43f6e65
--- /dev/null
@@ -0,0 +1,165 @@
+---
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+- project:
+    name: 'engine-periodic-offline-deploy-test'
+
+    project: 'engine-periodic-offline-deploy-test'
+
+    stream:
+      - 'master':
+          branch: '{stream}'
+
+    distro:
+      - ubuntu1804
+
+    deploy-scenario:
+      - k8-calico-nofeature
+      - k8-multus-nofeature
+
+    type:
+      - baremetal:
+          pod-name: est-baremetal
+          provisioner-type: bifrost
+          installer-type: kubespray
+          slave-label: baremetal-deploy
+          yardstick-dispatcher: 'influxdb'
+
+    phase:
+      - deploy:
+          build-timeout: 90
+      - functest:
+          build-timeout: 240
+      - yardstick:
+          build-timeout: 120
+
+    jobs:
+      - '{deploy-scenario}-offline-{distro}-{type}-periodic'
+      - 'kubernetes-offline-{phase}-{distro}-{type}-periodic'
+
+- job-template:
+    name: '{deploy-scenario}-offline-{distro}-{type}-periodic'
+
+    project-type: multijob
+
+    disabled: '{obj:disabled}'
+
+    concurrent: true
+
+    parameters:
+      - label:
+          name: SLAVE_LABEL
+          default: '{slave-label}'
+          description: 'Slave label to schedule this job on.'
+      - string:
+          name: PROVISIONER_TYPE
+          default: '{provisioner-type}'
+          description: 'Provisioner type to use'
+      - string:
+          name: INSTALLER_TYPE
+          default: '{installer-type}'
+          description: 'Installer type to use'
+      - string:
+          name: DEPLOY_SCENARIO
+          default: '{deploy-scenario}'
+          description: 'Scenario to deploy and test'
+      - string:
+          name: TEST_REPO_URL
+          default: 'https://gerrit.nordix.org/infra/test.git'
+          description: 'URL to clone the test repo from'
+      - string:
+          name: TEST_FW
+          default: 'functest'
+          description: 'Test framework to use'
+      - string:
+          name: TEST_SUITE
+          default: 'smoke'
+          description: 'Test suite to run'
+      - string:
+          name: YARDSTICK_DISPATCHER
+          default: '{yardstick-dispatcher}'
+          description: 'Dispatcher to use for Yardstick reporting'
+
+    properties:
+      - logrotate
+      - throttle:
+          max-per-node: 1
+          max-total: 3
+          option: project
+
+    wrappers:
+      - build-timeout:
+          timeout: 550
+      - mask-passwords
+      - fix-workspace-permissions
+
+    builders:
+      - description-setter:
+          description: $PROVISIONER_TYPE | $INSTALLER_TYPE | $DEPLOY_SCENARIO
+      - multijob:
+          name: "Offline Deployment on {type}"
+          condition: SUCCESSFUL
+          execution-type: PARALLEL
+          projects:
+            - name: 'kubernetes-offline-deploy-{distro}-{type}-periodic'
+              current-parameters: true
+              node-parameters: true
+              kill-phase-on: FAILURE
+              abort-all-job: true
+      - multijob:
+          name: functest
+          condition: ALWAYS
+          projects:
+            - name: 'kubernetes-offline-functest-{distro}-{type}-periodic'
+              current-parameters: true
+              node-parameters: true
+              kill-phase-on: FAILURE
+              abort-all-job: true
+      - multijob:
+          name: yardstick
+          condition: ALWAYS
+          projects:
+            - name: 'kubernetes-offline-yardstick-{distro}-{type}-periodic'
+              current-parameters: true
+              node-parameters: true
+              kill-phase-on: FAILURE
+              abort-all-job: true
+
+- job-template:
+    name: 'kubernetes-offline-{phase}-{distro}-{type}-periodic'
+
+    disabled: '{obj:disabled}'
+
+    properties:
+      - logrotate
+      - throttle:
+          max-per-node: 1
+          max-total: 3
+          option: project
+
+    wrappers:
+      - build-timeout:
+          timeout: '{build-timeout}'
+      - mask-passwords
+      - fix-workspace-permissions
+
+    builders:
+      - shell: |
+          #!/bin/bash
+          env
diff --git a/jjb/engine/engine-periodic-jobs/engine-periodic-release-jobs.yaml b/jjb/engine/engine-periodic-jobs/engine-periodic-release-jobs.yaml
new file mode 100644 (file)
index 0000000..eb5d875
--- /dev/null
@@ -0,0 +1,217 @@
+---
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+- project:
+    name: 'engine-release'
+
+    project: 'engine-release'
+
+    environment-type:
+      - offline:
+          disabled: false
+          execution-mode: offline-deployment
+          pdf: 'file:///opt/engine/offline/git/hwconfig/pods'
+          idf: 'file:///opt/engine/offline/git/hwconfig/pods'
+
+    distro:
+      - ubuntu1804
+
+    phase:
+      - package
+      - promote
+
+    cloud:
+      - city:
+          openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
+
+    jobs:
+      - 'kubernetes-periodic-release-{environment-type}-{distro}'
+      - 'kubernetes-periodic-{phase}-{distro}'
+
+- job-template:
+    name: 'kubernetes-periodic-release-{environment-type}-{distro}'
+
+    project-type: multijob
+
+    disabled: '{obj:disabled}'
+
+    concurrent: false
+
+    parameters:
+      - string:
+          name: EXECUTION_MODE
+          default: '{execution-mode}'
+          description: 'Engine execution mode - online-deployment or offline-deployment - default is online-deployment'
+      - string:
+          name: DISTRO
+          default: '{distro}'
+          description: 'Distribution to use for configuring target nodes (networking etc.)'
+      - string:
+          name: INSTALLER_TYPE
+          default: 'kubespray'
+          description: 'Installer type to use'
+      - string:
+          name: DEPLOY_SCENARIO
+          default: 'k8-calico-nofeature'
+          description: 'Scenario to deploy and test'
+      - string:
+          name: PDF
+          default: '{pdf}/${{NODE_NAME}}-pdf.yml'
+          description: 'PDF file to use for deployment'
+      - string:
+          name: IDF
+          default: '{idf}/${{NODE_NAME}}-idf.yml'
+          description: 'IDF file to use for deployment'
+      - string:
+          name: VERBOSITY
+          default: 'true'
+          description: 'Verbosity setting for the engine - true or false - default is false'
+      - string:
+          name: NORDIX_ARM_PUBLIC_IP
+          default: '91.106.198.25'
+          description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
+      - string:
+          name: NORDIX_ARM_HTTPS_URL
+          default: 'https://artifactory.nordix.org/artifactory'
+          description: 'URL to Nordix Artifactory'
+      - string:
+          name: NORDIX_ARM_REPO
+          default: 'nordix-kubernetes'
+          description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
+      - string:
+          name: NORDIX_ARTIFACT_URL
+          default: "$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/change/$GERRIT_CHANGE_NUMBER/k8s-installer-ubuntu1804.bsx"
+          description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
+      - label:
+          name: SLAVE_LABEL
+          default: 'engine-build-ubuntu1804'
+          description: 'Slave label to schedule this job on.'
+
+    properties:
+      - logrotate
+
+    wrappers:
+      - build-timeout:
+          timeout: 180
+      - mask-passwords
+      - fix-workspace-permissions
+
+    triggers:
+      - pollscm:
+          cron: "H 0,8,16 * * *"
+
+    scm:
+      - git:
+          url: https://gerrit.nordix.org/infra/engine.git
+          branches:
+            - master
+          timeout: 15
+          wipe-workspace: true
+
+    builders:
+      - 'engine-wait-pkg-mgr-macro'
+      - 'engine-generate-ssh-keypair-macro'
+      - 'engine-generate-job-metadata-macro'
+      - multijob:
+          name: packaging
+          condition: SUCCESSFUL
+          execution-type: PARALLEL
+          projects:
+            - name: 'kubernetes-periodic-package-{distro}'
+              current-parameters: true
+              git-revision: true
+              node-parameters: true
+              property-file: "$WORKSPACE/job.properties"
+              kill-phase-on: FAILURE
+              abort-all-job: true
+      - multijob:
+          name: release test k8-calico-nofeature
+          condition: SUCCESSFUL
+          execution-type: PARALLEL
+          projects:
+            - name: 'k8-calico-nofeature-offline-{distro}-baremetal-periodic'
+              current-parameters: false
+              git-revision: false
+              node-parameters: false
+              property-file: "$WORKSPACE/job.properties"
+              kill-phase-on: FAILURE
+              abort-all-job: true
+      - multijob:
+          name: release test k8-multus-nofeature
+          condition: SUCCESSFUL
+          execution-type: PARALLEL
+          projects:
+            - name: 'k8-multus-nofeature-offline-{distro}-baremetal-periodic'
+              current-parameters: false
+              git-revision: false
+              node-parameters: false
+              property-file: "$WORKSPACE/job.properties"
+              kill-phase-on: FAILURE
+              abort-all-job: true
+      - multijob:
+          name: promotion
+          condition: SUCCESSFUL
+          execution-type: PARALLEL
+          projects:
+            - name: 'kubernetes-periodic-promote-package-{distro}'
+              current-parameters: true
+              git-revision: true
+              node-parameters: true
+              property-file: "$WORKSPACE/job.properties"
+              kill-phase-on: FAILURE
+              abort-all-job: true
+
+- job-template:
+    name: 'kubernetes-periodic-{phase}-{distro}'
+
+    disabled: '{obj:disabled}'
+
+    concurrent: false
+
+    properties:
+      - logrotate
+
+    wrappers:
+      - build-timeout:
+          timeout: 70
+      - credentials-binding:
+          - username-password-separated:
+              credential-id: 'nordix-cicd-arm-credentials'
+              username: NORDIX_ARM_USERNAME
+              password: NORDIX_ARM_TOKEN
+      - mask-passwords
+      - fix-workspace-permissions
+
+    scm:
+      - git:
+          url: https://gerrit.nordix.org/infra/engine.git
+          branches:
+            - master
+          timeout: 15
+          wipe-workspace: true
+
+    builders:
+      - shell: |
+          #!/bin/bash
+          env
+
+#      - 'engine-wait-pkg-mgr-macro'
+#      - 'engine-generate-ssh-keypair-macro'
+#      - 'engine-packaging-macro'
+#      - 'engine-upload-artifact-macro'
diff --git a/jjb/engine/scripts/generate-job-metadata.sh b/jjb/engine/scripts/generate-job-metadata.sh
new file mode 100755 (executable)
index 0000000..eaa0aca
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# ============LICENSE_START=======================================================
+#  Copyright (C) 2019 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+set -o nounset
+set -o errexit
+set -o pipefail
+
+cd $WORKSPACE
+echo "Info  : Generating job metadata"
+cat << EOF > "$WORKSPACE/job.properties"
+BUILD_IDENTIFIER="$(date '+%Y%m%d%H%M')"
+PROMOTED_BY="$BUILD_URL"
+NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/release/$BUILD_IDENTIFIER"
+ENGINE_SHA="$(git rev-parse HEAD)"
+EOF
+
+echo "Info  : Job metadata"
+echo "-------------------------------------------------------------------------"
+cat "$WORKSPACE/job.properties"
+echo "-------------------------------------------------------------------------"