Add multinode CI job

Packstack has traditionally allowed multinode deployments with
1 controller, one or more network nodes and several compute nodes,
but this has never been properly tested in our CI.

This job enables an option to use a 2-node architecture, with one
controller and one compute node. It adds a job running scenario002,
but enables scenario001 and scenario003, so they can be used on
demand if needed.

Change-Id: Ide96a232c902370f3ec25ed54f2b272cc1757dad
This commit is contained in:
Javier Pena 2017-10-31 17:08:36 +01:00 committed by Javier Peña
parent 80be10d997
commit c1dd9435ee
7 changed files with 150 additions and 9 deletions

View File

@ -1,10 +1,8 @@
- job:
name: packstack-base
parent: base
timeout: 3600
nodeset: centos-7
timeout: 7200
pre-run: playbooks/packstack-pre.yaml
run: playbooks/packstack-integration-tempest.yaml
post-run: playbooks/upload-logs.yaml
irrelevant-files:
- ^docs/.*$
@ -36,31 +34,62 @@
- openstack/puppet-vswitch
- job:
name: packstack-integration-scenario001-tempest
name: packstack-allinone
parent: packstack-base
nodeset:
nodes:
- name: allinone
label: centos-7
run: playbooks/packstack-integration-tempest.yaml
- job:
name: packstack-multinode
parent: packstack-base
nodeset:
nodes:
- name: controller
label: centos-7
- name: compute
label: centos-7
run: playbooks/packstack-multinode.yaml
- job:
name: packstack-integration-scenario001-tempest
parent: packstack-allinone
vars:
scenario: scenario001
- job:
name: packstack-integration-scenario002-tempest
parent: packstack-base
parent: packstack-allinone
vars:
scenario: scenario002
- job:
name: packstack-integration-scenario003-tempest
parent: packstack-base
parent: packstack-allinone
vars:
scenario: scenario003
# We should have nested post-run jobs, according to
# https://docs.openstack.org/infra/zuul/user/config.html#job
- job:
name: packstack-multinode-scenario002-tempest
parent: packstack-multinode
post-run: playbooks/packstack-post-compute.yaml
vars:
scenario: scenario002
- project:
check:
jobs:
- packstack-integration-scenario001-tempest
- packstack-integration-scenario002-tempest
- packstack-integration-scenario003-tempest
- packstack-multinode-scenario002-tempest
gate:
jobs:
- packstack-integration-scenario001-tempest
- packstack-integration-scenario002-tempest
- packstack-integration-scenario003-tempest
- packstack-multinode-scenario002-tempest

View File

@ -0,0 +1,59 @@
- hosts: compute
name: setup RDO Trunk repositories
vars:
delorean: "https://trunk.rdoproject.org/centos7-master/current-passed-ci/delorean.repo"
delorean_deps: "https://trunk.rdoproject.org/centos7-master/delorean-deps.repo"
tasks:
- name: Fetch DLRN repo
get_url:
url: "{{ delorean }}"
dest: /etc/yum.repos.d/delorean.repo
mode: 0640
become: true
- name: Fetch DLRN dependency repo
get_url:
url: "{{ delorean_deps }}"
dest: /etc/yum.repos.d/delorean-deps.repo
mode: 0640
become: true
- hosts: controller
name: packstack-multinode
tasks:
- name: Generate SSH key on controller
shell: ssh-keygen -t rsa -f /root/.ssh/id_rsa -P ""
args:
creates: /root/.ssh/id_rsa
become: true
- name: Fetch SSH key
shell: cat /root/.ssh/id_rsa.pub
become: true
register: ssh_key
- name: Deploy SSH key on compute node
authorized_key:
user: root
state: present
key: "{{ ssh_key.stdout }}"
delegate_to: "{{ hostvars['compute'].ansible_host }}"
become: true
- name: Deploy SSH key on controller
authorized_key:
user: root
state: present
key: "{{ ssh_key.stdout }}"
become: true
- name: Run Packstack
shell:
cmd: |
set -e
set -x
export SCENARIO='{{ scenario }}'
export CONTROLLER_NODE="{{ hostvars['controller'].nodepool.public_ipv4 }}"
export COMPUTE_NODE="{{ hostvars['compute'].nodepool.public_ipv4 }}"
./run_tests.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace/packstack'

