Skip to content

Commit

Permalink
Add Tempest option to AIO script and improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed May 20, 2024
1 parent b83e6c6 commit 3aab17c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
23 changes: 15 additions & 8 deletions doc/source/contributor/environments/ci-aio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,21 @@ Run the setup script:
./automated-setup.sh
The script will pull the current version of Kayobe and this repository, and
then run the manual setup steps below. The script can be easily edited to use a
different branch of Kayobe or this repository. The script will assume that your
image is LVM-based and will expand the volume sizes to allow ansible
dependencies to install correctly. If it is not, set ``KAYOBE_AIO_LVM`` to
false.

The deployment can be paused after cloning your Kayobe configuration to allow
for custom edits, by setting ``KAYOBE_CONFIG_EDIT_PAUSE`` to ``true``.
then run the manual setup steps below. The script can be easily edited with the
following options:

* ``BASE_PATH`` (default: ``~``) - Directory to deploy from. The directory must
exist before running the script.
* ``KAYOBE_BRANCH`` (default: ``stackhpc/2023.1``) - The branch of Kayobe
source code to use.
* ``KAYOBE_CONFIG_BRANCH`` (default: ``stackhpc/2023.1``) - The branch of
``stackhpc-kayobe-config`` to use.
* ``KAYOBE_AIO_LVM`` (default: ``true``) - Whether the image uses LVM.
* ``KAYOBE_CONFIG_EDIT_PAUSE`` (default: ``false``) - Option to pause
deployment after cloning the kayobe-config branch, so the environment can be
customised before continuing.
* ``AIO_RUN_TEMPEST`` (default: ``false``) - Whether to run Tempest Refstack
after deployment instead of the default VM smoke test.

Manual Setup
============
Expand Down
24 changes: 20 additions & 4 deletions etc/kayobe/environments/ci-aio/automated-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ KAYOBE_BRANCH=stackhpc/2023.1
KAYOBE_CONFIG_BRANCH=stackhpc/2023.1
KAYOBE_AIO_LVM=true
KAYOBE_CONFIG_EDIT_PAUSE=false
AIO_RUN_TEMPEST=false

if [[ ! -f $BASE_PATH/vault-pw ]]; then
echo "Vault password file not found at $BASE_PATH/vault-pw"
Expand Down Expand Up @@ -95,7 +96,22 @@ kayobe overcloud host configure

kayobe overcloud service deploy

export KAYOBE_CONFIG_SOURCE_PATH=$BASE_PATH/src/kayobe-config
export KAYOBE_VENV_PATH=$BASE_PATH/venvs/kayobe
pushd $BASE_PATH/src/kayobe
./dev/overcloud-test-vm.sh
if $AIO_RUN_TEMPEST; then
pushd $BASE_PATH/src/kayobe-config
git submodule init
git submodule update
sudo DOCKER_BUILDKIT=1 docker build --build-arg BASE_IMAGE=rockylinux:9 --file .automation/docker/kayobe/Dockerfile --tag kayobe:latest --network host .
export KAYOBE_AUTOMATION_SSH_PRIVATE_KEY=$(cat ~/.ssh/id_rsa)
mkdir -p tempest-artifacts
sudo -E docker run --name kayobe-automation --detach -it --rm --network host \
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config -v $(pwd)/tempest-artifacts:/stack/tempest-artifacts \
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY kayobe:latest \
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/tempest.sh -e ansible_user=stack
sleep 300
sudo docker logs -f tempest
else
export KAYOBE_CONFIG_SOURCE_PATH=$BASE_PATH/src/kayobe-config
export KAYOBE_VENV_PATH=$BASE_PATH/venvs/kayobe
pushd $BASE_PATH/src/kayobe
./dev/overcloud-test-vm.sh
fi

0 comments on commit 3aab17c

Please sign in to comment.