Skip to content

Commit d01727f

Browse files
committed
Refactor to use Beokay
Beokay is a tool for creating production kayobe environments. It provides a clear source tree with a simple python script. This change primarily moves the source code and python virtual environments into a new ~/deployment directory, and separates each source code directory (Kayobe, Kayobe-Config, Kolla-Ansible, Tenks).
1 parent 05f0e58 commit d01727f

File tree

2 files changed

+29
-39
lines changed

2 files changed

+29
-39
lines changed

a-seed-from-nothing.sh

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,43 +96,38 @@ then
9696
sudo chown ${CLOUD_USER}.${CLOUD_USER} ${CLOUD_USER_DIR}/.ssh/authorized_keys
9797
fi
9898

99-
# Clone Kayobe.
99+
# Clone Beokay.
100100
cd $HOME
101-
[[ -d kayobe ]] || git clone https://opendev.org/openstack/kayobe.git -b stable/2023.1
102-
cd kayobe
101+
git clone https://github.com/stackhpc/beokay.git -b master
102+
103+
# Use Beokay to bootstrap your control host.
104+
[[ -d deployment ]] || beokay/beokay.py create --base-path ~/deployment --kayobe-repo https://opendev.org/openstack/kayobe.git --kayobe-branch stable/2023.1 --kayobe-config-repo https://github.com/stackhpc/a-universe-from-nothing.git --kayobe-config-branch stable/2023.1
103105

104106
# Bump the provisioning time - it can be lengthy on virtualised storage
105-
sed -i.bak 's%^[# ]*wait_active_timeout:.*% wait_active_timeout: 5000%' ~/kayobe/ansible/overcloud-provision.yml
107+
sed -i.bak 's%^[# ]*wait_active_timeout:.*% wait_active_timeout: 5000%' ~/deployment/src/kayobe/ansible/overcloud-provision.yml
106108

107109
# Clone the Tenks repository.
110+
cd ~/deployment/src/
108111
[[ -d tenks ]] || git clone https://opendev.org/openstack/tenks.git
109-
110-
# Clone this Kayobe configuration.
111-
mkdir -p config/src
112-
cd config/src/
113-
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/a-universe-from-nothing.git -b stable/2023.1 kayobe-config
112+
cd
114113

115114
# Set default registry name to the one we just created
116-
sed -i.bak 's/^docker_registry:.*/docker_registry: '$registry_ip':4000/' kayobe-config/etc/kayobe/docker.yml
115+
sed -i.bak 's/^docker_registry:.*/docker_registry: '$registry_ip':4000/' ~/deployment/src/kayobe-config/etc/kayobe/docker.yml
117116

118117
# Configure host networking (bridge, routes & firewall)
119-
./kayobe-config/configure-local-networking.sh
120-
121-
# Install kayobe.
122-
cd ~/kayobe
123-
./dev/install-dev.sh
118+
~/deployment/src/kayobe-config/configure-local-networking.sh
124119

125120
# Enable OVN flags
126121
if $ENABLE_OVN
127122
then
128-
cat <<EOF | sudo tee -a config/src/kayobe-config/etc/kayobe/bifrost.yml
123+
cat <<EOF | sudo tee -a ~/deployment/src/kayobe-config/etc/kayobe/bifrost.yml
129124
kolla_bifrost_extra_kernel_options:
130125
- "console=ttyS0"
131126
EOF
132-
cat <<EOF | sudo tee -a config/src/kayobe-config/etc/kayobe/kolla.yml
127+
cat <<EOF | sudo tee -a ~/deployment/src/kayobe-config/etc/kayobe/kolla.yml
133128
kolla_enable_ovn: yes
134129
EOF
135-
cat <<EOF | sudo tee -a config/src/kayobe-config/etc/kayobe/neutron.yml
130+
cat <<EOF | sudo tee -a ~/deployment/src/kayobe-config/etc/kayobe/neutron.yml
136131
kolla_neutron_ml2_type_drivers:
137132
- geneve
138133
- vlan
@@ -144,21 +139,24 @@ kolla_neutron_ml2_tenant_network_types:
144139
EOF
145140
fi
146141

142+
# Set Environment variables for Kayobe dev scripts
143+
export KAYOBE_CONFIG_SOURCE_PATH=~/deployment/src/kayobe-config
144+
export KAYOBE_VENV_PATH=~/deployment/venvs/kayobe
145+
147146
# Deploy hypervisor services.
148-
./dev/seed-hypervisor-deploy.sh
147+
~/deployment/src/kayobe/dev/seed-hypervisor-deploy.sh
149148

150149
# Deploy a seed VM.
151150
# NOTE: This should work the first time because the packet configuration uses a
152151
# custom docker registry. However, there are sometimes issues with Docker starting up on the seed (FIXME)
153-
if ! ./dev/seed-deploy.sh; then
152+
if ! ~/deployment/src/kayobe/dev/seed-deploy.sh; then
154153
# Deploy a seed VM. Should work this time.
155-
./dev/seed-deploy.sh
154+
~/deployment/src/kayobe/dev/seed-deploy.sh
156155
fi
157156

158157
# Run TENKS
159-
cd ~/kayobe
160-
export TENKS_CONFIG_PATH=config/src/kayobe-config/tenks.yml
161-
./dev/tenks-deploy-overcloud.sh ./tenks
158+
export TENKS_CONFIG_PATH=~/deployment/src/kayobe-config/tenks.yml
159+
~/deployment/src/kayobe/dev/tenks-deploy-overcloud.sh ~/deployment/src/tenks
162160

163161
# Duration
164162
duration=$SECONDS

a-universe-from-seed.sh

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,10 @@ SECONDS=0
88

99
# FIXME: IP on public1 subnet disappears for braio interface during the course
1010
# of a-seed-from-nothing.sh script. Rerun the configuration script to re-add it.
11-
cd ~/kayobe/config/src/
12-
./kayobe-config/configure-local-networking.sh
13-
14-
# Change to kayobe directory
15-
cd ~/kayobe
16-
17-
# Create some 'bare metal' VMs for the controller and compute node.
18-
# NOTE: Make sure to use ./tenks, since just ‘tenks’ will install via PyPI.
19-
export TENKS_CONFIG_PATH=config/src/kayobe-config/tenks.yml
20-
./dev/tenks-deploy.sh ./tenks
11+
~/deployment/src/kayobe-config/configure-local-networking.sh
2112

2213
# Activate the Kayobe environment, to allow running commands directly.
23-
source dev/environment-setup.sh
14+
source ~/deployment/env-vars.sh
2415

2516
# Inspect and provision the overcloud hardware:
2617
kayobe overcloud inventory discover
@@ -32,7 +23,7 @@ kayobe overcloud provision
3223
kayobe overcloud host configure
3324
kayobe overcloud container image pull
3425
kayobe overcloud service deploy
35-
source config/src/kayobe-config/etc/kolla/public-openrc.sh
26+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
3627
kayobe overcloud post configure
3728

3829
# At this point it should be possible to access the Horizon GUI via the seed
@@ -49,12 +40,13 @@ kayobe overcloud host command run --command "iptables -P FORWARD ACCEPT" --becom
4940

5041
# The following script will register some resources in OpenStack to enable
5142
# booting up a tenant VM.
52-
source config/src/kayobe-config/etc/kolla/public-openrc.sh
53-
./config/src/kayobe-config/init-runonce.sh
43+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
44+
~/deployment/src/kayobe-config/init-runonce.sh
5445

5546
# Following the instructions displayed by the above script, boot a VM.
5647
# You'll need to have activated the ~/os-venv virtual environment.
57-
source ~/os-venv/bin/activate
48+
deactivate
49+
source ~/deployment/venvs/os-venv/bin/activate
5850
openstack server create --image cirros --flavor m1.tiny --key-name mykey --network demo-net demo1
5951

6052
# Assign a floating IP to the server to make it accessible.

0 commit comments

Comments
 (0)