Skip to content

Commit 6368678

Browse files
authored
Merge pull request #475 from stackhpc/yoga-xena-merge
yoga: merge xena
2 parents dae6a66 + d4bb26f commit 6368678

File tree

24 files changed

+416
-84
lines changed

24 files changed

+416
-84
lines changed

.github/workflows/stackhpc-container-image-build.yml

Lines changed: 97 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,92 @@ on:
1818
type: boolean
1919
required: false
2020
default: false
21-
distro:
22-
description: Container image OS distribution
23-
type: choice
21+
centos-stream-8:
22+
description: Build CentOS Stream 8 images?
23+
type: boolean
24+
required: false
25+
default: true
26+
rocky-linux-9:
27+
description: Build Rocky Linux 9 images?
28+
type: boolean
29+
required: false
30+
default: true
31+
ubuntu-focal:
32+
description: Build Ubuntu Focal 20.04 images?
33+
type: boolean
34+
required: false
35+
default: true
36+
push:
37+
description: Whether to push images
38+
type: boolean
2439
required: false
25-
default: centos
26-
options:
27-
- centos
28-
- ubuntu
29-
- rocky
40+
default: true
3041

3142
env:
3243
ANSIBLE_FORCE_COLOR: True
3344
jobs:
45+
generate-tag:
46+
name: Generate container image tag
47+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
48+
runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder]
49+
permissions: {}
50+
outputs:
51+
kolla_tag: ${{ steps.kolla_tag.outputs.kolla_tag }}
52+
matrix: ${{ steps.set-matrix.outputs.matrix }}
53+
openstack_release: ${{ steps.openstack_release.outputs.openstack_release }}
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v3
57+
58+
- name: Determine OpenStack release
59+
id: openstack_release
60+
run: |
61+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
62+
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
63+
64+
# Generate a tag to apply to all built container images.
65+
# Without this, each kayobe * container image build command would use a different tag.
66+
- name: Generate container image tag
67+
id: kolla_tag
68+
run: |
69+
echo "kolla_tag=$(date +${{ steps.openstack_release.outputs.openstack_release }}-%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
70+
71+
# Dynamically define job matrix.
72+
# We need a separate matrix entry for each distribution, when the relevant input is true.
73+
# https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
74+
- name: Generate build matrix
75+
id: set-matrix
76+
run: |
77+
comma=""
78+
echo -n "matrix={\"distro\": [" >> $GITHUB_OUTPUT
79+
if [[ ${{ inputs.centos-stream-8 }} == 'true' ]]; then
80+
echo -n "$comma\"centos\"" >> $GITHUB_OUTPUT
81+
comma=", "
82+
fi
83+
if [[ ${{ inputs.rocky-linux-9 }} == 'true' ]]; then
84+
echo -n "$comma\"rocky\"" >> $GITHUB_OUTPUT
85+
comma=", "
86+
fi
87+
if [[ ${{ inputs.ubuntu-focal }} == 'true' ]]; then
88+
echo -n "$comma\"ubuntu\"" >> $GITHUB_OUTPUT
89+
comma=", "
90+
fi
91+
echo "]}" >> $GITHUB_OUTPUT
92+
93+
- name: Display container image tag
94+
run: |
95+
echo "${{ steps.kolla_tag.outputs.kolla_tag }}"
96+
3497
container-image-build:
3598
name: Build Kolla container images
3699
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
37100
runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder]
38101
timeout-minutes: 720
102+
permissions: {}
103+
strategy:
104+
matrix: ${{ fromJson(needs.generate-tag.outputs.matrix) }}
105+
needs:
106+
- generate-tag
39107
steps:
40108
- uses: actions/checkout@v3
41109
with:
@@ -45,7 +113,7 @@ jobs:
45113
uses: actions/checkout@v3
46114
with:
47115
repository: stackhpc/kayobe
48-
ref: refs/heads/stackhpc/yoga
116+
ref: refs/heads/stackhpc/${{ needs.generate-tag.outputs.openstack_release }}
49117
path: src/kayobe
50118

