Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2a74bb5
feat: add required collections and roles for GitLab CI
jackhodgkiss Jan 21, 2025
156c714
feat: add group definitions for gitlab runners and writers
jackhodgkiss Jan 21, 2025
609b6be
feat: add playbooks for deploying runners and OpenBao automation
jackhodgkiss Jan 21, 2025
d0de34b
feat: update `ci-cd` documentation
jackhodgkiss Jan 21, 2025
beba077
fix: linting issues
jackhodgkiss Jan 22, 2025
beaedd3
fix: resolve issues against PR
jackhodgkiss Jan 22, 2025
ffaf5d7
Merge branch 'stackhpc/2024.1' into add-gitlab-kayobe-automation
jackhodgkiss Jan 27, 2025
8197472
feat: apply suggested changes
jackhodgkiss Feb 12, 2025
f3b4fde
docs: update CI/CD documentation
jackhodgkiss Feb 12, 2025
4d76e84
feat: pin collections to branch names
jackhodgkiss Feb 18, 2025
1cb4db6
Bump kolla to stackhpc/18.6.0.12
stackhpc-ci Jun 10, 2025
cadc5e5
Bump kayobe to stackhpc/16.6.0.7
stackhpc-ci Jun 10, 2025
b0a8769
Bump kolla-ansible to stackhpc/18.6.0.13
stackhpc-ci Jun 10, 2025
c3acfa8
Put the RadosGW Usage Exporter behind HAProxy
MoteHue Jun 10, 2025
d90b7e9
Add reno
MoteHue Jun 10, 2025
e5e3425
feat: increase default number of retries for checking `Pulp` status
jackhodgkiss Jun 10, 2025
0270f12
feat: update docs on `GitLab Pipelines`
jackhodgkiss Jun 10, 2025
22d9841
feat: update `stackhpc.kayobe_workflows` collection
jackhodgkiss Jun 10, 2025
2e27317
Merge branch 'stackhpc/2024.1' into add-gitlab-kayobe-automation
jackhodgkiss Jun 10, 2025
f57eaa0
Merge pull request #1659 from stackhpc/update-dependency/kolla/stackh…
Alex-Welsh Jun 11, 2025
51e7180
Merge pull request #1677 from stackhpc/update-dependency/kayobe/stack…
Alex-Welsh Jun 11, 2025
570699e
Merge pull request #1676 from stackhpc/update-dependency/kolla-ansibl…
Alex-Welsh Jun 11, 2025
0119d04
Update reno
MoteHue Jun 11, 2025
8ebb801
Merge branch 'stackhpc/2024.1' into increase-pulp-retries
jackhodgkiss Jun 12, 2025
23ef04a
Merge pull request #1702 from stackhpc/update-rabbitmq-rule
seunghun1ee Jun 12, 2025
6f7efa2
Merge pull request #1697 from stackhpc/radosgw-usage-exporter-behind-…
Alex-Welsh Jun 12, 2025
3d8c704
Merge pull request #1703 from stackhpc/cherry-pick-0bd6d0-stackhpc/20…
Alex-Welsh Jun 12, 2025
09fa0e0
Merge pull request #1698 from stackhpc/increase-pulp-retries
jackhodgkiss Jun 12, 2025
7a826c0
Merge pull request #1684 from stackhpc/ci-aio-network
Alex-Welsh Jun 13, 2025
c5d8484
INFRA-709 Rated dwpd alerts (#1077)
technowhizz Jun 13, 2025
264ff7c
Merge pull request #1707 from stackhpc/cherry-pick-36ac2e-stackhpc/20…
seunghun1ee Jun 13, 2025
c6b10a1
Merge pull request #1471 from stackhpc/add-gitlab-kayobe-automation
Alex-Welsh Jun 13, 2025
5a8c122
CI: Force system clock synchronisation
Alex-Welsh Jun 13, 2025
b879fb8
Merge pull request #1706 from stackhpc/force-ntp
priteau Jun 13, 2025
28302e5
feat: add `neutron_bgp_dragent` tags
jackhodgkiss Jun 17, 2025
70cac13
Merge pull request #1715 from stackhpc/add-neutron-bgp-tags
Alex-Welsh Jun 18, 2025
8003873
CI: Sync Epoxy Kayobe/Kolla dependencies in CI
Alex-Welsh Jun 18, 2025
06de0b1
Merge pull request #1717 from stackhpc/ansible-lint-fix
Alex-Welsh Jun 18, 2025
1ad88de
Merge pull request #1723 from stackhpc/cherry-pick-df91bf-stackhpc/20…
Alex-Welsh Jun 18, 2025
dea5a87
Merge branch 'stackhpc/2024.1' into epoxy-dep-sync
Alex-Welsh Jun 18, 2025
84ad62b
Merge pull request #1721 from stackhpc/epoxy-dep-sync
Alex-Welsh Jun 19, 2025
54738a7
Minor fixes to RMQ dashboard (#1728)
dougszumski Jun 23, 2025
e5a8c89
Bump kayobe to stackhpc/16.6.0.10
stackhpc-ci Jun 24, 2025
27846ce
Bump kolla-ansible to stackhpc/18.6.0.15
stackhpc-ci Jun 24, 2025
e323d0d
Bump kolla to stackhpc/18.6.0.13
stackhpc-ci Jun 24, 2025
5e02047
CI: Sync multinode release matrix with 2025.1
priteau Jun 25, 2025
9f49b49
fix: use `overcloud_openbao_docker_tag` for `OpenBao`
jackhodgkiss Jul 4, 2025
1b23423
Merge pull request #1741 from stackhpc/fix-openbao-include-tag
jackhodgkiss Jul 5, 2025
8d25146
Bump kayobe to stackhpc/16.7.0.2
stackhpc-ci Jul 8, 2025
1ba2048
CI: Bump SOGW to include multinode instance tags
Alex-Welsh Jul 8, 2025
dd76540
CI: revert openbao changes for multinode
Alex-Welsh Jul 8, 2025
56fc9c5
Merge pull request #1747 from stackhpc/revert-bao-default
priteau Jul 8, 2025
ac471d7
Merge pull request #1746 from stackhpc/2024.1-fix-mn-cleanup
priteau Jul 8, 2025
c25ae90
Add get-cloud-facts.yml to gather deployment info (#1750)
GavinHeff Jul 10, 2025
2231766
Fix Grafana external endpoint blackbox config
MoteHue Jul 10, 2025
11ed013
adding rl9.6
GregWhiteyBialas Jun 27, 2025
c424427
backporting skyline disable
seunghun1ee Jun 10, 2025
010aceb
new tag
GregWhiteyBialas Jul 7, 2025
d2a7883
add tag for neutron_bgp_dragent
GregWhiteyBialas Jul 8, 2025
9d489d8
Bump kayobe to stackhpc/16.7.0.3
stackhpc-ci Jul 11, 2025
e408c10
Clone Kayobe into a tempdir when doing version checks
m-bull Jul 11, 2025
dc200bb
Merge pull request #1757 from stackhpc/fix/version-check-multiuser
bbezak Jul 11, 2025
d26a76b
Merge branch 'stackhpc/2024.1' into update-dependency/kayobe/stackhpc…
bbezak Jul 11, 2025
d668463
Merge pull request #1753 from stackhpc/update-dependency/kayobe/stack…
bbezak Jul 14, 2025
a1e27e2
Bump kolla to stackhpc/18.7.0.2
stackhpc-ci Jul 11, 2025
54e30f5
Bump kolla-ansible to stackhpc/18.7.0.1
stackhpc-ci Jul 11, 2025
7950069
CI: Fix DOCA repo version var naming
Alex-Welsh Jul 14, 2025
6f1ed16
Merge remote-tracking branch 'origin/stackhpc/2024.1' into sync-carac…
Alex-Welsh Jul 15, 2025
747cab6
Fix smartmon-tools yum module usage
Alex-Welsh Jul 15, 2025
3a17bfd
Add Epoxy tags for Neutron BGP dragent
Alex-Welsh Jul 15, 2025
44dc926
Merge remote-tracking branch 'origin/stackhpc/2025.1' into sync-carac…
Alex-Welsh Jul 15, 2025
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
25 changes: 6 additions & 19 deletions .github/workflows/package-build-ofed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
runs-on: arc-skc-host-image-builder-runner
permissions: {}
steps:
- name: Generate OFED tag
id: ofed_tag
run: |
echo "ofed_tag=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT

- name: Install Package
uses: ConorMacBride/install-package@main
with:
Expand All @@ -42,32 +47,14 @@ jobs:
with:
path: src/kayobe-config

- name: Determine OpenStack release
id: openstack_release
run: |
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT

- name: Generate OFED tag
id: ofed_tag
run: |
echo "ofed_tag=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT

- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v4
with:
repository: stackhpc/kayobe
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
path: src/kayobe

- name: Install Kayobe
run: |
mkdir -p venvs &&
pushd venvs &&
python3 -m venv kayobe &&
source kayobe/bin/activate &&
pip install -U pip &&
pip install ../src/kayobe
pip install -r ../src/kayobe-config/requirements.txt

- name: Install terraform
uses: hashicorp/setup-terraform@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stackhpc-multinode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ name: Multinode
jobs:
multinode:
name: Multinode
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/[email protected].0
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/[email protected].1
with:
multinode_name: ${{ inputs.multinode_name }}
os_distribution: ${{ inputs.os_distribution }}
Expand Down
213 changes: 212 additions & 1 deletion doc/source/configuration/ci-cd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ CI/CD
Concepts
========

The CI/CD system developed for managing Kayobe based OpenStack clouds is composed of three main components; workflows, runners and kayobe automation.
The CI/CD system developed for managing Kayobe based OpenStack clouds is composed of four main components; workflows, runners, OpenBao and kayobe automation.

Firstly, the workflows are files which describe a series of tasks to be performed in relation to the deployed cloud.
These workflows are executed on request, on schedule or in response to an event such as a pull request being opened.

The workflows are designed to carry out various day-to-day activites such as; running Tempest tests, configuring running services or displaying the change to configuration files if a pull request is merged.
Secondly, in order for the workflows to run against a cloud we would need private runners present within the cloud positioned in such a way they can reach the internal network and public API.
Deployment of private runners is supported by all major providers with the use of community developed Ansible roles.

Thirdly, OpenBao is used to store secrets on the same virtual machine the runners are hosted within.
This provides a secure way of storing secrets and variables which can be accessed by the runners when executing workflows and ensures that secrets never have to leave the cloud.

Finally, due to the requirement that we support various different platforms tooling in the form of `Kayobe automation <https://github.com/stackhpc/kayobe-automation/>`__ was developed.
This tooling is not tied to any single CI/CD platform as all tasks are a series of shell script and Ansible playbooks which are designed to run in a purpose build kayobe container.

This is complemented by the use of an Ansible collection known as `stackhpc.kayobe_workflows <https://github.com/stackhpc/ansible-collection-kayobe-workflows/>`__ which aims to provide users with a quick and easy way of customising all workflows to fit within a customer's cloud.

Currently we support the creation and deployment of workflows for GitHub with Gitlab support being actively worked upon.
Expand Down Expand Up @@ -42,6 +49,12 @@ These services will listen for jobs which have been tagged appropriately and dis
The runners will need to be deployed using existing roles and playbooks whereby the binary/package is downloaded and registered using a special token.
In some deployments runner hosts can be shared between environments however this is not always true and dedicated hosts will need to be used for each environment you intend to deploy kayobe automation within.

OpenBao
-------

OpenBao is recommended when deploying kayobe automation to achieve a simple and secure way of storing secrets.
OpenBao can easily be configured to hold the secrets for all environments and only permit access to the runners which require them utilising different authorisation mechanisms such as GitLab's JWT (JSON Web Token).

GitHub Actions
=================

Expand Down Expand Up @@ -181,3 +194,201 @@ Sometimes the kayobe docker image must be rebuilt the reasons for this include b
* Update kolla-ansible
* UID/GID collision when deploying workflows to a new environment
* Prior to deployment of new a OpenStack release

GitLab Pipelines
================

To enable CI/CD where GitLab Pipelines is used please follow the steps described below starting with the deployment of the runners.

Runner Deployment
-----------------

1. Identify a suitable host for hosting the runners.
Ideally an infra-vm would be deployed to allow for easily compartmentalising the runners from the rest of the environment.
8 VCPUs and 16GB of RAM is recommended for the guest machine however this may need to be adjusted for larger deployments.
Whether the host is in an infra-vm or not it will need access to the :code:`admin_network` or :code:`provision_oc_network`, :code:`public_network` and the :code:`pulp registry` on the seed.
The steps will assume that an infra-vm will be used for the purpose of hosting the runners.

2. Edit the environment's :code:`${KAYOBE_CONFIG_PATH}/environments/${KAYOBE_ENVIRONMENT}/inventory/hosts` to define the host(s) that will host the runners.

.. code-block:: ini

[gitlab-runners]
gitlab-runner-01

4. Provide all the relevant Kayobe :code:`group_vars` for :code:`gitlab-runners` under :code:`${KAYOBE_CONFIG_PATH}/environments/${KAYOBE_ENVIRONMENT}/inventory/group_vars/gitlab-runners`
* `infra-vms` ensuring all required `infra_vm_extra_network_interfaces` are defined
* `network-interfaces`
* `allocated IPs`

5. Edit the ``${KAYOBE_CONFIG_PATH}/inventory/group_vars/gitlab-runners/runners.yml`` file which will contain the variables required to deploy a series of runners.
Below is an example of how GitLab runners can be configured for deployment.
In this example we have two runners, one for production and one for staging and will both be deployed on the same host.
This might not be possible for all deployments as multiple environments may require different runners as no single runner can serve all environments.
Note a GitLab runner can run multiple jobs concurrently so deploying a single runner per environment is recommended.

.. code-block:: yaml

---
gitlab_runner_coordinator_url: "https://gitlab.example.com"
gitlab_runner_runners:
- name: "Kayobe Automation Runner [Production] #1"
executor: docker
docker_image: 'alpine'
token: "{{ secrets_gitlab_production_runner_token }}"
env_vars:
- "GIT_CONFIG_COUNT=1"
- "GIT_CONFIG_KEY_0=safe.directory"
- "GIT_CONFIG_VALUE_0=*"
tags:
- kayobe
- openstack
- production
docker_volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/opt/.docker/config.json:/root/.docker/config.json:ro"
- "/cache"
extra_configs:
runners.docker:
network_mode: host
- name: "Kayobe Automation Runner [Staging] #1"
executor: docker
docker_image: 'alpine'
token: "{{ secrets_gitlab_staging_runner_token }}"
env_vars:
- "GIT_CONFIG_COUNT=1"
- "GIT_CONFIG_KEY_0=safe.directory"
- "GIT_CONFIG_VALUE_0=*"
tags:
- kayobe
- openstack
- staging
docker_volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/opt/.docker/config.json:/root/.docker/config.json:ro"
- "/cache"
extra_configs:
runners.docker:
network_mode: host

6. Obtain a runner token for each runner that is required for deployment.
This token can be obtained by visiting the GitLab project -> Settings -> CI/CD -> Runners -> New project runner -> Complete the form including any tags used by the runners such as kayobe, openstack and environment_name.
Once the token has been obtained, add it to :code:`secrets.yml` under :code:`secrets_gitlab_production_runner_token` and :code:`secrets_gitlab_staging_runner_token`

7. Deploy the infra-vm

.. code-block:: bash

kayobe infra vm provision --limit gitlab-runner-01

8. Perform a host configure against the infra-vm

.. code-block:: bash

kayobe infra vm host configure --limit gitlab-runner-01

9. Run :code:`kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/deploy-gitlab-runner.yml`

10. Check runners have registered properly by visiting the repository's :code:`CI/CD` tab -> :code:`Runners`

11. The contents of :code:`/opt/.docker/config.json` on the runner should be added to GitLab CI/CD settings as a sercret variable if GitLab version permits otherwise variable is fine.
This is required to allow the runners to pull images from the registry.
Visit the GitLab project -> Settings -> CI/CD -> Variables -> Add a new variable with the key :code:`DOCKER_AUTH_CONFIG` and the value of the contents of :code:`/opt/.docker/config.json`

OpenBao Deployment
------------------

OpenBao must be installed on the same host as the runners.
If you have multiple environments that each have the own runners then OpenBao must be installed on each host.
However, if you have a single host that is shared between environments then OpenBao only needs to be installed once and can be achieved by running the following playbook.

.. code-block:: bash

kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/deploy-openbao-kayobe-automation.yml

.. note::

If you are sharing OpenBao between environments then you will need to rerun the playbook under each environment to ensure that the correct secrets are available to the runners.
You may use :code:`--tags add_secrets` to skip the deployment within other environments.
For this to work you will need to copy :code:`vault/kayobe-automation-keys.json` from the first environment to the other environments in addition to copying the host definition of the gitlab runner add network IP.

Once the above playbook has been applied you need to grab the root token from :code:`vault/kayobe-automation-keys.json` as you will need this to enable JWT support.
This would also be an opportune time to encrypt the :code:`vault/kayobe-automation-keys.json` to protect the contents.

.. code-block:: bash

ansible-vault encrypt vault/kayobe-automation-keys.json --vault-password-file ~/.vault.password

In order to enable JWT support the following steps must be carried out within the openbao container on the runner host.

1. SSH into the runner host

2. Run :code:`sudo docker exec -it bao sh`

3. Run :code:`export BAO_ADDR=http://127.0.0.1:8200`

4. Run :code:`bao login` and use root token

5. Run the following to enable and configure JWT support

.. note::

The following steps are an example and should be adapted to suit your deployment.
For example project_id within the gitlab role will need ID of the project that the runners are registered against.
This can acquired by visiting the project -> Settings -> General -> General project settings -> Project ID.

.. code-block:: bash

bao auth enable jwt
bao policy write kayobe-automation - <<EOF
path "kayobe-automation/*" {
capabilities = [ "read" ]
}
EOF
bao write auth/jwt/role/gitlab - <<EOF
{
"role_type": "jwt",
"token_explicit_max_ttl": 60,
"user_claim": "user_email",
"bound_audiences": "http://127.0.0.1:8200",
"bound_claims": {
"project_id": "ADD_PROJECT_ID_HERE"
},
"policies": ["kayobe-automation"]
}
EOF
bao write auth/jwt/config \
jwks_url="https://gitlab.example.com/oauth/discovery/keys" \
bound_issuer="https://gitlab.example.com"

GitLab Pipelines
----------------

1. Edit :code:`${KAYOBE_CONFIG_PATH}/inventory/group_vars/gitlab-writer/writer.yml` or environment equivalent the appropriate changes to your deployments specific needs.
See documentation for `stackhpc.kayobe_workflows.gitlab <https://github.com/stackhpc/ansible-collection-kayobe-workflows/tree/main/roles/gitlab>`__.
Following the instructions in the documentation will allow you to customise the workflows to fit within your deployment.
If using multiple environments ensure that :code:`gitlab_kayobe_environments` is updated to reflect all environments present in the deployment.
Also consider the impact runbooks might have as the runbooks are designed with a particular cloud in mind and may not be suitable for all deployments such as hyperconverged deployments with Ceph on hypervisors.

2. Run :code:`kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/write-gitlab-pipelines.yml`

3. Commit and push all newly generated pipelines found under root of the repository.

Things to consider
==================

- Adjust General Pipeline settings by visiting the project -> Settings -> CI/CD -> General pipelines
- Disable :code:`Public Pipelines`
- Disable :code:`Auto-cancel redundant pipelines`
- Disable :code:`Prevent outdated deployment jobs`
- Increase :code:`Timeout` to :code:`12h`

- Disable Auto DevOps in the GitLab project settings by visiting the project -> Settings -> CI/CD -> Auto DevOps -> Disable Auto DevOps

Sometimes the kayobe docker image must be rebuilt. The reasons for this include but are not limited to the following;

* Change :code:`$KAYOBE_CONFIG_PATH/ansible/requirements.yml`
* Change to requirements.txt
* Update Kayobe
* Update kolla-ansible
* Prior to deployment of new a OpenStack release
14 changes: 12 additions & 2 deletions etc/kayobe/ansible/check-kayobe-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,28 @@
register: kayobe_git_commit
failed_when: kayobe_git_commit.stdout == ""

- name: Create a temporary directory to clone Kayobe into
ansible.builtin.tempfile:
state: directory
register: kayobe_temp_dir

- name: Clone Kayobe
ansible.builtin.git:
repo: https://github.com/stackhpc/kayobe.git
dest: /tmp/kayobe-git
dest: "{{ kayobe_temp_dir.path }}/kayobe-git"
version: stackhpc/{{ openstack_release }}

- name: Get tag from Kayobe commit

Check warning on line 43 in etc/kayobe/ansible/check-kayobe-version.yml

View workflow job for this annotation

GitHub Actions / Ansible 2.17 lint with Python 3.10

command-instead-of-module

git used in place of git module

Check warning on line 43 in etc/kayobe/ansible/check-kayobe-version.yml

View workflow job for this annotation

GitHub Actions / Ansible 2.18 lint with Python 3.12

command-instead-of-module

git used in place of git module
ansible.builtin.command:
cmd: git describe --tags {{ kayobe_git_commit.stdout }}
chdir: /tmp/kayobe-git
chdir: "{{ kayobe_temp_dir.path }}/kayobe-git"
register: kayobe_current_version

- name: Clean up temporary directory
ansible.builtin.file:
state: absent
path: "{{ kayobe_temp_dir.path }}"

- name: Get latest Kayobe version
ansible.builtin.shell:
cmd: set -o pipefail && grep -o kayobe@stackhpc\/.*$ {{ requirements_path }} | cut -d @ -f 2
Expand Down
24 changes: 24 additions & 0 deletions etc/kayobe/ansible/deploy-gitlab-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- name: Deploy GitLab runners
hosts: gitlab-runners
become: true
pre_tasks:
- name: Ensure /opt/.docker folder exists
ansible.builtin.file:
path: /opt/.docker
state: directory

- name: Ensure docker/config.json exists for runner
ansible.builtin.copy:
content: |
{
"auths": {
"{{ pulp_url | regex_replace('^https?://|^http?://', '') }}": {
"auth": "{{ (pulp_username + ':' + pulp_password) | b64encode }}"
}
}
}
dest: /opt/.docker/config.json
mode: "0600"
roles:
- role: riemers.gitlab-runner
Loading
Loading