Skip to content

Commit

Permalink
Merge pull request #1078 from stackhpc/aio-improvements
Browse files Browse the repository at this point in the history
AIO Improvements
  • Loading branch information
Alex-Welsh authored May 20, 2024
2 parents 6e71ff1 + 3aab17c commit afd30cc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
24 changes: 15 additions & 9 deletions doc/source/contributor/environments/ci-aio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ automates the manual setup steps below, and is recommended for most users.
The manual setup steps are provided for reference, and for users who wish to
make changes to the setup process.

.. warning::

This guide was written for the Yoga release and has not been validated for
Antelope. Proceed with caution.

Prerequisites
=============

Expand Down Expand Up @@ -48,10 +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 automatically
determine whether your image is LVM based, if so, it will expand the volume sizes
to allow ansible dependencies to install correctly.
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
31 changes: 27 additions & 4 deletions etc/kayobe/environments/ci-aio/automated-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ BASE_PATH=~
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 @@ -40,6 +42,12 @@ pushd src
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/stackhpc-kayobe-config kayobe-config -b $KAYOBE_CONFIG_BRANCH
popd

if $KAYOBE_CONFIG_EDIT_PAUSE; then
echo "Deployment is paused, edit configuration in another terminal"
echo "Press enter to continue"
read -s
fi

if ! sudo vgdisplay | grep -q lvm2; then
rm $BASE_PATH/src/kayobe-config/etc/kayobe/environments/ci-aio/inventory/group_vars/controllers/lvm.yml
sed -i -e '/controller_lvm_groups/,+2d' $BASE_PATH/src/kayobe-config/etc/kayobe/environments/ci-aio/controllers.yml
Expand Down Expand Up @@ -88,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 afd30cc

Please sign in to comment.