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
This commit is contained in:
parent
2a95949f2d
commit
c68220e8e8
|
@ -0,0 +1,83 @@
|
|||
- hosts: all
|
||||
name: TripleO image building job
|
||||
roles:
|
||||
- role: bindep
|
||||
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/python-tripleoclient'].src_dir }}"
|
||||
- role: tripleo-repos
|
||||
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/tripleo-repos'].src_dir }}"
|
||||
tasks:
|
||||
- name: Include common buildimage vars
|
||||
include_vars:
|
||||
file: "common.yaml"
|
||||
|
||||
- name: Swap is essential as we are not meeting memory requirements
|
||||
include_role:
|
||||
name: configure-swap
|
||||
|
||||
- name: Set legacy log path
|
||||
include_role:
|
||||
name: set-zuul-log-path-fact
|
||||
|
||||
- name: Ensure legacy workspace directory
|
||||
file:
|
||||
path: '{{ workspace }}'
|
||||
state: directory
|
||||
|
||||
- name: Ensure legacy logs directory
|
||||
file:
|
||||
path: '{{ workspace }}/logs'
|
||||
state: directory
|
||||
|
||||
- name: Install pip
|
||||
package:
|
||||
name: python-pip
|
||||
state: present
|
||||
|
||||
- name: Install virtualenv
|
||||
package:
|
||||
name: python-virtualenv
|
||||
state: present
|
||||
|
||||
- name: pip install tripleo items
|
||||
become: true
|
||||
pip:
|
||||
name:
|
||||
- "file://{{ openstack_git_root }}/diskimage-builder"
|
||||
- "file://{{ openstack_git_root }}/python-tripleoclient"
|
||||
- "file://{{ openstack_git_root }}/tripleo-common"
|
||||
state: present
|
||||
virtualenv: "{{ workspace }}/venv"
|
||||
|
||||
# NOTE(aschultz) :we dropped support for instack-undercloud in Stein so
|
||||
# we use a directory existance check to determine if we should include it
|
||||
- name: Run image build
|
||||
args:
|
||||
chdir: '{{ workspace }}'
|
||||
shell: |
|
||||
set -x
|
||||
source {{ workspace }}/venv/bin/activate
|
||||
TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/tripleo-common"
|
||||
|
||||
ELEMENTS="{{ openstack_git_root }}/tripleo-puppet-elements/elements:"
|
||||
ELEMENTS+="{{ openstack_git_root }}/tripleo-image-elements/elements:"
|
||||
ELEMENTS+="{{ openstack_git_root }}/heat-templates/hot/software-config/elements"
|
||||
|
||||
if [ -d "{{ openstack_git_root }}/instack-undercloud/elements" ]; then
|
||||
ELEMENTS="{{ openstack_git_root }}/instack-undercloud/elements:${ELEMENTS}"
|
||||
fi
|
||||
|
||||
if [ "{{ tripleo_image_type }}" == "overcloud-hardened-full" ]; then
|
||||
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"
|
||||
else
|
||||
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"
|
||||
fi
|
||||
|
||||
export ELEMENTS_PATH=$ELEMENTS
|
||||
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
|
||||
|
||||
openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log
|
||||
RESULT=$?
|
||||
|
||||
mv *.log {{ workspace }}/logs/
|
||||
exit $RESULT
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
### DEPRECATED USE run-v3.yaml
|
||||
- hosts: all
|
||||
name: Autoconverted job legacy-tripleo-buildimage
|
||||
roles:
|
||||
|
@ -49,6 +50,7 @@
|
|||
ELEMENTS="$WORKSPACE/tripleo-puppet-elements/elements:"
|
||||
ELEMENTS+="$WORKSPACE/tripleo-image-elements/elements:"
|
||||
ELEMENTS+="$WORKSPACE/heat-templates/hot/software-config/elements"
|
||||
TOX_ENV=venv
|
||||
|
||||
# Basic Deployment (CLI)
|
||||
# http://docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html
|
||||
|
@ -91,7 +93,7 @@
|
|||
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
|
||||
|
||||
# install dib & tripleo-common source
|
||||
tox -evenv -- pip install $WORKSPACE/diskimage-builder $WORKSPACE/tripleo-common
|
||||
tox -- pip install $WORKSPACE/diskimage-builder $WORKSPACE/tripleo-common
|
||||
|
||||
TRIPLEO_COMMON_PATH=$WORKSPACE/tripleo-common
|
||||
export ELEMENTS_PATH=$ELEMENTS
|
||||
|
@ -101,9 +103,9 @@
|
|||
CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-centos7.yaml"
|
||||
fi
|
||||
if [ "$ZUUL_BRANCH" == "stable/newton" ]; then
|
||||
tox -evenv -- openstack overcloud image build --type {{ tripleo_image_type }} --elements-path="$ELEMENTS"
|
||||
tox -- openstack overcloud image build --type {{ tripleo_image_type }} --elements-path="$ELEMENTS"
|
||||
else
|
||||
tox -evenv -- openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES
|
||||
tox -- openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES
|
||||
fi
|
||||
|
||||
mkdir -p $WORKSPACE/logs
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
workspace: "{{ ansible_user_dir }}/workspace"
|
||||
openstack_git_root: "{{ ansible_user_dir }}/src/git.openstack.org/openstack"
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
- job:
|
||||
name: tripleo-buildimage-ironic-python-agent-centos-7
|
||||
parent: tripleo-ci-dsvm
|
||||
run: playbooks/tripleo-buildimage/run.yaml
|
||||
parent: tripleo-ci-base
|
||||
run: playbooks/tripleo-buildimage/run-v3.yaml
|
||||
post-run: playbooks/tripleo-buildimage/post.yaml
|
||||
timeout: 4200
|
||||
nodeset: single-centos-7-node
|
||||
|
@ -33,9 +33,11 @@
|
|||
- git.openstack.org/openstack/tripleo-common
|
||||
- git.openstack.org/openstack/tripleo-image-elements
|
||||
- git.openstack.org/openstack/tripleo-puppet-elements
|
||||
- git.openstack.org/openstack/tripleo-repos
|
||||
- git.openstack.org/openstack/requirements
|
||||
vars:
|
||||
tripleo_image_type: ironic-python-agent
|
||||
tripleo_image_os: centos7
|
||||
voting: false
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
|
@ -43,8 +45,8 @@
|
|||
|
||||
- job:
|
||||
name: tripleo-buildimage-overcloud-full-centos-7
|
||||
parent: tripleo-ci-dsvm
|
||||
run: playbooks/tripleo-buildimage/run.yaml
|
||||
parent: tripleo-ci-base
|
||||
run: playbooks/tripleo-buildimage/run-v3.yaml
|
||||
post-run: playbooks/tripleo-buildimage/post.yaml
|
||||
timeout: 4200
|
||||
nodeset: single-centos-7-node
|
||||
|
@ -58,17 +60,19 @@
|
|||
- git.openstack.org/openstack/tripleo-common
|
||||
- git.openstack.org/openstack/tripleo-image-elements
|
||||
- git.openstack.org/openstack/tripleo-puppet-elements
|
||||
- git.openstack.org/openstack/tripleo-repos
|
||||
vars:
|
||||
tripleo_image_type: overcloud-full
|
||||
tripleo_image_os: centos7
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
- ^releasenotes/.*$
|
||||
|
||||
- job:
|
||||
name: tripleo-buildimage-overcloud-hardened-full-centos-7
|
||||
parent: tripleo-ci-dsvm
|
||||
run: playbooks/tripleo-buildimage/run.yaml
|
||||
post-run: playbooks/tripleo-build/post.yaml
|
||||
parent: tripleo-ci-base
|
||||
run: playbooks/tripleo-buildimage/run-v3.yaml
|
||||
post-run: playbooks/tripleo-buildimage/post.yaml
|
||||
timeout: 4200
|
||||
nodeset: single-centos-7-node
|
||||
required-projects:
|
||||
|
@ -80,9 +84,11 @@
|
|||
- git.openstack.org/openstack/tripleo-common
|
||||
- git.openstack.org/openstack/tripleo-image-elements
|
||||
- git.openstack.org/openstack/tripleo-puppet-elements
|
||||
- git.openstack.org/openstack/tripleo-repos
|
||||
- git.openstack.org/openstack/requirements
|
||||
vars:
|
||||
tripleo_image_type: overcloud-hardened-full
|
||||
tripleo_image_os: centos7
|
||||
voting: false
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
|
|
|
@ -21,6 +21,15 @@
|
|||
- openstack-tox-py35:
|
||||
files:
|
||||
- ^scripts/emit_releases_file/.*$
|
||||
- tripleo-buildimage-overcloud-full-centos-7:
|
||||
files:
|
||||
- ^playbooks/tripleo-buildimage/.*$
|
||||
- tripleo-buildimage-ironic-python-agent-centos-7:
|
||||
files:
|
||||
- ^playbooks/tripleo-buildimage/.*$
|
||||
- tripleo-buildimage-overcloud-hardened-full-centos-7:
|
||||
files:
|
||||
- ^playbooks/tripleo-buildimage/.*$
|
||||
- tripleo-ci-centos-7-scenario001-multinode-oooq:
|
||||
files:
|
||||
- ^playbooks/tripleo-ci/.*$
|
||||
|
@ -75,6 +84,9 @@
|
|||
- openstack-tox-pep8:
|
||||
files:
|
||||
- ^scripts/emit_releases_file/.*$
|
||||
- tripleo-buildimage-overcloud-full-centos-7:
|
||||
files:
|
||||
- ^playbooks/tripleo-buildimage/.*$
|
||||
- tripleo-ci-centos-7-scenario001-multinode-oooq:
|
||||
files:
|
||||
- ^playbooks/tripleo-ci/.*$
|
||||
|
|
Loading…
Reference in New Issue