Skip to content

Commit eb480bd

Browse files
authored
Merge pull request #174 from stackhpc/beokay-refactor-master
Beokay refactor master
2 parents 4c444f9 + fbbf29a commit eb480bd

File tree

6 files changed

+77
-89
lines changed

6 files changed

+77
-89
lines changed

README.rst

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,19 @@ already logged in (e.g. ``ssh rocky@<ip>``, or ``ssh ubuntu@<ip>``).
105105
# Start at home.
106106
cd
107107
108-
# Clone Kayobe.
109-
git clone https://opendev.org/openstack/kayobe.git -b master
110-
cd kayobe
108+
# Clone Beokay.
109+
git clone https://github.com/stackhpc/beokay.git -b master
111110
112-
# Clone the Tenks repository.
113-
git clone https://opendev.org/openstack/tenks.git
111+
# Use Beokay to bootstrap your control host.
112+
[[ -d deployment ]] || beokay/beokay.py create --base-path ~/deployment --kayobe-repo https://opendev.org/openstack/kayobe.git --kayobe-branch master --kayobe-config-repo https://github.com/stackhpc/a-universe-from-nothing.git --kayobe-config-branch master
114113
115-
# Clone this Kayobe configuration.
116-
mkdir -p config/src
117-
cd config/src/
118-
git clone https://github.com/stackhpc/a-universe-from-nothing.git kayobe-config -b master
114+
# Clone the Tenks repository.
115+
cd ~/deployment/src
116+
[[ -d tenks ]] || git clone https://opendev.org/openstack/tenks.git
117+
cd
119118
120119
# Configure host networking (bridge, routes & firewall)
121-
./kayobe-config/configure-local-networking.sh
122-
123-
# Install kayobe.
124-
cd ~/kayobe
125-
./dev/install-dev.sh
120+
~/deployment/src/kayobe-config/configure-local-networking.sh
126121
127122
Deploying a Seed
128123
----------------
@@ -134,14 +129,9 @@ performed the necessary `Preparation`_.
134129

135130
.. code-block:: console
136131
137-
cd ~/kayobe
138-
139-
# Activate the Kayobe environment, to allow running commands directly.
140-
source ~/kayobe-venv/bin/activate
141-
source config/src/kayobe-config/kayobe-env
142-
143-
# Bootstrap the Ansible control host.
144-
kayobe control host bootstrap
132+
# If you have not done so already, activate the Kayobe environment, to allow
133+
# running commands directly.
134+
source ~/deployment/env-vars.sh
145135
146136
# Configure the seed hypervisor host.
147137
kayobe seed hypervisor host configure
@@ -153,14 +143,14 @@ performed the necessary `Preparation`_.
153143
kayobe seed host configure
154144
155145
# Pull, retag images, then push to our local registry.
156-
./config/src/kayobe-config/pull-retag-push-images.sh
146+
~/deployment/src/kayobe-config/pull-retag-push-images.sh
157147
158148
# Deploy the seed services.
159149
kayobe seed service deploy
160150
161151
# Deploying the seed restarts networking interface,
162152
# run configure-local-networking.sh again to re-add routes.
163-
./config/src/kayobe-config/configure-local-networking.sh
153+
~/deployment/src/kayobe-config/configure-local-networking.sh
164154
165155
# Optional: Shutdown the seed VM if creating a seed snapshot.
166156
sudo virsh shutdown seed
@@ -192,11 +182,8 @@ Otherwise, continue working with the instance from `Deploying a Seed`_.
192182
# Optional: start a new tmux session in case we lose our connection.
193183
tmux
194184
195-
# Set working directory
196-
cd ~/kayobe
197-
198185
# Configure non-persistent networking, if the node has rebooted.
199-
./config/src/kayobe-config/configure-local-networking.sh
186+
~/deployment/src/kayobe-config/configure-local-networking.sh
200187
201188
Make sure that the seed VM (running Bifrost and supporting services)
202189
is present and running.
@@ -215,12 +202,16 @@ our model development environment, alongside the seed VM.
215202

