summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Schultz <aschultz@redhat.com>2018-10-12 10:19:19 -0600
committerAlex Schultz <aschultz@redhat.com>2018-11-12 16:47:29 +0000
commitc68220e8e899398bcd5117e1f397e52788ebf3da (patch)
treed602042e1e7904fab513a976c11da9c76c4ddb06
parent2a95949f2d1c53cf60a024097e8f7d97afc81c3f (diff)
Update buildimage playbook for zuul v3
Rather than continue using a venv, let's update the job to zuul v3 and use the native system to perform the image building. Change-Id: I2a7a60cf3f81102ffbb95187f7419e4c804be689
Notes
Notes (review): Code-Review+2: Sagi Shnaidman <sshnaidm@redhat.com> Workflow+1: Emilien Macchi <emilien@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 16 Nov 2018 08:16:59 +0000 Reviewed-on: https://review.openstack.org/610102 Project: openstack-infra/tripleo-ci Branch: refs/heads/master
-rw-r--r--playbooks/tripleo-buildimage/run-v3.yaml83
-rw-r--r--playbooks/tripleo-buildimage/run.yaml8
-rw-r--r--playbooks/tripleo-buildimage/vars/common.yaml2
-rw-r--r--zuul.d/build-image.yaml20
-rw-r--r--zuul.d/layout.yaml12
5 files changed, 115 insertions, 10 deletions
diff --git a/playbooks/tripleo-buildimage/run-v3.yaml b/playbooks/tripleo-buildimage/run-v3.yaml
new file mode 100644
index 0000000..5631f84
--- /dev/null
+++ b/playbooks/tripleo-buildimage/run-v3.yaml
@@ -0,0 +1,83 @@
1- hosts: all
2 name: TripleO image building job
3 roles:
4 - role: bindep
5 bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/python-tripleoclient'].src_dir }}"
6 - role: tripleo-repos
7 tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/tripleo-repos'].src_dir }}"
8 tasks:
9 - name: Include common buildimage vars
10 include_vars:
11 file: "common.yaml"
12
13 - name: Swap is essential as we are not meeting memory requirements
14 include_role:
15 name: configure-swap
16
17 - name: Set legacy log path
18 include_role:
19 name: set-zuul-log-path-fact
20
21 - name: Ensure legacy workspace directory
22 file:
23 path: '{{ workspace }}'
24 state: directory
25
26 - name: Ensure legacy logs directory
27 file:
28 path: '{{ workspace }}/logs'
29 state: directory
30
31 - name: Install pip
32 package:
33 name: python-pip
34 state: present
35
36 - name: Install virtualenv
37 package:
38 name: python-virtualenv
39 state: present
40
41 - name: pip install tripleo items
42 become: true
43 pip:
44 name:
45 - "file://{{ openstack_git_root }}/diskimage-builder"
46 - "file://{{ openstack_git_root }}/python-tripleoclient"
47 - "file://{{ openstack_git_root }}/tripleo-common"
48 state: present
49 virtualenv: "{{ workspace }}/venv"
50
51 # NOTE(aschultz) :we dropped support for instack-undercloud in Stein so
52 # we use a directory existance check to determine if we should include it
53 - name: Run image build
54 args:
55 chdir: '{{ workspace }}'
56 shell: |
57 set -x
58 source {{ workspace }}/venv/bin/activate
59 TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/tripleo-common"
60
61 ELEMENTS="{{ openstack_git_root }}/tripleo-puppet-elements/elements:"
62 ELEMENTS+="{{ openstack_git_root }}/tripleo-image-elements/elements:"
63 ELEMENTS+="{{ openstack_git_root }}/heat-templates/hot/software-config/elements"
64
65 if [ -d "{{ openstack_git_root }}/instack-undercloud/elements" ]; then
66 ELEMENTS="{{ openstack_git_root }}/instack-undercloud/elements:${ELEMENTS}"
67 fi
68
69 if [ "{{ tripleo_image_type }}" == "overcloud-hardened-full" ]; then
70 CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-hardened-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-hardened-images-{{ tripleo_image_os }}.yaml"
71 else
72 CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-{{ tripleo_image_os }}.yaml"
73 fi
74
75 export ELEMENTS_PATH=$ELEMENTS
76 export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
77
78 openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log
79 RESULT=$?
80
81 mv *.log {{ workspace }}/logs/
82 exit $RESULT
83
diff --git a/playbooks/tripleo-buildimage/run.yaml b/playbooks/tripleo-buildimage/run.yaml
index a98ed7b..7f12095 100644
--- a/playbooks/tripleo-buildimage/run.yaml
+++ b/playbooks/tripleo-buildimage/run.yaml
@@ -1,3 +1,4 @@
1### DEPRECATED USE run-v3.yaml
1- hosts: all 2- hosts: all
2 name: Autoconverted job legacy-tripleo-buildimage 3 name: Autoconverted job legacy-tripleo-buildimage
3 roles: 4 roles:
@@ -49,6 +50,7 @@
49 ELEMENTS="$WORKSPACE/tripleo-puppet-elements/elements:" 50 ELEMENTS="$WORKSPACE/tripleo-puppet-elements/elements:"
50 ELEMENTS+="$WORKSPACE/tripleo-image-elements/elements:" 51 ELEMENTS+="$WORKSPACE/tripleo-image-elements/elements:"
51 ELEMENTS+="$WORKSPACE/heat-templates/hot/software-config/elements" 52 ELEMENTS+="$WORKSPACE/heat-templates/hot/software-config/elements"
53 TOX_ENV=venv
52 54
53 # Basic Deployment (CLI) 55 # Basic Deployment (CLI)
54 # http://docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html 56 # http://docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html
@@ -91,7 +93,7 @@
91 export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*" 93 export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
92 94
93 # install dib & tripleo-common source 95 # install dib & tripleo-common source
94 tox -evenv -- pip install $WORKSPACE/diskimage-builder $WORKSPACE/tripleo-common 96 tox -- pip install $WORKSPACE/diskimage-builder $WORKSPACE/tripleo-common
95 97
96 TRIPLEO_COMMON_PATH=$WORKSPACE/tripleo-common 98 TRIPLEO_COMMON_PATH=$WORKSPACE/tripleo-common
97 export ELEMENTS_PATH=$ELEMENTS 99 export ELEMENTS_PATH=$ELEMENTS
@@ -101,9 +103,9 @@
101 CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-centos7.yaml" 103 CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-centos7.yaml"
102 fi 104 fi
103 if [ "$ZUUL_BRANCH" == "stable/newton" ]; then 105 if [ "$ZUUL_BRANCH" == "stable/newton" ]; then
104 tox -evenv -- openstack overcloud image build --type {{ tripleo_image_type }} --elements-path="$ELEMENTS" 106 tox -- openstack overcloud image build --type {{ tripleo_image_type }} --elements-path="$ELEMENTS"
105 else 107 else
106 tox -evenv -- openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES 108 tox -- openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES
107 fi 109 fi
108 110
109 mkdir -p $WORKSPACE/logs 111 mkdir -p $WORKSPACE/logs
diff --git a/playbooks/tripleo-buildimage/vars/common.yaml b/playbooks/tripleo-buildimage/vars/common.yaml
new file mode 100644
index 0000000..6138324
--- /dev/null
+++ b/playbooks/tripleo-buildimage/vars/common.yaml
@@ -0,0 +1,2 @@
1workspace: "{{ ansible_user_dir }}/workspace"
2openstack_git_root: "{{ ansible_user_dir }}/src/git.openstack.org/openstack"
diff --git a/zuul.d/build-image.yaml b/zuul.d/build-image.yaml
index 0bd7181..a47a1a2 100644
--- a/zuul.d/build-image.yaml
+++ b/zuul.d/build-image.yaml
@@ -17,8 +17,8 @@
17 17
18- job: 18- job:
19 name: tripleo-buildimage-ironic-python-agent-centos-7 19 name: tripleo-buildimage-ironic-python-agent-centos-7
20 parent: tripleo-ci-dsvm 20 parent: tripleo-ci-base
21 run: playbooks/tripleo-buildimage/run.yaml 21 run: playbooks/tripleo-buildimage/run-v3.yaml
22 post-run: playbooks/tripleo-buildimage/post.yaml 22 post-run: playbooks/tripleo-buildimage/post.yaml
23 timeout: 4200 23 timeout: 4200
24 nodeset: single-centos-7-node 24 nodeset: single-centos-7-node
@@ -33,9 +33,11 @@
33 - git.openstack.org/openstack/tripleo-common 33 - git.openstack.org/openstack/tripleo-common
34 - git.openstack.org/openstack/tripleo-image-elements 34 - git.openstack.org/openstack/tripleo-image-elements
35 - git.openstack.org/openstack/tripleo-puppet-elements 35 - git.openstack.org/openstack/tripleo-puppet-elements
36 - git.openstack.org/openstack/tripleo-repos
36 - git.openstack.org/openstack/requirements 37 - git.openstack.org/openstack/requirements
37 vars: 38 vars:
38 tripleo_image_type: ironic-python-agent 39 tripleo_image_type: ironic-python-agent
40 tripleo_image_os: centos7
39 voting: false 41 voting: false
40 irrelevant-files: 42 irrelevant-files:
41 - ^.*\.rst$ 43 - ^.*\.rst$
@@ -43,8 +45,8 @@
43 45
44- job: 46- job:
45 name: tripleo-buildimage-overcloud-full-centos-7 47 name: tripleo-buildimage-overcloud-full-centos-7
46 parent: tripleo-ci-dsvm 48 parent: tripleo-ci-base
47 run: playbooks/tripleo-buildimage/run.yaml 49 run: playbooks/tripleo-buildimage/run-v3.yaml
48 post-run: playbooks/tripleo-buildimage/post.yaml 50 post-run: playbooks/tripleo-buildimage/post.yaml
49 timeout: 4200 51 timeout: 4200
50 nodeset: single-centos-7-node 52 nodeset: single-centos-7-node
@@ -58,17 +60,19 @@
58 - git.openstack.org/openstack/tripleo-common 60 - git.openstack.org/openstack/tripleo-common
59 - git.openstack.org/openstack/tripleo-image-elements 61 - git.openstack.org/openstack/tripleo-image-elements
60 - git.openstack.org/openstack/tripleo-puppet-elements 62 - git.openstack.org/openstack/tripleo-puppet-elements
63 - git.openstack.org/openstack/tripleo-repos
61 vars: 64 vars:
62 tripleo_image_type: overcloud-full 65 tripleo_image_type: overcloud-full
66 tripleo_image_os: centos7
63 irrelevant-files: 67 irrelevant-files:
64 - ^.*\.rst$ 68 - ^.*\.rst$
65 - ^releasenotes/.*$ 69 - ^releasenotes/.*$
66 70
67- job: 71- job:
68 name: tripleo-buildimage-overcloud-hardened-full-centos-7 72 name: tripleo-buildimage-overcloud-hardened-full-centos-7
69 parent: tripleo-ci-dsvm 73 parent: tripleo-ci-base
70 run: playbooks/tripleo-buildimage/run.yaml 74 run: playbooks/tripleo-buildimage/run-v3.yaml
71 post-run: playbooks/tripleo-build/post.yaml 75 post-run: playbooks/tripleo-buildimage/post.yaml
72 timeout: 4200 76 timeout: 4200
73 nodeset: single-centos-7-node 77 nodeset: single-centos-7-node
74 required-projects: 78 required-projects:
@@ -80,9 +84,11 @@
80 - git.openstack.org/openstack/tripleo-common 84 - git.openstack.org/openstack/tripleo-common
81 - git.openstack.org/openstack/tripleo-image-elements 85 - git.openstack.org/openstack/tripleo-image-elements
82 - git.openstack.org/openstack/tripleo-puppet-elements 86 - git.openstack.org/openstack/tripleo-puppet-elements
87 - git.openstack.org/openstack/tripleo-repos
83 - git.openstack.org/openstack/requirements 88 - git.openstack.org/openstack/requirements
84 vars: 89 vars:
85 tripleo_image_type: overcloud-hardened-full 90 tripleo_image_type: overcloud-hardened-full
91 tripleo_image_os: centos7
86 voting: false 92 voting: false
87 irrelevant-files: 93 irrelevant-files:
88 - ^.*\.rst$ 94 - ^.*\.rst$
diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml
index a4c07ec..1f6e4e9 100644
--- a/zuul.d/layout.yaml
+++ b/zuul.d/layout.yaml
@@ -21,6 +21,15 @@
21 - openstack-tox-py35: 21 - openstack-tox-py35:
22 files: 22 files:
23 - ^scripts/emit_releases_file/.*$ 23 - ^scripts/emit_releases_file/.*$
24 - tripleo-buildimage-overcloud-full-centos-7:
25 files:
26 - ^playbooks/tripleo-buildimage/.*$
27 - tripleo-buildimage-ironic-python-agent-centos-7:
28 files:
29 - ^playbooks/tripleo-buildimage/.*$
30 - tripleo-buildimage-overcloud-hardened-full-centos-7:
31 files:
32 - ^playbooks/tripleo-buildimage/.*$
24 - tripleo-ci-centos-7-scenario001-multinode-oooq: 33 - tripleo-ci-centos-7-scenario001-multinode-oooq:
25 files: 34 files:
26 - ^playbooks/tripleo-ci/.*$ 35 - ^playbooks/tripleo-ci/.*$
@@ -75,6 +84,9 @@
75 - openstack-tox-pep8: 84 - openstack-tox-pep8:
76 files: 85 files:
77 - ^scripts/emit_releases_file/.*$ 86 - ^scripts/emit_releases_file/.*$
87 - tripleo-buildimage-overcloud-full-centos-7:
88 files:
89 - ^playbooks/tripleo-buildimage/.*$
78 - tripleo-ci-centos-7-scenario001-multinode-oooq: 90 - tripleo-ci-centos-7-scenario001-multinode-oooq:
79 files: 91 files:
80 - ^playbooks/tripleo-ci/.*$ 92 - ^playbooks/tripleo-ci/.*$