From 86c47d5da2d909a96685dcb632447dfba436e005 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Sun, 7 Jan 2018 21:59:00 -0500 Subject: [PATCH] Switch Docker template to common-packer Switch to the common-packer Docker template. Split out the merge job templates so that we do not need to maintain that epic exclusion list. Change-Id: Ia2f62e3c8f602d7f3232277864386ae9d53f9889 Signed-off-by: Thanh Ha --- jjb/releng-defaults.yaml | 1 + jjb/releng-jobs.yaml | 6 ----- jjb/releng-packer-jobs.yaml | 16 +++++++++++ packer/provision/docker.sh | 51 ------------------------------------ packer/templates/docker.json | 51 +----------------------------------- 5 files changed, 18 insertions(+), 107 deletions(-) create mode 100644 jjb/releng-packer-jobs.yaml delete mode 100644 packer/provision/docker.sh mode change 100644 => 120000 packer/templates/docker.json diff --git a/jjb/releng-defaults.yaml b/jjb/releng-defaults.yaml index a06606bb7..8dbbe35b1 100644 --- a/jjb/releng-defaults.yaml +++ b/jjb/releng-defaults.yaml @@ -32,6 +32,7 @@ nexus-snapshot-repo: opendaylight.snapshot git-url: 'ssh://jenkins-$SILO@git.opendaylight.org:29418' lftools-version: <1.0.0 + packer-version: 1.1.3 # defaults for parameters installing openstack for csit jobs devstack-hash: '' diff --git a/jjb/releng-jobs.yaml b/jjb/releng-jobs.yaml index f2f33bb08..c7703ab79 100644 --- a/jjb/releng-jobs.yaml +++ b/jjb/releng-jobs.yaml @@ -48,8 +48,6 @@ build-timeout: 60 - devstack-pre-pip-pike: build-timeout: 75 - - docker: - build-timeout: 60 - gbp - java-builder: build-timeout: 75 @@ -81,8 +79,6 @@ templates: devstack-pre-pip-pike - platforms: ubuntu-14.04 templates: devstack - - platforms: ubuntu-14.04 - templates: docker - platforms: ubuntu-14.04 templates: mininet-ovs-2.5 - platforms: ubuntu-14.04 @@ -99,8 +95,6 @@ templates: devstack-pre-pip-pike - platforms: ubuntu-16.04 templates: devstack - - platforms: ubuntu-16.04 - templates: docker - platforms: ubuntu-16.04 templates: mininet - platforms: ubuntu-16.04 diff --git a/jjb/releng-packer-jobs.yaml b/jjb/releng-packer-jobs.yaml new file mode 100644 index 000000000..09205d182 --- /dev/null +++ b/jjb/releng-packer-jobs.yaml @@ -0,0 +1,16 @@ +--- +- project: + name: packer-docker-jobs + jobs: + - gerrit-packer-merge + + project: releng/builder + project-name: builder + branch: master + archive-artifacts: '**/*.log' + + build-node: centos7-java-builder-2c-8g + build-timeout: 60 + + platforms: centos + templates: docker diff --git a/packer/provision/docker.sh b/packer/provision/docker.sh deleted file mode 100644 index 12814a6f2..000000000 --- a/packer/provision/docker.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -# vim: sw=4 ts=4 sts=4 et : - -# force any errors to cause the script and job to end in failure -set -xeu -o pipefail - -rh_changes() { - echo "---> RH changes" - # install docker and enable it - echo "---> Installing docker" - yum install -y docker supervisor bridge-utils - systemctl enable docker - - # configure docker networking so that it does not conflict with LF - # internal networks - cat < /etc/sysconfig/docker-network -# /etc/sysconfig/docker-network -DOCKER_NETWORK_OPTIONS='--bip=10.250.0.254/24' -EOL - # configure docker daemon to listen on port 5555 enabling remote - # managment - sed -i -e "s#='--selinux-enabled'#='--selinux-enabled -H unix:///var/run/docker.sock -H tcp://0.0.0.0:5555'#g" /etc/sysconfig/docker - - # docker group doesn't get created by default for some reason - groupadd docker - - # Install python dependencies - yum install -y python-{devel,virtualenv,setuptools,pip} -} - -ubuntu_changes() { - echo "---> Ubuntu changes" -} - -OS=$(/usr/bin/facter operatingsystem | tr '[:upper:]' '[:lower:]') -case "$OS" in - centos|fedora|redhat) - rh_changes - ;; - ubuntu) - ubuntu_changes - ;; - *) - echo "${OS} has no configuration changes" - ;; -esac - -echo "***************************************************" -echo "* PLEASE RELOAD THIS VAGRANT BOX BEFORE USE *" -echo "***************************************************" diff --git a/packer/templates/docker.json b/packer/templates/docker.json deleted file mode 100644 index e4575f372..000000000 --- a/packer/templates/docker.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "variables": { - "public_base_image": null, - "public_network": null, - "public_cloud_user": null, - "public_auth_url": null, - "public_tenant": null, - "public_user": null, - "public_pass": null, - "distro": null, - "cloud_user_data": null, - "ssh_proxy_host": "" - }, - "builders": [ - { - "type": "openstack", - "identity_endpoint": "{{user `public_auth_url`}}", - "domain_name": "Default", - "tenant_name": "{{user `public_tenant`}}", - "username": "{{user `public_user`}}", - "password": "{{user `public_pass`}}", - "region": "ca-ymq-1", - "availability_zone": "ca-ymq-2", - "ssh_username": "{{user `public_cloud_user`}}", - "ssh_proxy_host": "{{user `ssh_proxy_host`}}", - "image_name": "ZZCI - {{user `distro`}} - docker - {{isotime \"20060102-1504\"}}", - "source_image_name": "{{user `public_base_image`}}", - "flavor": "v1-standard-1", - "networks": [ - "{{user `public_network`}}" - ], - "user_data_file": "{{user `cloud_user_data`}}", - "metadata": { - "ci_managed": "yes" - } - } - ], - "provisioners": [ - { - "type": "shell", - "scripts": [ - "provision/baseline.sh", - "provision/docker.sh", - "provision/system_reseal_local_env.sh", - "provision/system_reseal.sh" - ], - "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi" - } - ] -} diff --git a/packer/templates/docker.json b/packer/templates/docker.json new file mode 120000 index 000000000..4f33327fb --- /dev/null +++ b/packer/templates/docker.json @@ -0,0 +1 @@ +../common-packer/templates/docker.json.example \ No newline at end of file -- 2.36.6