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

docs(buildah): add github actions host and docker runner docs #755

Merged
merged 31 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7ddf1af
docs(buildah): add github actions buildah docs
Fral738 Nov 14, 2024
8aedc02
fix(docs): add required variable to workflow examples
Fral738 Nov 15, 2024
a6259f7
docs(builadh): add github actions docker buildah docs
Fral738 Nov 15, 2024
acde6e7
add volume add fuse
Fral738 Nov 18, 2024
2c7b458
chore(site): change basic auth to dex (#754)
IvanKhramov Nov 15, 2024
4cdedfc
chore(ci, docs): use only the install werf action (#751)
Fral738 Nov 18, 2024
c40e48b
docs(buildah): add github actions buildah docs
Fral738 Nov 14, 2024
a10f803
chore(fix): fix merge conflict
Fral738 Nov 18, 2024
803337c
chore(fix): add missing token remove duplicate
Fral738 Nov 18, 2024
0736a29
+
alexey-igrychev Nov 19, 2024
2198e48
docs(buildah): update docs
Fral738 Nov 20, 2024
3e9e3aa
docs(docker): add self-hosted configuration
Fral738 Nov 20, 2024
b608e57
docs: update docs
Fral738 Nov 20, 2024
d779a6b
docs(fix): fix spelling error
Fral738 Nov 20, 2024
1ffe4f2
docs(refactor): move cross-platform build to project
Fral738 Nov 20, 2024
8a1ffed
chore(docs): bring list to one style
Fral738 Nov 21, 2024
2974df4
docs: update docs
Fral738 Nov 22, 2024
ce11042
docs: bring lists to one style
Fral738 Nov 22, 2024
52a5614
docs: fix last list
Fral738 Nov 22, 2024
db49902
docs: remove fuse from extras
Fral738 Nov 22, 2024
ad4e036
docs: refactor github docs
Fral738 Nov 25, 2024
351937d
docs: refactor cleanup in github docs
Fral738 Nov 25, 2024
5f7213f
docs(refactor): restore the order of page sections
Fral738 Nov 25, 2024
6e8aab5
docs(refactor): rename buildah section
Fral738 Nov 25, 2024
d8b0fd5
docs(refactor): rename prepare environment section
Fral738 Nov 25, 2024
27fd4ea
docs(fix): add words to wordlist fix spelling error
Fral738 Nov 25, 2024
bda495f
docs(refactor): refactor docs
Fral738 Nov 25, 2024
ffe217c
refactor(docs): refactor gitlab docs
Fral738 Nov 25, 2024
3b5522b
refactor(docs): update links and comment
Fral738 Nov 25, 2024
f7d51c8
refactor(docs): remove unnecessary capture
Fral738 Nov 25, 2024
c5f7ba1
refactor(docs): make the pages look the same
Fral738 Nov 25, 2024
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
52 changes: 51 additions & 1 deletion bin/configurator/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ combinations:
- name: "buildBackend"
value: "docker"

# github actions simple
# GitHub actions host docker
- tabs:
- name: "infra"
includePath: "/configurator/tab/ci/github-actions/simple/host-runner/linux/docker/infra.md.liquid"
- name: "project"
includePath: "/configurator/tab/ci/github-actions/simple/host-runner/linux/docker/project.md.liquid"
options:
Expand All @@ -122,6 +124,54 @@ combinations:
- name: "repoType"
value: "application"

# GitHub Actions host buildah
- tabs:
- name: "infra"
includePath: "/configurator/tab/ci/github-actions/simple/host-runner/linux/buildah/infra.md.liquid"
- name: "project"
includePath: "/configurator/tab/ci/github-actions/simple/host-runner/linux/buildah/project.md.liquid"
options:
- name: "usage"
value: "ci"
- name: "ci"
value: "githubActions"
- name: "runnerType"
value: "hostRunner"
- name: "os"
value: "linux"
- name: "buildBackend"
value: "buildah"
- name: "projectType"
value: "simplified"
- name: "sharedCICD"
value: "no"
- name: "repoType"
value: "application"

#GitHub Actions ci/cd docker
- tabs:
- name: "infra"
includePath: "/configurator/tab/ci/github-actions/simple/docker-runner/linux/buildah/infra.md.liquid"
- name: "project"
includePath: "/configurator/tab/ci/github-actions/simple/docker-runner/linux/buildah/project.md.liquid"
options:
- name: "usage"
value: "ci"
- name: "ci"
value: "githubActions"
- name: "runnerType"
value: "dockerRunner"
- name: "os"
value: "linux"
- name: "buildBackend"
value: "buildah"
- name: "projectType"
value: "simplified"
- name: "sharedCICD"
value: "no"
- name: "repoType"
value: "application"

# gitlab ci cd simple
- tabs:
- name: "infra"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Installing Buildah
### Setting up the build environment with Buildah

Follow these steps on the GitLab Runner host to install Buildah:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Setting up the build environment with Buildah

(For Ubuntu 23.10 and later) on the GitLab Runner host run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@

- [Docker Engine](https://docs.docker.com/engine/install/).

### Prepare the environment

(For Ubuntu 23.10 and later) on the GitLab Runner host run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}

### Installing GitLab Runner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

Follow [official instructions](https://docs.gitlab.com/runner/install/) to install and register the GitLab Runner. If you are going to install your GitLab Runner in Kubernetes, then install it to `gitlab-ci` namespace.

### Prepare the environment

(For Ubuntu 23.10 and later) on the GitLab Runner nodes run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}

### Basic GitLab Runner configuration (no caching)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Installing Buildah
### Setting up the build environment with Buildah

Perform the following steps to install Buildah:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

- [Argo CD](https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd).

### Prepare the environment

(For Ubuntu 23.10 and later) on the GitLab Runner host run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}

### Installing GitLab Runner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@

- [Argo CD](https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd).

### Prepare the environment

(For Ubuntu 23.10 and later) on the GitLab Runner nodes run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}