51119
# FIXME: Failed in kolla-ansible : Ensure the latest version of pip is installed
@@ -101,57 +169,43 @@ jobs:
101169

102170
- name: Build and push kolla overcloud images
103171
run: |
172+
args="${{ github.event.inputs.regexes }}"
173+
args="$args -e kolla_base_distro=${{ matrix.distro }}"
174+
args="$args -e kolla_tag=${{ needs.generate-tag.outputs.kolla_tag }}"
175+
if ${{ inputs.push }} == 'true'; then
176+
args="$args --push"
177+
fi
104178
source venvs/kayobe/bin/activate &&
105179
source src/kayobe-config/kayobe-env --environment ci-builder &&
106-
kayobe overcloud container image build ${{ github.event.inputs.regexes }} --push -e kolla_base_distro=${{ inputs.distro }}
180+
kayobe overcloud container image build $args
107181
env:
108182
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
109183
if: github.event.inputs.overcloud == 'true'
110184

111-
- name: Display the overcloud container image tag
112-
run: |
113-
echo "$(cat ~/kolla_tag)"
114-
if: github.event.inputs.overcloud == 'true'
115-
116-
- name: Get built overcloud container images
117-
run: |
118-
sudo docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:$(cat ~/kolla_tag)" > overcloud-container-images
119-
if: github.event.inputs.overcloud == 'true'
120-
121-
- name: Upload overcloud-container-images artifact
122-
uses: actions/upload-artifact@v3
123-
with:
124-
name: Overcloud container images
125-
path: overcloud-container-images
126-
retention-days: 7
127-
if: github.event.inputs.overcloud == 'true'
128-
129185
- name: Build and push kolla seed images
130186
run: |
187+
args="kolla_base_distro=${{ matrix.distro }}"
188+
args="$args -e kolla_tag=${{ needs.generate-tag.outputs.kolla_tag }}"
189+
if ${{ inputs.push }} == 'true'; then
190+
args="$args --push"
191+
fi
131192
source venvs/kayobe/bin/activate &&
132193
source src/kayobe-config/kayobe-env --environment ci-builder &&
133-
kayobe seed container image build --push -e kolla_base_distro=${{ inputs.distro }}
194+
kayobe seed container image build $args
134195
env:
135196
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
136197
if: github.event.inputs.seed == 'true'
137198

138-
- name: Display the seed container image tag
199+
- name: Get built container images
139200
run: |
140-
echo "$(cat ~/kolla_tag)"
141-
if: github.event.inputs.seed == 'true'
201+
sudo docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/${{ matrix.distro }}-*:${{ needs.generate-tag.outputs.kolla_tag }}" > ${{ matrix.distro }}-container-images
142202
143-
- name: Get built seed container images
144-
run: |
145-
sudo docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:$(cat ~/kolla_tag)" > seed-container-images
146-
if: github.event.inputs.seed == 'true'
147-
148-
- name: Upload seed-container-images artifact
203+
- name: Upload container images artifact
149204
uses: actions/upload-artifact@v3
150205
with:
151-
name: Seed container images
152-
path: seed-container-images
206+
name: ${{ matrix.distro }} container images
207+
path: ${{ matrix.distro }}-container-images
153208
retention-days: 7
154-
if: github.event.inputs.seed == 'true'
155209

156210
- name: Prune local Kolla container images over 1 week old
157211
run: |
@@ -161,8 +215,9 @@ jobs:
161215
name: Trigger container image repository sync
162216
needs:
163217
- container-image-build
164-
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
218+
if: github.repository == 'stackhpc/stackhpc-kayobe-config' && inputs.push
165219
runs-on: ubuntu-latest
220+
permissions: {}
166221
steps:
167222
# NOTE(mgoddard): Trigger another CI workflow in the
168223
# stackhpc-release-train repository.

.github/workflows/stackhpc-promote.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
name: Trigger package repository promotion
1111
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
1212
runs-on: ubuntu-latest
13+
permissions: {}
1314
steps:
1415
# NOTE(mgoddard): Trigger another CI workflow in the
1516
# stackhpc-release-train repository.

