Skip to content

Add automated AIO setup script #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions doc/source/contributor/environments/ci-aio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,52 @@ ci-aio
This environment deploys an all-in-one converged control/compute cloud for
testing.

There are two ways to set up the environment. The automated setup script
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.

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

* a CentOS Stream 8 or Ubuntu Focal 20.04 host
* access to the Test Pulp server on SMS lab

Setup
=====
Automated Setup
===============

Access the host via SSH.

Download the setup script:

.. parsed-literal::

wget https://raw.githubusercontent.com/stackhpc/stackhpc-kayobe-config/stackhpc/yoga/etc/kayobe/environments/ci-aio/automated-setup.sh

Change the permissions on the script:

.. parsed-literal::

sudo chmod 700 automated-setup.sh

Acquire the Ansible Vault password for this repository, and store a
copy at ``~/vault-pw``.

Run the setup script:

.. parsed-literal::

./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.

Manual Setup
============

Host Configuration
------------------

Access the host via SSH.

Expand Down Expand Up @@ -67,7 +105,7 @@ Add initial network configuration:
sudo ip l set dummy1 master breth1

Installation
============
------------

Acquire the Ansible Vault password for this repository, and store a copy at
``~/vault-pw``.
Expand All @@ -86,7 +124,7 @@ Ansible control host.
kayobe control host bootstrap

Deployment
==========
----------

Next, configure the host OS & services.

Expand All @@ -103,7 +141,7 @@ Finally, deploy the overcloud services.
The control plane should now be running.

Testing
=======
-------

Run a smoke test:

Expand Down
72 changes: 72 additions & 0 deletions etc/kayobe/environments/ci-aio/automated-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

set -eux

cat << EOF | sudo tee -a /etc/hosts
10.205.3.187 pulp-server pulp-server.internal.sms-cloud
EOF

BASE_PATH=~
KAYOBE_BRANCH=stackhpc/yoga
KAYOBE_CONFIG_BRANCH=stackhpc/yoga

if [[ ! -f $BASE_PATH/vault-pw ]]; then
echo "Vault password file not found at $BASE_PATH/vault-pw"
exit 1
fi

if type dnf; then
sudo dnf -y install git python3-virtualenv
else
sudo apt update
sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-virtualenv
fi

cd $BASE_PATH
mkdir -p src
pushd src
[[ -d kayobe ]] || git clone https://github.com/stackhpc/kayobe.git -b $KAYOBE_BRANCH
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/stackhpc-kayobe-config kayobe-config -b $KAYOBE_CONFIG_BRANCH
popd

mkdir -p venvs
pushd venvs
if [[ ! -d kayobe ]]; then
virtualenv kayobe
fi
# NOTE: Virtualenv's activate and deactivate scripts reference an
# unbound variable.
set +u
source kayobe/bin/activate
set -u
pip install -U pip
pip install ../src/kayobe
popd

if ! ip l show breth1 >/dev/null 2>&1; then
sudo ip l add breth1 type bridge
fi
sudo ip l set breth1 up
if ! ip a show breth1 | grep 192.168.33.3/24; then
sudo ip a add 192.168.33.3/24 dev breth1
fi
if ! ip l show dummy1 >/dev/null 2>&1; then
sudo ip l add dummy1 type dummy
fi
sudo ip l set dummy1 up
sudo ip l set dummy1 master breth1

export KAYOBE_VAULT_PASSWORD=$(cat $BASE_PATH/vault-pw)
pushd $BASE_PATH/src/kayobe-config
source kayobe-env --environment ci-aio

kayobe control host bootstrap

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
5 changes: 5 additions & 0 deletions releasenotes/notes/aio-script-8221b9dcbcc40c55.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
features:
- |
Added a script to the AIO environment that can be used to quickly
deploy an AIO for testing.