### Install GitLab Runner

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
> **_Important_**: this section describes preparing the infrastructure for self-hosted GitHub Runner

### Requirements

- GitHub Actions;

- Host to run GitHub Runner with:

- [Docker Engine](https://docs.docker.com/engine/install/).

### Installing and registering GitHub Runner

Install and register GitHub Runner on its dedicated host by following the [official instructions](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners).

{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Requirements

* GitHub Actions;

* GitHub-hosted Runner or self-hosted runner.

### Setting up a GitHub project

* [Create and save the access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to clean up the no longer needed images from the container registry with the following parameters:

* Token name: `werf-images-cleanup`;

* Scopes: `read:packages` and `delete:packages`.

* Add the following variable to the project [secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions):

* Access token to clean up the no longer needed images:

* Name: `REGISTRY_CLEANUP_TOKEN`;

* Secret: `<"werf-images-cleanup" access token you saved earlier>`.

* Save the kubeconfig file to access the Kubernetes cluster as a `KUBECONFIG_BASE64` [encrypted secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets), pre-encoding it in Base64.

### Configuring CI/CD of the project

This is how the repository that uses werf for build and deploy might look:

{% tree_file_viewer '/examples/configurator/ci-cd/simple/github-actions/docker-runner/linux/buildah' default_file='.github/workflows/prod.yml' %}

Extras:

* To use GitHub-hosted Runner, specify `ubuntu-latest` in `runs-on`;

* If you do not use ghcr as a container registry, then enter `WERF_REPO`, run [werf cr login](https://werf.io/docs/v1.2/reference/cli/werf_cr_login.html), and also take into account [features](https://werf.io/docs/v1.2/usage/cleanup/cr_cleanup.html#features-of-working-with-different-container-registries) of your container registry when cleaning.
Fral738 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
> **_Important_**: this section describes preparing the infrastructure for self-hosted GitHub Runner

### Requirements

- GitHub Actions;

- Host to run GitHub Runner with:

- Bash;

- Git version 2.18.0 or above;

- GPG.

### Installing and registering the GitHub Runner

Follow [official instructions](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners) to install and register the GitHub Runner on your dedicated host.

{% include configurator/partials/ci/buildah_install.md.liquid %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Requirements

* GitHub Actions;

* GitHub-hosted Runner or self-hosted runner.

### Setting up a GitHub project

* [Create and save the access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to clean up the no longer needed images from the container registry with the following parameters:

* Token name: `werf-images-cleanup`;

* Scopes: `read:packages` and `delete:packages`.

* Add the following variable to the project [secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions):

* Access token to clean up the no longer needed images:

* Name: `REGISTRY_CLEANUP_TOKEN`;

* Secret: `<"werf-images-cleanup" access token you saved earlier>`.

* Save the kubeconfig file to access the Kubernetes cluster as a `KUBECONFIG_BASE64` [encrypted secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets), pre-encoding it in Base64.

### Configuring CI/CD of the project

This is how the repository that uses werf for build and deploy might look:

{% tree_file_viewer '/examples/configurator/ci-cd/simple/github-actions/host-runner/linux/buildah' default_file='.github/workflows/prod.yml' %}

Extras:

* To use GitHub-hosted Runner, specify `ubuntu-latest` in `runs-on`;

* If you do not use ghcr as a container registry, then enter `WERF_REPO`, run [werf cr login](https://werf.io/docs/v1.2/reference/cli/werf_cr_login.html), and also take into account [features](https://werf.io/docs/v1.2/usage/cleanup/cr_cleanup.html#features-of-working-with-different-container-registries) of your container registry when cleaning.
Fral738 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
> **_Important_**: this section describes preparing the infrastructure for self-hosted GitHub Runner

### Requirements

- GitHub Actions;

- Host to run GitHub Runner with:

- Bash;

- Git version 2.18.0 or above;

- GPG;

- [Docker Engine](https://docs.docker.com/engine/install/).

### Installing and registering the GitHub Runner

Follow [official instructions](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners) to install and register the GitHub Runner on your dedicated host.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,34 @@

* GitHub Actions;

* GitHub-hosted Linux Runner.
* GitHub-hosted Runner or self-hosted runner.

### Setting up a GitHub project

Save the kubeconfig file to access the Kubernetes cluster as a `KUBECONFIG_BASE64` [encrypted secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets), pre-encoding it in Base64.
* [Create and save the access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to clean up the no longer needed images from the container registry with the following parameters:

* Token name: `werf-images-cleanup`;

* Scopes: `read:packages` and `delete:packages`.

* Add the following variable to the project [secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions):

* Access token to clean up the no longer needed images:

* Name: `REGISTRY_CLEANUP_TOKEN`;

* Secret: `<"werf-images-cleanup" access token you saved earlier>`.

* Save the kubeconfig file to access the Kubernetes cluster as a `KUBECONFIG_BASE64` [encrypted secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets), pre-encoding it in Base64.

### Configuring CI/CD of the project

This is how the repository that uses werf for build and deploy might look:

{% tree_file_viewer '/examples/configurator/ci-cd/simple/github-actions/host-runner/linux/buildah' default_file='.github/workflows/prod.yml' %}
{% tree_file_viewer '/examples/configurator/ci-cd/simple/github-actions/host-runner/linux/docker' default_file='.github/workflows/prod.yml' %}

Extras:
* Add authorization options for `werf cleanup` in the container registry by following [instructions]({{ "/docs/v2/usage/cleanup/cr_cleanup.html#features-of-working-with-different-container-registries" | relative_url }}).

* To use GitHub-hosted Runner, specify `ubuntu-latest` in `runs-on`;

* If you do not use ghcr as a container registry, then enter `WERF_REPO`, run [werf cr login](https://werf.io/docs/v1.2/reference/cli/werf_cr_login.html), and also take into account [features](https://werf.io/docs/v1.2/usage/cleanup/cr_cleanup.html#features-of-working-with-different-container-registries) of your container registry when cleaning.
Fral738 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

* [Docker Engine](https://docs.docker.com/engine/install/).

### Prepare the environment

(For Ubuntu 23.10 and later) on the GitLab Runner host run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}

### Configuring the Runner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

* GPG.

### Installing Buildah
### Setting up the build environment with Buildah

To install Buildah, do the following on the host for running CI jobs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@

- Kubernetes for running CI jobs with your CI system's Kubernetes Runner.

### Prepare the environment

(For Ubuntu 23.10 and later) on the GitLab Runner nodes run:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
{% include configurator/partials/ci/buildah_ubuntu.md.liquid %}

### Basic Runner configuration (no caching)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Установка Buildah
### Настройка окружения для сборки с Buildah

Для установки Buildah выполните следующие инструкции на хосте для GitLab Runner:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Установка Buildah
### Настройка окружения для сборки с Buildah

Для установки Buildah выполните следующие инструкции:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
> **_Важно_**: раздел описывает подготовку инфраструктуры для self-hosted GitHub Runner

### Требования

- GitHub Actions;

- Хост для установки GitHub Runner, имеющий:

- [Docker Engine](https://docs.docker.com/engine/install/).

### Установка и регистрация GitHub Runner

Установите и зарегистрируйте GitHub Runner на выделенный для него хост, следуя [официальным инструкциям](https://docs.github.com/ru/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners).

### Настройка окружения для сборки с Buildah

(Для Ubuntu 23.10 и выше) на хосте GitHub Runner запустите:

```shell
{ echo "kernel.apparmor_restrict_unprivileged_userns = 0" && echo "kernel.apparmor_restrict_unprivileged_unconfined = 0";} | sudo tee -a /etc/sysctl.d/20-apparmor-donotrestrict.conf && sudo sysctl -p /etc/sysctl.d/20-apparmor-donotrestrict.conf
```
Loading
Loading