doc/source/configuration/cephadm.rst

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,70 @@ for Cinder, Cinder backup, Glance, and Nova in Kolla Ansible.
242242
Ceph Commands
243243
~~~~~~~~~~~~~
244244

245-
It is possible to run an arbitrary list of commands against the cluster after deployment
246-
by setting the ``cephadm_commands`` variable. ``cephadm_commands`` should be a list of commands
247-
to pass to ``cephadm shell -- ceph``. For example:
245+
It is possible to run an arbitrary list of commands against the cluster after
246+
deployment by setting the ``cephadm_commands_pre`` and ``cephadm_commands_post``
247+
variables. Each should be a list of commands to pass to ``cephadm shell --
248+
ceph``. For example:
248249

249250
.. code:: yaml
250251
251252
# A list of commands to pass to cephadm shell -- ceph. See stackhpc.cephadm.commands
252253
# for format.
253-
cephadm_commands:
254+
cephadm_commands_pre:
254255
# Configure Prometheus exporter to listen on a specific interface. The default
255256
# is to listen on all interfaces.
256257
- "config set mgr mgr/prometheus/server_addr 10.0.0.1"
257258
259+
Both variables have the same format, however commands in the
260+
``cephadm_commands_pre`` list are executed before the rest of the Ceph
261+
post-deployment configuration is applied. Commands in the
262+
``cephadm_commands_post`` list are executed after the rest of the Ceph
263+
post-deployment configuration is applied.
264+
265+
Manila & CephFS
266+
~~~~~~~~~~~~~~~
267+
268+
Using Manila with the CephFS backend requires the configuration of additional
269+
resources.
270+
271+
A Manila key should be added to cephadm_keys:
272+
273+
.. code:: yaml
274+
275+
# Append the following to cephadm_keys:
276+
- name: client.manila
277+
caps:
278+
mon: "allow r"
279+
mgr: "allow rw"
280+
state: present
281+
282+
A CephFS filesystem requires two pools, one for metadata and one for data:
283+
284+
.. code:: yaml
285+
286+
# Append the following to cephadm_pools:
287+
- name: cephfs_data
288+
application: cephfs
289+
state: present
290+
- name: cephfs_metadata
291+
application: cephfs
292+
state: present
293+
294+
Finally, the CephFS filesystem itself should be created:
295+
296+
.. code:: yaml
297+
298+
# Append the following to cephadm_commands_post:
299+
- "fs new manila-cephfs cephfs_metadata cephfs_data"
300+
- "orch apply mds manila-cephfs"
301+
302+
In this example, the filesystem is named ``manila-cephfs``. This name
303+
should be used in the Kolla Manila configuration e.g.:
304+
305+
.. code:: yaml
306+
307+
manila_cephfs_filesystem_name: manila-cephfs
308+
258309
Deployment
259310
==========
260311

doc/source/configuration/lvm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ another LV needs to be grown at a later date.
7676
Growroot playbook
7777
=================
7878

79-
A ``growroot.yml`` custom playbook is provied that can be used to grow the
79+
A ``growroot.yml`` custom playbook is provided that can be used to grow the
8080
partition and LVM Physical Volume (PV) of the root Volume Group (VG). This
8181
allows for expansion of Logical Volumes (LVs) in that VG.
8282

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ At this point you are ready to build and push some container images.
105105
kayobe seed container image build --push
106106
kayobe overcloud container image build --push
107107
108-
The container images are tagged as |current_release|-<datetime>. This Kayobe
109-
configuration includes a hook that writes the tag to ``~/kolla_tag``, since
110-
it is not always simple to determine which tag was last applied to built
111-
images.
108+
The container images are tagged as |current_release|-<datetime>.
112109

113110
To use the new images, edit
114111
``~/src/kayobe-config/etc/kayobe/kolla.yml`` to set the above

0 commit comments

Comments
 (0)