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:
parent
80be10d997
commit
c1dd9435ee
41
.zuul.yaml
41
.zuul.yaml
@ -1,10 +1,8 @@
|
|||||||
- job:
|
- job:
|
||||||
name: packstack-base
|
name: packstack-base
|
||||||
parent: base
|
parent: base
|
||||||
timeout: 3600
|
timeout: 7200
|
||||||
nodeset: centos-7
|
|
||||||
pre-run: playbooks/packstack-pre.yaml
|
pre-run: playbooks/packstack-pre.yaml
|
||||||
run: playbooks/packstack-integration-tempest.yaml
|
|
||||||
post-run: playbooks/upload-logs.yaml
|
post-run: playbooks/upload-logs.yaml
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
- ^docs/.*$
|
- ^docs/.*$
|
||||||
@ -36,31 +34,62 @@
|
|||||||
- openstack/puppet-vswitch
|
- openstack/puppet-vswitch
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: packstack-integration-scenario001-tempest
|
name: packstack-allinone
|
||||||
parent: packstack-base
|
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:
|
vars:
|
||||||
scenario: scenario001
|
scenario: scenario001
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: packstack-integration-scenario002-tempest
|
name: packstack-integration-scenario002-tempest
|
||||||
parent: packstack-base
|
parent: packstack-allinone
|
||||||
vars:
|
vars:
|
||||||
scenario: scenario002
|
scenario: scenario002
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: packstack-integration-scenario003-tempest
|
name: packstack-integration-scenario003-tempest
|
||||||
parent: packstack-base
|
parent: packstack-allinone
|
||||||
vars:
|
vars:
|
||||||
scenario: scenario003
|
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:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- packstack-integration-scenario001-tempest
|
- packstack-integration-scenario001-tempest
|
||||||
- packstack-integration-scenario002-tempest
|
- packstack-integration-scenario002-tempest
|
||||||
- packstack-integration-scenario003-tempest
|
- packstack-integration-scenario003-tempest
|
||||||
|
- packstack-multinode-scenario002-tempest
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- packstack-integration-scenario001-tempest
|
- packstack-integration-scenario001-tempest
|
||||||
- packstack-integration-scenario002-tempest
|
- packstack-integration-scenario002-tempest
|
||||||
- packstack-integration-scenario003-tempest
|
- packstack-integration-scenario003-tempest
|
||||||
|
- packstack-multinode-scenario002-tempest
|
||||||
|
59
playbooks/packstack-multinode.yaml
Normal file
59
playbooks/packstack-multinode.yaml
Normal 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'
|
20
playbooks/packstack-post-compute.yaml
Normal file
20
playbooks/packstack-post-compute.yaml
Normal 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
|
@ -28,6 +28,10 @@ SELINUX_ENFORCING=${SELINUX_ENFORCING:-true}
|
|||||||
# If logs should be retrieved automatically
|
# If logs should be retrieved automatically
|
||||||
COPY_LOGS=${COPY_LOGS:-true}
|
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
|
# Install external Puppet modules with r10k
|
||||||
# Uses the following variables:
|
# Uses the following variables:
|
||||||
#
|
#
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
CONTROLLER_NODE=${CONTROLLER_NODE:-}
|
||||||
|
COMPUTE_NODE=${COMPUTE_NODE:-}
|
||||||
|
|
||||||
if [ $(id -u) != 0 ]; then
|
if [ $(id -u) != 0 ]; then
|
||||||
SUDO='sudo'
|
SUDO='sudo'
|
||||||
fi
|
fi
|
||||||
@ -14,8 +17,14 @@ echo -e "Generating packstack config for:
|
|||||||
echo "tempest will run if packstack's installation completes successfully."
|
echo "tempest will run if packstack's installation completes successfully."
|
||||||
echo
|
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} \
|
$SUDO packstack ${ADDITIONAL_ARGS} \
|
||||||
--allinone \
|
${NODE_FLAGS} \
|
||||||
--cinder-volume-name="aVolume" \
|
--cinder-volume-name="aVolume" \
|
||||||
--debug \
|
--debug \
|
||||||
--service-workers=2 \
|
--service-workers=2 \
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
CONTROLLER_NODE=${CONTROLLER_NODE:-}
|
||||||
|
COMPUTE_NODE=${COMPUTE_NODE:-}
|
||||||
|
|
||||||
if [ $(id -u) != 0 ]; then
|
if [ $(id -u) != 0 ]; then
|
||||||
SUDO='sudo'
|
SUDO='sudo'
|
||||||
fi
|
fi
|
||||||
@ -16,9 +19,16 @@ echo -e "Generating packstack config for:
|
|||||||
echo "tempest will run if packstack's installation completes successfully."
|
echo "tempest will run if packstack's installation completes successfully."
|
||||||
echo
|
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} \
|
$SUDO packstack ${ADDITIONAL_ARGS} \
|
||||||
--allinone \
|
${NODE_FLAGS} \
|
||||||
--debug \
|
--debug \
|
||||||
|
--os-debug-mode=y \
|
||||||
--service-workers=2 \
|
--service-workers=2 \
|
||||||
--default-password="packstack" \
|
--default-password="packstack" \
|
||||||
--os-aodh-install=n \
|
--os-aodh-install=n \
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
CONTROLLER_NODE=${CONTROLLER_NODE:-}
|
||||||
|
COMPUTE_NODE=${COMPUTE_NODE:-}
|
||||||
|
|
||||||
if [ $(id -u) != 0 ]; then
|
if [ $(id -u) != 0 ]; then
|
||||||
SUDO='sudo'
|
SUDO='sudo'
|
||||||
fi
|
fi
|
||||||
@ -18,9 +21,16 @@ echo -e "Generating packstack config for:
|
|||||||
echo "tempest will run if packstack's installation completes successfully."
|
echo "tempest will run if packstack's installation completes successfully."
|
||||||
echo
|
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} \
|
$SUDO packstack ${ADDITIONAL_ARGS} \
|
||||||
--allinone \
|
${NODE_FLAGS} \
|
||||||
--debug \
|
--debug \
|
||||||
|
--os-debug-mode=y \
|
||||||
--service-workers=2 \
|
--service-workers=2 \
|
||||||
--default-password="packstack" \
|
--default-password="packstack" \
|
||||||
--os-swift-install=n \
|
--os-swift-install=n \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user