Self hosted runners - ARC
alex9fredericks opened this issue · 6 comments
What is the issue?
The issue I'd like to log, just more FYI, is that it seems that you cannot run the GitHub Dagger action, out of the box, with self hosted runners, on Kubernetes. I installed the ARC for GitHub, with Helm, with the quick-start guide. (With Helm, this was actually quite easy to install). I managed to register some runners, and most of the workflows just run fine. For reference, workflows that used the "docker/build-push-action@v4.1.0", did work right away.
Dagger version
dagger v0.9.3
Steps to reproduce
Problem and Solution (1)
The following script works fine with GitHub runners but not with ARC:
name: 40_dagger_demo.yaml
permissions:
contents: read
packages: write
on:
push:
branches:
- main
paths:
- 'apps/demo/**’
- '.github/workflows/dagger_demo.yaml'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: build
# runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: '* Install dagger-io'
run: pip install dagger-io
- name: '* Run Dagger pipeline'
uses: dagger/dagger-for-github@v5
with:
workdir: apps/demo
verb: run
args: python main.py "${{ secrets.DAGGER_KEY }}" github_username
version: "0.9.3"
![error](https://private-user-images.githubusercontent.com/155155202/293357237-ee945be0-a528-4622-b1e0-0b170922753b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNTY4ODIsIm5iZiI6MTcyMDE1NjU4MiwicGF0aCI6Ii8xNTUxNTUyMDIvMjkzMzU3MjM3LWVlOTQ1YmUwLWE1MjgtNDYyMi1iMWUwLTBiMTcwOTIyNzUzYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNVQwNTE2MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xNzU1NzRjNGM1YjBiZjMzNWYzNDUxYjc5NzMzZDJlMjMwN2ZmNmE1NmNlMDVlNTk3YzEzZmI0MWYwNjcxMjVkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.tJiVxRZ1kAUgfB20mHK__YvYGtH6H2SPvBIzOU0_biE)
Solution
This is my workaround for the moment!! 😄 :
steps:
- name: '* Setup python'
uses: actions/setup-python@v5
with:
python-version: 'pypy3.10'
- name: '* Check out the repo'
uses: actions/checkout@v4
- name: '* Install manual'
run: pip install anyio dagger-io==0.9.3
- name: '* Run Dagger Pipeline'
run: cd $GITHUB_WORKSPACE/apps/demo/ && python main.py "${{ secrets.DAGGER_KEY }}" github_username
Another varation that still does not work (2)
I also tried another variation, based on a suggestion from @marcosnils!
This still produces another error:
name: 40_dagger_demo.yaml
permissions:
contents: read
packages: write
on:
push:
branches:
- main
paths:
- 'apps/demo/**'
- '.github/workflows/40_dagger_demo.yaml'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: build
# ---
# runs-on: ubuntu-latest
# ---
runs-on: self-hosted
steps:
- name: '* Setup python'
uses: actions/setup-python@v5
with:
python-version: 'pypy3.10'
- name: '* Check out the repo'
uses: actions/checkout@v4
- name: '* Run Dagger pipeline'
uses: dagger/dagger-for-github@v5
with:
workdir: apps/demo
verb: run
args: python main.py "${{ secrets.DAGGER_KEY }}" github_username
version: "0.9.3"
![best-error-2](https://private-user-images.githubusercontent.com/155155202/293357901-af4f2671-4e61-464e-89b7-0b35623f4964.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNTY4ODIsIm5iZiI6MTcyMDE1NjU4MiwicGF0aCI6Ii8xNTUxNTUyMDIvMjkzMzU3OTAxLWFmNGYyNjcxLTRlNjEtNDY0ZS04OWI3LTBiMzU2MjNmNDk2NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNVQwNTE2MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02N2U0NzVjZDI5MDQwNzU0ODY4MDM5NmQzZjJmNjBhZmUxYTgzNTI4MWZmMGY4ODM1MzU0NDllY2UyYWFlY2U5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.uLHJaB6rkvC_-rJSy87DnvwHpD4dzx93FjqcRTC2a70)
Log output
No response
The following script works fine with GitHub runners but not with ARC:
Just checked this and it happens because summerwind/actions-runner-dind
docker image has an old version of python (3.8) that it's not supported by the dagger python SDK.
Another varation that still does not work (2)
this seemed to work, it's the docker stop
part that failed after running the pipeline since it seems like the dagger engine wasn't started. @alex9fredericks could it be possible that the python main.py
is not currently running a dagger pipeline in this case?
In any case we should handle this gracefully also.
Just checked this and it happens because summerwind/actions-runner-dind docker image has an old version of python (3.8) that it's not supported by the dagger python SDK.
Yes!! This is a big part of the solution. Here is some yaml to get Summerwind’s ubuntu 22.04 runner:
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
name: runnerdeploy-for-testing
spec:
replicas: 1
template:
spec:
repository: git_username/repo
ephemeral: false
image: ghcr.io/git_username/actions-runner-dind:ubuntu-22.04 # < nice
imagePullSecrets:
- name: regcred
@alex9fredericks could it be possible that the python main.py is not currently running a dagger pipeline in this case?
True, we never get to run a pipeline. The issue is, that the Summerwind image user that runs everything, runner:runner
does not have access to the folder /usr/local/
, at least, cannot write the dagger
binary to it, and therefore the Dagger For GitHub Action fails (here). It would work if you do this, with sudo:
cd /usr/local && { \
curl -sL https://dl.dagger.io/dagger/install.sh 2>/dev/null | DAGGER_VERSION=0.9.3 sudo sh
What you can also do, is run a custom version of the Summerwind docker image. Here I change the owernship of the folder /usr/local/bin to runner, and now it all works!
# file
# ---
# /apps/actions-runner-dind/Dockerfile
FROM summerwind/actions-runner-dind:ubuntu-22.04
USER root
RUN apt update -y && \
apt install -y --no-install-recommends \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN chown -R runner:runner /usr/local/bin/
USER runner
![Screenshot 2023-12-31 at 11 56 20 PM](https://private-user-images.githubusercontent.com/155155202/293524754-3b9e604c-bb0c-47d9-96af-1e58d5ce729e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNTY4ODIsIm5iZiI6MTcyMDE1NjU4MiwicGF0aCI6Ii8xNTUxNTUyMDIvMjkzNTI0NzU0LTNiOWU2MDRjLWJiMGMtNDdkOS05NmFmLTFlNThkNWNlNzI5ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNVQwNTE2MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MWRhYTdjNGFiYjU1N2FkZDNkMzY3MGNiZTYwYmFmNTFjMjQyYmY4NTQ4OWQ2NTIwOWI4M2QzZTEwM2U4YjQ3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.JPx2toUMFypFoy2AtvJKZe5Em7G5ZbACNHanKW5AsKU)
This PR #105 fixes the /use/local path issue. This problem will be resolved in the next release
@alex9fredericks Please confirm that you're good to go with the v5.1.0
release 🙏
https://github.com/marketplace/actions/dagger-for-github
Hey @jpadams, everything worked fine at the first run! :)
This test was done with a simplified runner image:
FROM summerwind/actions-runner-dind:ubuntu-22.04
USER root
RUN apt update -y && \
apt install -y --no-install-recommends \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
USER runner