View File

@ -0,0 +1,20 @@
- hosts: compute
name: store compute node logs
tasks:
- file:
path: /tmp/logs
state: directory
mode: 0755
- file:
path: /tmp/compute
state: directory
mode: 0755
- shell:
cmd: |
source /home/zuul/src/git.openstack.org/openstack/packstack/tools/copy-logs.sh
recover_default_logs
mv /tmp/logs/* /tmp/compute
mv /tmp/compute /tmp/logs
become: true

View File

@ -28,6 +28,10 @@ SELINUX_ENFORCING=${SELINUX_ENFORCING:-true}
# If logs should be retrieved automatically
COPY_LOGS=${COPY_LOGS:-true}
# Let's add an option for a secondary node, to act as a compute
CONTROLLER_NODE=${CONTROLLER_NODE:-}
COMPUTE_NODE=${COMPUTE_NODE:-}
# Install external Puppet modules with r10k
# Uses the following variables:
#

View File

@ -1,4 +1,7 @@
#!/bin/bash
CONTROLLER_NODE=${CONTROLLER_NODE:-}
COMPUTE_NODE=${COMPUTE_NODE:-}
if [ $(id -u) != 0 ]; then
SUDO='sudo'
fi
@ -14,8 +17,14 @@ echo -e "Generating packstack config for:
echo "tempest will run if packstack's installation completes successfully."
echo
if [ -z $COMPUTE_NODE ]; then
NODE_FLAGS="--allinone"
else
NODE_FLAGS="--allinone --os-controller-host=$CONTROLLER_NODE --os-network-hosts=$CONTROLLER_NODE --os-compute-hosts=$COMPUTE_NODE"
fi
$SUDO packstack ${ADDITIONAL_ARGS} \
--allinone \
${NODE_FLAGS} \
--cinder-volume-name="aVolume" \
--debug \
--service-workers=2 \

View File

@ -1,4 +1,7 @@
#!/bin/bash
CONTROLLER_NODE=${CONTROLLER_NODE:-}
COMPUTE_NODE=${COMPUTE_NODE:-}
if [ $(id -u) != 0 ]; then
SUDO='sudo'
fi
@ -16,9 +19,16 @@ echo -e "Generating packstack config for:
echo "tempest will run if packstack's installation completes successfully."
echo
if [ -z $COMPUTE_NODE ]; then
NODE_FLAGS="--allinone"
else
NODE_FLAGS="--allinone --os-controller-host=$CONTROLLER_NODE --os-network-hosts=$CONTROLLER_NODE --os-compute-hosts=$COMPUTE_NODE"
fi
$SUDO packstack ${ADDITIONAL_ARGS} \
--allinone \
${NODE_FLAGS} \
--debug \
--os-debug-mode=y \
--service-workers=2 \
--default-password="packstack" \
--os-aodh-install=n \

View File

@ -1,4 +1,7 @@
#!/bin/bash
CONTROLLER_NODE=${CONTROLLER_NODE:-}
COMPUTE_NODE=${COMPUTE_NODE:-}
if [ $(id -u) != 0 ]; then
SUDO='sudo'
fi
@ -18,9 +21,16 @@ echo -e "Generating packstack config for:
echo "tempest will run if packstack's installation completes successfully."
echo
if [ -z $COMPUTE_NODE ]; then
NODE_FLAGS="--allinone"
else
NODE_FLAGS="--allinone --os-controller-host=$CONTROLLER_NODE --os-network-hosts=$CONTROLLER_NODE --os-compute-hosts=$COMPUTE_NODE"
fi
$SUDO packstack ${ADDITIONAL_ARGS} \
--allinone \
${NODE_FLAGS} \
--debug \
--os-debug-mode=y \
--service-workers=2 \
--default-password="packstack" \
--os-swift-install=n \