diff --git a/.gitea/runner/cloud-init.yaml b/.gitea/runner/cloud-init.yaml new file mode 100644 index 0000000..dfaff0a --- /dev/null +++ b/.gitea/runner/cloud-init.yaml @@ -0,0 +1,58 @@ +#cloud-config +# Gitea Actions runner on an Oracle Cloud Always Free Ampere (ARM) VM, shared by +# every repo on the instance. +# +# Paste this into "Advanced options -> Management -> Initialization script" when +# creating the instance (image: Canonical Ubuntu 24.04, shape: VM.Standard.A1.Flex). +# Before pasting, replace REGISTRATION_TOKEN below with an instance-wide token: +# Site Administration -> Actions -> Runners -> Create new runner +# (a token from repo Settings would limit the runner to that one repo). +# +# The runner only makes outbound connections (to Gitea and container registries), +# so the VM needs no inbound ports beyond SSH. +# +# Labels follow the instance convention (same set as the freebox ARM runner). +# ubuntu-latest / ubuntu-22.04 are shared with the amd64 runner, so a job asking +# for them may land on either architecture; ask for linux/arm64 or linux/amd64 +# when a job needs a specific one. SRF Play jobs run in the multi-arch +# srfplay-builder image, so they work on both. + +# Optional: a password for the "ubuntu" user, so you can log in through the Oracle +# serial console ("Launch Cloud Shell connection") without an SSH key. Generate the +# hash locally with: openssl passwd -6 +# then uncomment and paste it in. SSH still only accepts keys. +#chpasswd: +# expire: false +# users: +# - name: ubuntu +# password: "$6$...paste the hash here..." + +package_update: true +packages: + - docker.io + - docker-compose-v2 + +write_files: + - path: /opt/act_runner/docker-compose.yml + permissions: "0600" + content: | + services: + runner: + image: gitea/act_runner:latest + restart: unless-stopped + environment: + GITEA_INSTANCE_URL: https://gitea.tourolle.paris + GITEA_RUNNER_REGISTRATION_TOKEN: REGISTRATION_TOKEN + GITEA_RUNNER_NAME: oracle-a1 + # Comma-separated with no spaces: label:docker:// + GITEA_RUNNER_LABELS: "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest,ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04,linux-arm64:docker://gitea/runner-images:ubuntu-latest,self-hosted:docker://gitea/runner-images:ubuntu-latest,linux/arm64:docker://gitea/runner-images:ubuntu-latest" + volumes: + # Registration is stored here, so the token is only used once. + - ./data:/data + - /var/run/docker.sock:/var/run/docker.sock + +runcmd: + - systemctl enable --now docker + - cd /opt/act_runner && docker compose up -d + # Weekly clean-up so pulled images and build caches do not fill the boot volume. + - echo '0 4 * * 0 root docker system prune -af --filter "until=168h" >/dev/null 2>&1' > /etc/cron.d/docker-prune diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 739469c..6964c5f 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -15,7 +15,7 @@ on: jobs: build: - runs-on: linux/amd64 + runs-on: ubuntu-latest container: image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest diff --git a/.gitea/workflows/latest.yaml b/.gitea/workflows/latest.yaml index a1f230a..6bc3b9d 100644 --- a/.gitea/workflows/latest.yaml +++ b/.gitea/workflows/latest.yaml @@ -11,7 +11,7 @@ on: jobs: nightly-build: - runs-on: linux/amd64 + runs-on: ubuntu-latest container: image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index ce850e3..e6fa316 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -13,7 +13,7 @@ on: jobs: build-and-release: - runs-on: linux/amd64 + runs-on: ubuntu-latest container: image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index f748229..3b2e386 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -17,7 +17,7 @@ on: jobs: test: - runs-on: linux/amd64 + runs-on: ubuntu-latest container: image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest diff --git a/Dockerfile.builder b/Dockerfile.builder index 7929dc6..b6c03bd 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -1,7 +1,10 @@ # SRFPlay Builder Image # Pre-built image with .NET SDK and JPRM for building Jellyfin plugins -# Build: docker build -f Dockerfile.builder -t gitea.tourolle.paris/dtourolle/srfplay-builder:latest . -# Push: docker push gitea.tourolle.paris/dtourolle/srfplay-builder:latest +# Multi-arch (amd64 + arm64) so runners on ARM hosts such as Oracle Cloud's free +# Ampere VMs can use it too; the plugin DLLs it produces are identical either way. +# Build + push (needs a docker-container buildx builder and arm64 binfmt/QEMU): +# docker buildx build -f Dockerfile.builder --platform linux/amd64,linux/arm64 \ +# -t gitea.tourolle.paris/dtourolle/srfplay-builder:latest --push . FROM mcr.microsoft.com/dotnet/sdk:10.0