216203
.. code-block:: console
217204
218-
# NOTE: Make sure to use ./tenks, since just ‘tenks’ will install via PyPI.
219-
export TENKS_CONFIG_PATH=config/src/kayobe-config/tenks.yml
220-
./dev/tenks-deploy-overcloud.sh ./tenks
205+
# Set Environment variables for Kayobe dev scripts
206+
export KAYOBE_CONFIG_SOURCE_PATH=~/deployment/src/kayobe-config
207+
export KAYOBE_VENV_PATH=~/deployment/venvs/kayobe
208+
export TENKS_CONFIG_PATH=~/deployment/src/kayobe-config/tenks.yml
209+
210+
# Use tenks to deploy the overcloud machines
211+
~/deployment/src/kayobe/dev/tenks-deploy-overcloud.sh ~/deployment/src/tenks
221212
222213
# Activate the Kayobe environment, to allow running commands directly.
223-
source dev/environment-setup.sh
214+
source ~/deployment/env-vars.sh
224215
225216
# Inspect and provision the overcloud hardware:
226217
kayobe overcloud inventory discover
@@ -236,7 +227,7 @@ Configure and deploy OpenStack to the control plane
236227
kayobe overcloud host configure
237228
kayobe overcloud container image pull
238229
kayobe overcloud service deploy
239-
source config/src/kayobe-config/etc/kolla/public-openrc.sh
230+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
240231
kayobe overcloud post configure
241232
242233
At this point it should be possible to access the Horizon GUI via the
@@ -250,15 +241,15 @@ VM:
250241

251242
.. code-block:: console
252243
253-
source config/src/kayobe-config/etc/kolla/public-openrc.sh
254-
./config/src/kayobe-config/init-runonce.sh
244+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
245+
~/deployment/src/kayobe-config/init-runonce.sh
255246
256247
Following the instructions displayed by the above script, boot a VM.
257-
You'll need to have activated the `~/os-venv` virtual environment.
248+
You'll need to have activated the `~/deployment/venvs/os-venv` virtual environment.
258249

259250
.. code-block:: console
260251
261-
source ~/os-venv/bin/activate
252+
source ~/deployment/venvs/os-venv/bin/activate
262253
openstack server create --image cirros \
263254
--flavor m1.tiny \
264255
--key-name mykey \
@@ -274,7 +265,7 @@ You'll need to have activated the `~/os-venv` virtual environment.
274265
275266
# If the ssh command above fails you may need to reconfigure the local
276267
networking setup again:
277-
~/kayobe/config/src/kayobe-config/configure-local-networking.sh
268+
~/deployment/src/kayobe-config/configure-local-networking.sh
278269
279270
*Note*: when accessing the VNC console of an instance via Horizon,
280271
you will be sent to the internal IP address of the controller,
@@ -386,7 +377,7 @@ all OpenStack service logging. **Be cautious as OpenSearch will consume a
386377
significant portion of available resources on a standard deployment.**
387378

388379
To enable the service, one flag must be changed in
389-
``~/kayobe/config/src/kayobe-config/etc/kayobe/kolla.yml``:
380+
``~/deployment/src/kayobe-config/etc/kayobe/kolla.yml``:
390381

391382
.. code-block:: diff
392383
@@ -402,7 +393,7 @@ the seed VM. Pull, retag and push the centralised logging images:
402393

403394
.. code-block:: console
404395
405-
~/kayobe/config/src/kayobe-config/pull-retag-push-images.sh ^opensearch
396+
~/deployment/src/kayobe-config/pull-retag-push-images.sh ^opensearch
406397
407398
To deploy the logging stack:
408399

@@ -433,7 +424,7 @@ public interface to the OpenSearch Dashboards service running on our
433424
``controller0`` VM.
434425

435426
The easiest way to do this is to add OpenSearch Dashboards's default port (5601) to our
436-
``configure-local-networking.sh`` script in ``~/kayobe/config/src/kayobe-config/``:
427+
``configure-local-networking.sh`` script in ``~/deployment/src/kayobe-config/``:
437428

438429
.. code-block:: diff
439430
@@ -450,7 +441,7 @@ Then rerun the script to apply the change:
450441

451442
.. code-block:: console
452443
453-
config/src/kayobe-config/configure-local-networking.sh
444+
~/deployment/src/kayobe-config/configure-local-networking.sh
454445
455446
We can now connect to OpenSearch Dashboards using our hypervisor host public IP and port 5601.
456447

@@ -460,7 +451,7 @@ but they are not here).
460451

461452
.. code-block:: console
462453
463-
grep opensearch_dashboards config/src/kayobe-config/etc/kolla/passwords.yml
454+
grep opensearch_dashboards ~/deployment/src/kayobe-config/etc/kolla/passwords.yml
464455
465456
Once you're in, OpenSearch Dashboards needs some further setup which is not automated.
466457
Set the log index to ``flog-*`` and you should be ready to go.
@@ -473,7 +464,7 @@ secret management service. It is an example of a simple service we
473464
can use to illustrate the process of adding new services to our deployment.
474465

475466
As with the Logging service above, enable Barbican by modifying the flag in
476-
``~/kayobe/config/src/kayobe-config/etc/kayobe/kolla.yml`` as follows:
467+
``~/deployment/src/kayobe-config/etc/kayobe/kolla.yml`` as follows:
477468

478469
.. code-block:: diff
479470
@@ -485,15 +476,14 @@ containers. Pull down barbican images:
485476

486477
.. code-block:: console
487478
488-
~/kayobe/config/src/kayobe-config/pull-retag-push-images.sh barbican
479+
~/deployment/src/kayobe-config/pull-retag-push-images.sh barbican
489480
490481
To deploy the Barbican service:
491482

492483
.. code-block:: console
493484
494485
# Activate the venv if not already active
495-
cd ~/kayobe
496-
source dev/environment-setup.sh
486+
source ~/deployment/env-vars.sh
497487
498488
kayobe overcloud container image pull
499489
kayobe overcloud service deploy
@@ -508,13 +498,13 @@ OpenStack venv:
508498
deactivate
509499
510500
# Activate the OpenStack venv
511-
. ~/os-venv/bin/activate
501+
~/deployment/venvs/os-venv/bin/activate
512502
513503
# Install barbicanclient
514504
pip install python-barbicanclient -c https://releases.openstack.org/constraints/upper/master
515505
516506
# Source the OpenStack environment variables
517-
source ~/kayobe/config/src/kayobe-config/etc/kolla/public-openrc.sh
507+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
518508
519509
# Store a test secret
520510
openstack secret store --name mysecret --payload foo=bar

a-universe-from-nothing.sh

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,21 @@ echo 'Defaults !fqdn' | sudo tee /etc/sudoers.d/no-fqdn
2828
# Start at home.
2929
cd
3030

31-
# Clone Kayobe.
32-
[[ -d kayobe ]] || git clone https://opendev.org/openstack/kayobe.git -b master
33-
cd kayobe
31+
# Clone Beokay.
32+
[[ -d beokay ]] || git clone https://github.com/stackhpc/beokay.git -b master
33+
34+
# Use Beokay to bootstrap your control host.
35+
[[ -d deployment ]] || beokay/beokay.py create --base-path ~/deployment --kayobe-repo https://opendev.org/openstack/kayobe.git --kayobe-branch master --kayobe-config-repo https://github.com/stackhpc/a-universe-from-nothing.git --kayobe-config-branch master
3436

3537
# Clone the Tenks repository.
38+
cd ~/deployment/src
3639
[[ -d tenks ]] || git clone https://opendev.org/openstack/tenks.git
3740

38-
# Clone this Kayobe configuration.
39-
mkdir -p config/src
40-
cd config/src/
41-
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/a-universe-from-nothing.git -b master kayobe-config
42-
4341
# Configure host networking (bridge, routes & firewall)
4442
./kayobe-config/configure-local-networking.sh
4543

46-
# Install kayobe.
47-
cd ~/kayobe
48-
./dev/install-dev.sh
49-
50-
# Activate the Kayobe environment, to allow running commands directly.
51-
# NOTE: Virtualenv's activate script references an unbound variable.
52-
set +u
53-
source ~/kayobe-venv/bin/activate
54-
set -u
55-
source config/src/kayobe-config/kayobe-env
56-
57-
# Bootstrap the Ansible control host.
58-
kayobe control host bootstrap
44+
# Use the kayobe virtual environment, and export kayobe environment variables
45+
source ~/deployment/env-vars.sh
5946

6047
# Configure the seed hypervisor host.
6148
kayobe seed hypervisor host configure
@@ -67,18 +54,22 @@ kayobe seed vm provision
6754
kayobe seed host configure
6855

6956
# Pull, retag images, then push to our local registry.
70-
./config/src/kayobe-config/pull-retag-push-images.sh
57+
~/deployment/src/kayobe-config/pull-retag-push-images.sh
7158

7259
# Deploy the seed services.
7360
kayobe seed service deploy
7461

7562
# Deploying the seed restarts networking interface,
7663
# run configure-local-networking.sh again to re-add routes.
77-
./config/src/kayobe-config/configure-local-networking.sh
64+
~/deployment/src/kayobe-config/configure-local-networking.sh
65+
66+
# Set Environment variables for Kayobe dev scripts
67+
export KAYOBE_CONFIG_SOURCE_PATH=~/deployment/src/kayobe-config
68+
export KAYOBE_VENV_PATH=~/deployment/venvs/kayobe
69+
export TENKS_CONFIG_PATH=~/deployment/src/kayobe-config/tenks.yml
7870

79-
# NOTE: Make sure to use ./tenks, since just ‘tenks’ will install via PyPI.
80-
export TENKS_CONFIG_PATH=config/src/kayobe-config/tenks.yml
81-
./dev/tenks-deploy-overcloud.sh ./tenks
71+
# Deploy overcloud using Tenks
72+
~/deployment/src/kayobe/dev/tenks-deploy-overcloud.sh ~/deployment/src/tenks
8273

8374
# Inspect and provision the overcloud hardware:
8475
kayobe overcloud inventory discover
@@ -88,7 +79,7 @@ kayobe overcloud provision
8879
kayobe overcloud host configure
8980
kayobe overcloud container image pull
9081
kayobe overcloud service deploy
91-
source config/src/kayobe-config/etc/kolla/public-openrc.sh
82+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
9283
kayobe overcloud post configure
93-
source config/src/kayobe-config/etc/kolla/public-openrc.sh
94-
./config/src/kayobe-config/init-runonce.sh
84+
source ~/deployment/src/kayobe-config/etc/kolla/public-openrc.sh
85+
~/deployment/src/kayobe-config/init-runonce.sh

etc/kayobe/ansible/pull-retag-push.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
- import_playbook: ../../../../../../ansible/kolla-build.yml
2+
- name: Run the Kayobe kolla-build.yml playbook
3+
import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/kolla-build.yml"
34

45
- name: Pull, retag, and push images
56
hosts: container-image-builders

etc/kayobe/kolla/config/bifrost/bifrost.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ create_ipa_image: false
44
download_ipa: true
55

66
# Use a locally hosted cloud image.
7-
use_cirros: true
7+
download_custom_deploy_image: true
88
{% if os_distribution == 'centos' %}
9-
cirros_deploy_image_upstream_url: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20221206.0.x86_64.qcow2"
9+
custom_deploy_image_upstream_url: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20221206.0.x86_64.qcow2"
10+
custom_deploy_image_checksum_url: "https://cloud.centos.org/centos/9-stream/x86_64/images/CHECKSUM"
11+
custom_deploy_image_checksum_algorithm: "sha256"
1012
{% elif os_distribution == 'rocky' %}
1113
# NOTE(priteau): Temporarily using Rocky Linux 9.3 because 9.4 images fail to
1214
# boot (https://bugs.rockylinux.org/view.php?id=6832)
13-
cirros_deploy_image_upstream_url: "https://dl.rockylinux.org/vault/rocky/9.3/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2"
15+
custom_deploy_image_upstream_url: "https://dl.rockylinux.org/vault/rocky/9.3/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2"
16+
custom_deploy_image_checksum_url: "https://dl.rockylinux.org/vault/rocky/9.3/images/x86_64/CHECKSUM"
17+
custom_deploy_image_checksum_algorithm: "sha256"
1418
{% else %}
15-
cirros_deploy_image_upstream_url: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
19+
custom_deploy_image_upstream_url: "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
20+
custom_deploy_image_checksum_url: "https://cloud-images.ubuntu.com/jammy/current/SHA256SUMS"
21+
custom_deploy_image_checksum_algorithm: "sha256"
1622
{% endif %}

init-runonce.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
set -e
44

5-
if [[ ! -d ~/os-venv ]]; then
6-
/usr/bin/python3 -m venv ~/os-venv
5+
if [[ ! -d ~/deployment/venvs/os-venv ]]; then
6+
/usr/bin/python3 -m venv ~/deployment/venvs/os-venv
77
fi
8-
~/os-venv/bin/pip install -U pip
9-
~/os-venv/bin/pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/master
8+
~/deployment/venvs/os-venv/bin/pip install -U pip
9+
~/deployment/venvs/os-venv/bin/pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/master
1010

1111
parent="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1212
init_runonce=$parent/../kolla-ansible/tools/init-runonce
@@ -15,5 +15,5 @@ if [[ ! -f $init_runonce ]]; then
1515
exit 1
1616
fi
1717

18-
source ~/os-venv/bin/activate
18+
source ~/deployment/venvs/os-venv/bin/activate
1919
$init_runonce

pull-retag-push-images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ fi
1515
shift $#
1616

1717
cd ${KAYOBE_PATH}
18-
source dev/environment-setup.sh
18+
source ~/deployment/env-vars.sh
1919
kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/pull-retag-push.yml ${KAYOBE_EXTRA_ARGS:+"$KAYOBE_EXTRA_ARGS"}

0 commit comments

Comments
 (0)