Skip to content

Commit 65c9d4d

Browse files
committed
Add automated AIO setup script
1 parent 1efb9ec commit 65c9d4d

File tree

3 files changed

+120
-5
lines changed

3 files changed

+120
-5
lines changed

doc/source/contributor/environments/ci-aio.rst

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,52 @@ ci-aio
55
This environment deploys an all-in-one converged control/compute cloud for
66
testing.
77

8+
There are two ways to set up the environment. The automated setup script
9+
automates the manual setup steps below, and is recommended for most users.
10+
The manual setup steps are provided for reference, and for users who wish to
11+
make changes to the setup process.
12+
813
Prerequisites
914
=============
1015

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

14-
Setup
15-
=====
19+
Automated Setup
20+
===============
21+
22+
Access the host via SSH.
23+
24+
Download the setup script:
25+
26+
.. parsed-literal::
27+
28+
wget https://raw.githubusercontent.com/stackhpc/stackhpc-kayobe-config/stackhpc/yoga/etc/kayobe/environments/ci-aio/automated-setup.sh
29+
30+
Change the permissions on the script:
31+
32+
.. parsed-literal::
33+
34+
sudo chmod 700 automated-setup.sh
35+
36+
Acquire the Ansible Vault password for this repository, and store a
37+
copy at ``~/vault-pw``.
38+
39+
Run the setup script:
40+
41+
.. parsed-literal::
42+
43+
./automated-setup.sh
44+
45+
The script will pull the current version of Kayobe and this repository, and
46+
then run the manual setup steps below. The script can be easily edited to use
47+
a different branch of Kayobe or this repository.
48+
49+
Manual Setup
50+
============
51+
52+
Host Configuration
53+
------------------
1654

1755
Access the host via SSH.
1856

@@ -67,7 +105,7 @@ Add initial network configuration:
67105
sudo ip l set dummy1 master breth1
68106
69107
Installation
70-
============
108+
------------
71109

72110
Acquire the Ansible Vault password for this repository, and store a copy at
73111
``~/vault-pw``.
@@ -86,7 +124,7 @@ Ansible control host.
86124
kayobe control host bootstrap
87125
88126
Deployment
89-
==========
127+
----------
90128

91129
Next, configure the host OS & services.
92130

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

105143
Testing
106-
=======
144+
-------
107145

108146
Run a smoke test:
109147

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
cat << EOF | sudo tee -a /etc/hosts
6+
10.205.3.187 pulp-server pulp-server.internal.sms-cloud
7+
EOF
8+
9+
BASE_PATH=~
10+
KAYOBE_BRANCH=stackhpc/yoga
11+
KAYOBE_CONFIG_BRANCH=stackhpc/yoga
12+
13+
if [[ ! -f $BASE_PATH/vault-pw ]]; then
14+
echo "Vault password file not found at $BASE_PATH/vault-pw"
15+
exit 1
16+
fi
17+
18+
if type dnf; then
19+
sudo dnf -y install git python3-virtualenv
20+
else
21+
sudo apt update
22+
sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-virtualenv
23+
fi
24+
25+
cd $BASE_PATH
26+
mkdir -p src
27+
pushd src
28+
[[ -d kayobe ]] || git clone https://github.com/stackhpc/kayobe.git -b $KAYOBE_BRANCH
29+
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/stackhpc-kayobe-config kayobe-config -b $KAYOBE_CONFIG_BRANCH
30+
popd
31+
32+
mkdir -p venvs
33+
pushd venvs
34+
if [[ ! -d kayobe ]]; then
35+
virtualenv kayobe
36+
fi
37+
# NOTE: Virtualenv's activate and deactivate scripts reference an
38+
# unbound variable.
39+
set +u
40+
source kayobe/bin/activate
41+
set -u
42+
pip install -U pip
43+
pip install ../src/kayobe
44+
popd
45+
46+
if ! ip l show breth1 >/dev/null 2>&1; then
47+
sudo ip l add breth1 type bridge
48+
fi
49+
sudo ip l set breth1 up
50+
if ! ip a show breth1 | grep 192.168.33.3/24; then
51+
sudo ip a add 192.168.33.3/24 dev breth1
52+
fi
53+
if ! ip l show dummy1 >/dev/null 2>&1; then
54+
sudo ip l add dummy1 type dummy
55+
fi
56+
sudo ip l set dummy1 up
57+
sudo ip l set dummy1 master breth1
58+
59+
export KAYOBE_VAULT_PASSWORD=$(cat $BASE_PATH/vault-pw)
60+
pushd $BASE_PATH/src/kayobe-config
61+
source kayobe-env --environment ci-aio
62+
63+
kayobe control host bootstrap
64+
65+
kayobe overcloud host configure
66+
67+
kayobe overcloud service deploy
68+
69+
export KAYOBE_CONFIG_SOURCE_PATH=$BASE_PATH/src/kayobe-config
70+
export KAYOBE_VENV_PATH=$BASE_PATH/venvs/kayobe
71+
pushd $BASE_PATH/src/kayobe
72+
./dev/overcloud-test-vm.sh
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
features:
3+
- |
4+
Added a script to the AIO environment that can be used to quickly
5+
deploy an AIO for testing.

0 commit comments

Comments
 (0)