add a workflow running the helm chart #55

Closed
opened 2023-07-15 09:13:28 +00:00 by earl-warren · 8 comments
Owner

The workflow needs to run in a LXC container with additional permissions.

The workflow needs to run in a LXC container with [additional permissions](https://code.forgejo.org/forgejo/lxc-helpers/issues/1). * https://docs.k3s.io/quick-start * export KUBECONFIG=/etc/rancher/k3s/k3s.yaml * https://helm.sh/docs/intro/install/#from-script
Author
Owner

For archive @rome-user sample deployment so I don't loose it again.

Here is the sample deployment I made. Sets up https redirect, postgresql, forgejo, and forgejo actions runner. You will be able to access on https://code.localdev.me/

Unzip the file and run

sudo deploy.sh

It should deploy forgejo with PostgreSQL. It will create an admin user forgejo with password forgejo-2023.

For archive @rome-user sample deployment so I don't loose it again. > Here is the sample deployment I made. Sets up https redirect, postgresql, forgejo, and forgejo actions runner. You will be able to access on https://code.localdev.me/ Unzip the file and run ``` sudo deploy.sh ``` It should deploy forgejo with PostgreSQL. It will create an admin user `forgejo` with password `forgejo-2023`.

One more note: the sample deployment I have provided does not use forgejo/runner yet. But it gives us a good starting point to test the Forgejo helm chart with Forgejo Actions runners.

I am currently working on support for actions runners (using forgejo/runner:2.3.0) here https://codeberg.org/rome-user/forgejo-helm/src/branch/runner

One more note: the sample deployment I have provided does not use `forgejo/runner` yet. But it gives us a good starting point to test the Forgejo helm chart with Forgejo Actions runners. I am currently working on support for actions runners (using `forgejo/runner:2.3.0`) here https://codeberg.org/rome-user/forgejo-helm/src/branch/runner
Author
Owner

My attempt with sudo deploy.sh failed because + kubectl wait pods -l app=forgejo -n forgejo --for=condition=Ready --timeout=240s timed out.

root@k3s:/home/debian/rome-user# kubectl get all -n forgejo
NAME            READY   STATUS                  RESTARTS         AGE
pod/forgejo-0   0/1     Init:CrashLoopBackOff   17 (2m17s ago)   64m

NAME                   TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE
service/forgejo-ssh    ClusterIP   None         <none>        2222/TCP   64m
service/forgejo-http   ClusterIP   None         <none>        3000/TCP   64m

NAME                       READY   AGE
statefulset.apps/forgejo   0/1     64m
My attempt with `sudo deploy.sh` failed because `+ kubectl wait pods -l app=forgejo -n forgejo --for=condition=Ready --timeout=240s` timed out. ``` root@k3s:/home/debian/rome-user# kubectl get all -n forgejo NAME READY STATUS RESTARTS AGE pod/forgejo-0 0/1 Init:CrashLoopBackOff 17 (2m17s ago) 64m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/forgejo-ssh ClusterIP None <none> 2222/TCP 64m service/forgejo-http ClusterIP None <none> 3000/TCP 64m NAME READY AGE statefulset.apps/forgejo 0/1 64m ```
Author
Owner

It was a bug resovled with s/ENV_TO_INI/FORGEJO/, upgrading the helm and restarting. It ends up working fine but no runner deployed, it is not ready yet.

The debug session chat log can be browsed here.

It was a bug resovled with `s/ENV_TO_INI/FORGEJO/`, upgrading the helm and restarting. It ends up working fine but no runner deployed, it is not ready yet. The [debug session chat log can be browsed here](https://matrix.to/#/!zpNKWqkiEOyljSMQDK:matrix.org/$ziT6f7h8Txc2RURYEoYOGrZ-vj0w_4QnIHv3z2xFrso?via=exozy.me&via=matrix.org&via=aria-net.org).
dachary added the
Kind/Enhancement
label 2023-07-15 15:12:22 +00:00
dachary pinned this 2023-07-18 09:28:41 +00:00
dachary unpinned this 2023-07-18 09:30:12 +00:00

i write a small helm-chart, so that an forgejo-runner could stand alone (without forgejo): https://codeberg.org/wrenix/helm-charts/src/branch/main/forgejo-runner

after getting a token from forgejo, it generates on his own (and keep the result .runner in an secret).

i write a small helm-chart, so that an forgejo-runner could stand alone (without forgejo): https://codeberg.org/wrenix/helm-charts/src/branch/main/forgejo-runner after getting a token from forgejo, it generates on his own (and keep the result `.runner` in an secret).
Author
Owner
@wrenix it is worthy of an addition to https://codeberg.org/forgejo-contrib/delightful-forgejo
Author
Owner

Last week the 3.2.0 runner was installed and is ready to run k3s.
the next step is to write a workflow (a shell script really) that launches k3s, runs a Forgejo helm chart, checks that it is not uterly borken.

There is an example to get started at https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/test.yml which runs test_lxc_helpers_k8s which is implemented at https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/lxc-helpers-lib-test.sh#L153-L173

it is a little recursive in the sense that lxc-helpers is used by act which is used by the runner which is used by setup-forgejo which is used to test lxc-helpers. But it's basically a few lines of shell script

Note that runs-on: k8s does not mean that it runs on k8s which is confusing. It means it runs in a LXC container that has the capabilities of running k8s/k3s.

Last week the 3.2.0 runner was installed and is ready to run k3s. the next step is to write a workflow (a shell script really) that launches k3s, runs a Forgejo helm chart, checks that it is not uterly borken. There is an example to get started at https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/test.yml which runs test_lxc_helpers_k8s which is implemented at https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/lxc-helpers-lib-test.sh#L153-L173 it is a little recursive in the sense that lxc-helpers is used by act which is used by the runner which is used by setup-forgejo which is used to test lxc-helpers. But it's basically a few lines of shell script Note that `runs-on: k8s` does not mean that it runs on k8s which is confusing. It means it runs in a LXC container that has the capabilities of running k8s/k3s.
Author
Owner
It is now part of the lxc-helpers testsuite https://code.forgejo.org/forgejo/lxc-helpers/src/branch/main/.forgejo/workflows/test.yml#L13
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: forgejo/runner#55
No description provided.