fix(forge): use non-containerized runner

This commit is contained in:
Marc 2024-03-30 10:07:01 -04:00
parent fb8aa899e7
commit ffa0a3175f
Signed by: marc
GPG key ID: 048E042F22B5DC79
3 changed files with 25 additions and 14 deletions

View file

@ -7,7 +7,7 @@ Forgejo instance serving https://forge.karnov.club.
### Starting / restarting ### Starting / restarting
```bash ```bash
FORGEJO_ROOT=.. FORGEJO_RUNNER_ROOT=... FORGEJO_RUNNER_CONFIG=... ./start.sh FORGEJO_ROOT=.. FORGEJO_RUNNER_ROOT=... ./start.sh
``` ```
`FORGEJO_ROOT` should be a directory with read+write access by the container user, this is where application data will `FORGEJO_ROOT` should be a directory with read+write access by the container user, this is where application data will
@ -15,10 +15,10 @@ get stored.
`FORGEJO_RUNNER_ROOT` should also be read+write accessible and will be where the runner stores data. `FORGEJO_RUNNER_ROOT` should also be read+write accessible and will be where the runner stores data.
`FORGEJO_RUNNER_CONFIG` should point to the runner configuration YAML file. If undefined, the default included with the scripts is used.
Calling the `start.sh` script will replace the containers if they already exists. Calling the `start.sh` script will replace the containers if they already exists.
Note that the runner(s) must be registered and started manually.
### Stopping ### Stopping
```bash ```bash

View file

@ -19,6 +19,8 @@ podman pod create \
--replace \ --replace \
"code-forge" "code-forge"
# Start webapp.
podman run \ podman run \
-td \ -td \
--name "code-forge_app" \ --name "code-forge_app" \
@ -37,14 +39,21 @@ until [[ $response = *"200 OK"* ]]; do
echo "Waiting for app to respond..." echo "Waiting for app to respond..."
done done
podman run \ wget -O "$FORGEJO_RUNNER_ROOT"/forgejo-runner https://code.forgejo.org/forgejo/runner/releases/download/v3.3.0/forgejo-runner-3.3.0-linux-amd64
--pod "code-forge" \ chmod +x "$FORGEJO_RUNNER_ROOT"/forgejo-runner
--user root \ wget -O forgejo-runner.asc https://code.forgejo.org/forgejo/runner/releases/download/v3.3.0/forgejo-runner-3.3.0-linux-amd64.asc
-td \ gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
--name "code-forge_runner" \ gpg --verify forgejo-runner.asc "$FORGEJO_RUNNER_ROOT"/forgejo-runner
--pod "code-forge" \ rm forgejo-runner.asc
-v "$FORGEJO_RUNNER_ROOT":/data \
-v "${FORGEJO_RUNNER_CONFIG:=./config.yml}":/data/config.yml \
-v "$XDG_RUNTIME_DIR"/podman/podman.sock:/var/run/docker.sock \ if [ -f "$FORGEJO_RUNNER_ROOT/.runner" ]; then
code.forgejo.org/forgejo/runner:3.3.0 \ echo "Found runner state."
forgejo-runner --config config.yml daemon (
cd "$FORGEJO_RUNNER_ROOT" || exit
"$FORGEJO_RUNNER_ROOT"/forgejo-runner --config "${FORGEJO_RUNNER_CONFIG:=./config.yml}" daemon &
)
else
echo "Use $FORGEJO_RUNNER_ROOT/forgejo-runner register ... to register the runner"
echo "Once registered, use $FORGEJO_RUNNER_ROOT/forgejo-runner --config <path-to-config> daemon & to start"
fi

View file

@ -1,3 +1,5 @@
#!/usr/bin/bash #!/usr/bin/bash
podman pod stop "code-forge" podman pod stop "code-forge"
echo "WARN: The runner process must be stopped manually since it's not a container."