From: Eric Ball Date: Thu, 12 Dec 2019 17:41:21 +0000 (+0000) Subject: Merge "Add Sonarcloud scans for IEC" X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ci-management.git;a=commitdiff_plain;h=34ec2b247d2cb68583f36ea0e903d4800bc8e68c;hp=e53d76d993cf64087444511c08666cf6dee280ef Merge "Add Sonarcloud scans for IEC" --- diff --git a/jenkins-config/clouds/openstack/cattle/ubuntu1804-helm-8c-32g.cfg b/jenkins-config/clouds/openstack/cattle/ubuntu1804-helm-8c-32g.cfg new file mode 100644 index 0000000..b17fdfc --- /dev/null +++ b/jenkins-config/clouds/openstack/cattle/ubuntu1804-helm-8c-32g.cfg @@ -0,0 +1,2 @@ +IMAGE_NAME=ZZCI - Ubuntu 18.04 - helm - x86_64 - 20191207-002613.424 +HARDWARE_ID=v2-highcpu-32 \ No newline at end of file diff --git a/jjb/akraino-templates/akraino-icn-templates.yaml b/jjb/akraino-templates/akraino-icn-templates.yaml new file mode 100644 index 0000000..9b2953c --- /dev/null +++ b/jjb/akraino-templates/akraino-icn-templates.yaml @@ -0,0 +1,133 @@ +--- +# +# Copyright (c) 2019 Intel Corporation. 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. +# + +- daaas_job_boiler_plate: &daaas_job_boiler_plate + name: daaas_job_boiler_plate + archive-artifacts: > + **/*.log + build-days-to-keep: 30 + build-timeout: 60 + stream: master + project-type: freestyle + submodule-recursive: true + concurrent: true + node: "{build-node}" + + properties: + - lf-infra-properties: + build-days-to-keep: "{build-days-to-keep}" + + parameters: + - lf-infra-parameters: + project: "{project}" + stream: "{stream}" + branch: "{branch}" + lftools-version: "{lftools-version}" + + - string: + name: ARCHIVE_ARTIFACTS + default: "{archive-artifacts}" + description: Artifacts to archive to the logs server. + + wrappers: + - lf-infra-wrappers: + build-timeout: "{build-timeout}" + jenkins-ssh-credential: "{jenkins-ssh-credential}" + + scm: + - lf-infra-gerrit-scm: + jenkins-ssh-credential: "{jenkins-ssh-credential}" + git-url: "{git-url}/{project}.git" + refspec: "$GERRIT_REFSPEC" + branch: "$GERRIT_BRANCH" + submodule-recursive: "{submodule-recursive}" + submodule-timeout: "{submodule-timeout}" + submodule-disable: false + choosing-strategy: "gerrit" + + builders: + - shell: "{obj:script}" + + publishers: + - lf-infra-publish + +################# +# JOB TEMPLATES # +################# +- job-template: + # Job template for verify jobs + + name: "{project-name}-{stream}-{type}-verify" + <<: *daaas_job_boiler_plate + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + 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: "{project}" + branches: + - branch-compare-type: "ANT" + branch-pattern: "**/{branch}" + file-paths: + - compare-type: REG_EXP + pattern: ".*/?{path}/.*" + disable-strict-forbidden-file-verification: "true" + forbidden-file-paths: + - compare-type: ANT + pattern: "docs/**" + readable-message: true + +- job-template: + # Job template for merge jobs + + name: "{project-name}-{stream}-{type}-merge" + <<: *daaas_job_boiler_plate + + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: remerge$ + + triggers: + - gerrit: + server-name: "{gerrit-server-name}" + trigger-on: "{obj:gerrit_merge_triggers}" + projects: + - project-compare-type: "ANT" + project-pattern: "{project}" + branches: + - branch-compare-type: "ANT" + branch-pattern: "**/{branch}" + file-paths: + - compare-type: REG_EXP + pattern: ".*/?{path}/.*" + disable-strict-forbidden-file-verification: "true" + forbidden-file-paths: + - compare-type: ANT + pattern: "docs/**" + readable-message: true diff --git a/jjb/ci-management/ci-packer.yaml b/jjb/ci-management/ci-packer.yaml index 2f00039..97dbbf3 100644 --- a/jjb/ci-management/ci-packer.yaml +++ b/jjb/ci-management/ci-packer.yaml @@ -41,3 +41,18 @@ - ubuntu-16.04 - ubuntu-18.04 - ubuntu-18.04-arm64 + +- project: + name: packer-helm-jobs + jobs: + - gerrit-packer-merge + + packer-version: 1.4.2 + project: ci-management + project-name: ci-management + build-node: centos7-builder-2c-1g + build-timeout: 90 + + platforms: + - ubuntu-18.04 + templates: helm \ No newline at end of file diff --git a/jjb/icn-daaas/icn-daaas.yaml b/jjb/icn/icn-daaas.yaml similarity index 64% rename from jjb/icn-daaas/icn-daaas.yaml rename to jjb/icn/icn-daaas.yaml index 332c4aa..6bbcbd3 100644 --- a/jjb/icn-daaas/icn-daaas.yaml +++ b/jjb/icn/icn-daaas.yaml @@ -19,11 +19,25 @@ name: icn-daaas project: 'icn/daaas' project-name: icn-daaas - build-node: icn-dev + build-node: ubuntu1804-helm-8c-32g stream: - master: branch: master + type: + - golang: + path: microservices + script: |- + #!/bin/bash + cd $WORKSPACE/microservices + make all + - helm: + path: deploy + script: |- + #!/bin/bash + cd $WORKSPACE/deploy + make all jobs: - - akraino-project-stream-verify + - "{project-name}-{stream}-{type}-verify" + - "{project-name}-{stream}-{type}-merge" views: - project-view diff --git a/jjb/iec/iec-compass-deploy.sh b/jjb/iec/iec-compass-deploy.sh index 8cdb65e..9db4c0b 100755 --- a/jjb/iec/iec-compass-deploy.sh +++ b/jjb/iec/iec-compass-deploy.sh @@ -30,6 +30,10 @@ modify_workdir(){ ln -sfn $(pwd)/work $COMPASS_WORK_DIR sed -i "s#\$COMPASS_DIR/work#$COMPASS_WORK_DIR#g" deploy/launch.sh + + # Fix docker-compose -> requests version mismatch with other + # Akraino CI jobs (installed requests should be >= 2.12) + sed -i "s/\(docker-compose\)==1.14.0/\1==1.24.1/g" deploy/prepare.sh } config_vm diff --git a/jjb/shell/install_go.sh b/jjb/shell/install_go.sh index a9f6ffd..d5b344c 100755 --- a/jjb/shell/install_go.sh +++ b/jjb/shell/install_go.sh @@ -19,7 +19,7 @@ if [ -z "${GO_URL}" ]; then fi if [ -z "${GO_VERSION}" ]; then - GO_VERSION='go1.12.linux-amd64.tar.gz' + GO_VERSION='go1.13.4.linux-amd64.tar.gz' fi set -e -u -x -o pipefail @@ -28,4 +28,5 @@ echo "---> Installing golang from ${GO_URL} with version ${GO_VERSION}" # install go wget ${GO_URL}/${GO_VERSION} +sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf ${GO_VERSION} diff --git a/jjb/validation/validation-docker.yaml b/jjb/validation/validation-docker.yaml index 14aac1c..d145cf3 100644 --- a/jjb/validation/validation-docker.yaml +++ b/jjb/validation/validation-docker.yaml @@ -8,7 +8,7 @@ branch: '{stream}' refs_tag: 'heads' disabled: false - - 2.0.0: + - 2.0.1: branch: 'master' refs_tag: 'tags' disabled: false diff --git a/packer/provision/helm.yaml b/packer/provision/helm.yaml new file mode 100644 index 0000000..57bd951 --- /dev/null +++ b/packer/provision/helm.yaml @@ -0,0 +1,59 @@ +--- +- import_playbook: ../common-packer/provision/docker.yaml + +- hosts: all + become_user: root + become_method: sudo + + vars: + golang_version: 1.13.5 + helm_version: 2.16.1 + kubectl_version: 1.16.3 + golang_checksum: sha256:512103d7ad296467814a6e3f635631bd35574cab3369a97a323c9a585ccaa569 + + tasks: + - name: "Install GoLang {{golang_version}}" + block: + - name: "Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-amd64.tar.gz" + get_url: + url: "https://storage.googleapis.com/golang/go{{golang_version}}.linux-amd64.tar.gz" + dest: "/tmp/go{{golang_version}}.linux-amd64.tar.gz" + checksum: "{{golang_checksum}}" + - name: "Install golang {{golang_version}} to /usr/local" + unarchive: + src: "/tmp/go{{golang_version}}.linux-amd64.tar.gz" + dest: /usr/local + remote_src: true + become: true + - name: Create symbolic link to go bin + file: + src: "/usr/local/go/bin/go" + dest: "/usr/bin/go" + state: link + become: true + - name: "Install kubectl {{kubectl_version}}" + get_url: + url: https://storage.googleapis.com/kubernetes-release/release/v{{kubectl_version}}/bin/linux/amd64/kubectl + dest: /usr/local/bin/kubectl + mode: 0775 + become: yes + + - name: "Install Helm {{helm_version}}" + block: + - name: "Fetch tar.gz" + get_url: + url: https://get.helm.sh/helm-v{{helm_version}}-linux-amd64.tar.gz + dest: /tmp/helm-v{{helm_version}}-linux-amd64.tar.gz + - name: "Unarchive" + unarchive: + src: /tmp/helm-v{{helm_version}}-linux-amd64.tar.gz + dest: /tmp + remote_src: true + become: yes + - name: "Move helm to /usr/local/bin and set as executable" + command: "mv /tmp/linux-amd64/helm /usr/local/bin/helm" + become: yes + - name: "Check helm." + command: "which helm" + - name: "Check kubectl." + command: "which kubectl" diff --git a/packer/templates/helm.json b/packer/templates/helm.json new file mode 100644 index 0000000..020bb0a --- /dev/null +++ b/packer/templates/helm.json @@ -0,0 +1,62 @@ +{ + "variables": { + "ansible_roles_path": ".galaxy", + "arch": "x86_64", + "base_image": null, + "cloud_network": null, + "cloud_user_data": null, + "cloud_region": "ca-ymq-1", + "cloud_availability_zone": "ca-ymq-2", + "vm_use_block_storage": "true", + "vm_volume_size": "30", + "vm_image_disk_format": "", + "distro": null, + "flavor": "v1-standard-1", + "ssh_user": null, + "ssh_proxy_host": "" + }, + "builders": [ + { + "name": "vexxhost", + "image_name": "ZZCI - {{user `distro`}} - helm - {{user `arch`}} - {{isotime \"20060102-150405.000\"}}", + "instance_name": "{{user `distro`}}-builder-{{uuid}}", + "source_image_name": "{{user `base_image`}}", + "type": "openstack", + "region": "{{user `cloud_region`}}", + "availability_zone": "{{user `cloud_availability_zone`}}", + "networks": ["{{user `cloud_network`}}"], + "user_data_file": "{{user `cloud_user_data`}}", + "ssh_username": "{{user `ssh_user`}}", + "ssh_proxy_host": "{{user `ssh_proxy_host`}}", + "flavor": "{{user `flavor`}}", + "metadata": { + "ci_managed": "yes" + }, + "use_blockstorage_volume": "{{user `vm_use_block_storage`}}", + "volume_size": "{{user `vm_volume_size`}}", + "image_disk_format": "{{user `vm_image_disk_format`}}" + } + ], + "provisioners": [ + { + "type": "shell", + "scripts": ["common-packer/provision/install-python.sh"], + "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi" + }, + { + "type": "shell-local", + "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}}" + }, + { + "type": "ansible", + "playbook_file": "provision/helm.yaml", + "ansible_env_vars": [ + "ANSIBLE_NOCOWS=1", + "ANSIBLE_PIPELINING=True", + "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}", + "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", + "ANSIBLE_STDOUT_CALLBACK=debug" + ] + } + ] +}