Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitLab based Kayobe-Automation #1471

Open
wants to merge 6 commits into
base: stackhpc/2024.1
Choose a base branch
from

Conversation

jackhodgkiss
Copy link
Contributor

Add support for GitLab based kayobe-automation complete with OpenBao for secret managment.

This commit adds the required collections and roles for GitLab CI to the
`etc/kayobe/ansible/requirements.yml` file.

Note: this will need changing before merging but is required until the
roles and collections been merged and released.
Includes steps for deploying GitLab runners, generating pipelines and
deploying OpenBao for secret management.
@jackhodgkiss jackhodgkiss self-assigned this Jan 21, 2025
@jackhodgkiss jackhodgkiss requested a review from a team as a code owner January 21, 2025 15:57
@product-auto-label product-auto-label bot added size: l ansible Ansible playbooks documentation Improvements or additions to documentation labels Jan 21, 2025
@jackhodgkiss jackhodgkiss force-pushed the add-gitlab-kayobe-automation branch from e1e5994 to 9a301fb Compare January 22, 2025 12:10
@jackhodgkiss jackhodgkiss force-pushed the add-gitlab-kayobe-automation branch from 9a301fb to 8e675b7 Compare January 22, 2025 12:51
@jackhodgkiss jackhodgkiss force-pushed the add-gitlab-kayobe-automation branch from 8e675b7 to ff8d471 Compare January 22, 2025 13:23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the inline code formatting is a bit weird in this file. Normally we use double backticks: ``code``. This file seems to mix single backticks (which don't render correctly), double backticks, and the :code: directive. Personally I think we should switch everything to double backticks. The existing text is outside the scope of this PR but can we try to stick to the convention for the new parts?

Comment on lines +8 to 18
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add newlines between lines just to add some spacing? At the moment it renders as a pretty big block of text which makes it harder to parse.

.. 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For example project_id within the gitlab role will need ID of the project that the runners are registered against.
For example project_id within the gitlab role will need the ID of the project that the runners are registered against.

EOF
bao write auth/jwt/config \
jwks_url="https://gitlab.example.com/oauth/discovery/keys" \
bound_issuer="https://gitlab.example.com" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a trailing backslash here. has this command been cut off prematurely?


- 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@@ -87,6 +93,7 @@ network
monitoring
storage
compute
infra-vms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a breaking change on some systems. Could we instead just add gitlab-runners and github-runners?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible Ansible playbooks documentation Improvements or additions to documentation size: l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants