Skip to content
Snippets Groups Projects
Commit 0d598bf0 authored by Isaac Prior's avatar Isaac Prior
Browse files

Add alternative tenks deploy and teardown entrypoints.

Allows users to explicitly specify which type of tenks
deployment they wish to create / destroy.
Preserves existing behaviour with defaults.
Modifies Zuul tests to use new tenks-deploy entrypoints.

Change-Id: I9aafed8481fd7564c0fc0abe5f6b21eceb824d75
parent 17d63c8b
No related branches found
No related tags found
No related merge requests found
...@@ -431,17 +431,35 @@ function run_tenks_playbook { ...@@ -431,17 +431,35 @@ function run_tenks_playbook {
# $2: The name of the playbook to run. # $2: The name of the playbook to run.
local tenks_path="$1" local tenks_path="$1"
local tenks_playbook="$2" local tenks_playbook="$2"
local tenks_deploy_type="${3:-default}"
local parent="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" local parent="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "${KOLLA_CONFIG_PATH:-/etc/kolla}/admin-openrc.sh" ]]; then if [[ ! -f "${KOLLA_CONFIG_PATH:-/etc/kolla}/admin-openrc.sh" &&
# Overcloud "${tenks_deploy_type}" = "compute" ]]; then
die $LINENO "Missing admin-openrc.sh & tenks_deploy_type is compute."
exit 1
fi
if [[ -f "${KOLLA_CONFIG_PATH:-/etc/kolla}/admin-openrc.sh" &&
( "${tenks_deploy_type}" = "default" ||
"${tenks_deploy_type}" = "compute" ) ]]; then
# Deploys Compute from Overcloud
default_tenks_config=tenks-deploy-config-compute.yml default_tenks_config=tenks-deploy-config-compute.yml
source "${KOLLA_CONFIG_PATH:-/etc/kolla}/admin-openrc.sh" source "${KOLLA_CONFIG_PATH:-/etc/kolla}/admin-openrc.sh"
else
# Seed elif [[ "${tenks_deploy_type}" = "default" ||
"${tenks_deploy_type}" = "overcloud" ]]; then
# Deploys Overcloud from Seed
default_tenks_config=tenks-deploy-config-overcloud.yml default_tenks_config=tenks-deploy-config-overcloud.yml
write_bifrost_clouds_yaml write_bifrost_clouds_yaml
export OS_CLOUD=bifrost export OS_CLOUD=bifrost
else
die $LINENO "Bad tenks_deploy_type: ${tenks_deploy_type}"
exit 1
fi fi
# Allow a specific Tenks config file to be specified via # Allow a specific Tenks config file to be specified via
...@@ -461,6 +479,7 @@ function tenks_deploy { ...@@ -461,6 +479,7 @@ function tenks_deploy {
# 'breth1' exists. Arguments: # 'breth1' exists. Arguments:
# $1: The path to the Tenks repo. # $1: The path to the Tenks repo.
local tenks_path="$1" local tenks_path="$1"
local tenks_deploy_type="${2:-default}"
echo "Configuring Tenks" echo "Configuring Tenks"
...@@ -483,7 +502,7 @@ function tenks_deploy { ...@@ -483,7 +502,7 @@ function tenks_deploy {
# vSwitch. # vSwitch.
sudo cp --no-clobber "$parent/ovs-vsctl" /usr/bin/ovs-vsctl sudo cp --no-clobber "$parent/ovs-vsctl" /usr/bin/ovs-vsctl
run_tenks_playbook "$tenks_path" deploy.yml run_tenks_playbook "$tenks_path" deploy.yml "$tenks_deploy_type"
} }
function tenks_teardown { function tenks_teardown {
...@@ -492,6 +511,7 @@ function tenks_teardown { ...@@ -492,6 +511,7 @@ function tenks_teardown {
# Arguments: # Arguments:
# $1: The path to the Tenks repo. # $1: The path to the Tenks repo.
local tenks_path="$1" local tenks_path="$1"
local tenks_deploy_type="${2:-default}"
echo "Tearing down Tenks" echo "Tearing down Tenks"
...@@ -503,7 +523,7 @@ function tenks_teardown { ...@@ -503,7 +523,7 @@ function tenks_teardown {
# Source the Tenks venv. # Source the Tenks venv.
source ${TENKS_VENV_PATH:-$HOME/tenks-test-venv}/bin/activate source ${TENKS_VENV_PATH:-$HOME/tenks-test-venv}/bin/activate
run_tenks_playbook "$tenks_path" teardown.yml run_tenks_playbook "$tenks_path" teardown.yml "$tenks_deploy_type"
} }
# General purpose # General purpose
......
#!/bin/bash
set -eu
set -o pipefail
# Simple script to configure and deploy a Tenks cluster. This should be
# executed from within the VM. Arguments:
# $1: The path to the Tenks repo.
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${PARENT}/functions"
function main {
if [ -z ${1+x} ]; then
echo "Usage: $0 <tenks repo path>"
return 1
fi
tenks_path="$1"
config_init
tenks_deploy "$tenks_path" compute
}
main "$@"
#!/bin/bash
set -eu
set -o pipefail
# Simple script to configure and deploy a Tenks cluster. This should be
# executed from within the VM. Arguments:
# $1: The path to the Tenks repo.
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${PARENT}/functions"
function main {
if [ -z ${1+x} ]; then
echo "Usage: $0 <tenks repo path>"
return 1
fi
tenks_path="$1"
config_init
tenks_deploy "$tenks_path" overcloud
}
main "$@"
#!/bin/bash
set -eu
set -o pipefail
# Simple script to teardown a Tenks cluster. This should be executed from
# within the VM. Arguments:
# $1: The path to the Tenks repo.
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${PARENT}/functions"
function main {
if [ -z ${1+x} ]; then
echo "Usage: $0 <tenks repo path>"
return 1
fi
tenks_path="$1"
config_init
tenks_teardown "$tenks_path" compute
}
main "$@"
#!/bin/bash
set -eu
set -o pipefail
# Simple script to teardown a Tenks cluster. This should be executed from
# within the VM. Arguments:
# $1: The path to the Tenks repo.
PARENT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${PARENT}/functions"
function main {
if [ -z ${1+x} ]; then
echo "Usage: $0 <tenks repo path>"
return 1
fi
tenks_path="$1"
config_init
tenks_teardown "$tenks_path" overcloud
}
main "$@"
...@@ -131,9 +131,9 @@ Clone the tenks repository:: ...@@ -131,9 +131,9 @@ Clone the tenks repository::
Optionally, edit the Tenks configuration file, Optionally, edit the Tenks configuration file,
``dev/tenks-deploy-config-compute.yml``. ``dev/tenks-deploy-config-compute.yml``.
Run the ``dev/tenks-deploy.sh`` script to deploy Tenks:: Run the ``dev/tenks-deploy-compute.sh`` script to deploy Tenks::
./dev/tenks-deploy.sh ./tenks ./dev/tenks-deploy-compute.sh ./tenks
Check that Tenks has created VMs called ``tk0`` and ``tk1``:: Check that Tenks has created VMs called ``tk0`` and ``tk1``::
...@@ -151,9 +151,9 @@ server instance, and delete it once it becomes active:: ...@@ -151,9 +151,9 @@ server instance, and delete it once it becomes active::
./dev/overcloud-test-baremetal.sh ./dev/overcloud-test-baremetal.sh
The machines and networking created by Tenks can be cleaned up via The machines and networking created by Tenks can be cleaned up via
``dev/tenks-teardown.sh``:: ``dev/tenks-teardown-compute.sh``::
./dev/tenks-teardown.sh ./tenks ./dev/tenks-teardown-compute.sh ./tenks
Upgrading Upgrading
--------- ---------
...@@ -233,9 +233,9 @@ Clone the tenks repository:: ...@@ -233,9 +233,9 @@ Clone the tenks repository::
Optionally, edit the Tenks configuration file, Optionally, edit the Tenks configuration file,
``dev/tenks-deploy-config-overcloud.yml``. ``dev/tenks-deploy-config-overcloud.yml``.
Run the ``dev/tenks-deploy.sh`` script to deploy Tenks:: Run the ``dev/tenks-deploy-overcloud.sh`` script to deploy Tenks::
./dev/tenks-deploy.sh ./tenks ./dev/tenks-deploy-overcloud.sh ./tenks
Check that Tenks has created a VM called ``controller0``:: Check that Tenks has created a VM called ``controller0``::
...@@ -246,9 +246,9 @@ Verify that VirtualBMC is running:: ...@@ -246,9 +246,9 @@ Verify that VirtualBMC is running::
~/tenks-venv/bin/vbmc list ~/tenks-venv/bin/vbmc list
The machines and networking created by Tenks can be cleaned up via The machines and networking created by Tenks can be cleaned up via
``dev/tenks-teardown.sh``:: ``dev/tenks-teardown-overcloud.sh``::
./dev/tenks-teardown.sh ./tenks ./dev/tenks-teardown-overcloud.sh ./tenks
.. _development-automated-seed-hypervisor: .. _development-automated-seed-hypervisor:
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
shell: shell:
# Pass absolute source directory, since otherwise the `chdir` will # Pass absolute source directory, since otherwise the `chdir` will
# cause this to fail. # cause this to fail.
cmd: dev/tenks-deploy.sh '{{ tenks_src_dir }}' > {{ logs_dir }}/ansible/tenks-deploy cmd: dev/tenks-deploy-compute.sh '{{ tenks_src_dir }}' > {{ logs_dir }}/ansible/tenks-deploy
chdir: "{{ kayobe_src_dir }}" chdir: "{{ kayobe_src_dir }}"
- name: Perform testing of the virtualized machines - name: Perform testing of the virtualized machines
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
- name: Ensure test Tenks cluster is deployed - name: Ensure test Tenks cluster is deployed
shell: shell:
# Pass absolute source directory, since otherwise the `chdir` will # Pass absolute source directory, since otherwise the `chdir` will
# cause this to fail. Don't use previous_kayobe_source_dir as tenks-deploy.sh # cause this to fail. Don't use previous_kayobe_source_dir as
# does not exist there. # tenks-deploy-compute.sh does not exist there.
cmd: dev/tenks-deploy.sh '{{ tenks_src_dir }}' > {{ logs_dir }}/ansible/tenks-deploy cmd: dev/tenks-deploy-compute.sh '{{ tenks_src_dir }}' > {{ logs_dir }}/ansible/tenks-deploy
chdir: "{{ kayobe_src_dir }}" chdir: "{{ kayobe_src_dir }}"
environment: environment:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment