Commit Graph

155 Commits

Author SHA1 Message Date
Callum Tait a8417ec67e
feat: dind-rootless 22.04 runner (#2033)
* feat: dind-rootless 22.04 runner

* runner: Bring back packages needed by rootlesskit

* e2e: Update E2E buildvars with ubuntu 22.04 dockerfiles

* feat: use new uid for runner user

* e2e: Make it possible to inject ubuntu version via envvar for actiosn-runner-dind image

* doc: Use fsGroup=1001 for IRSA on Ubuntu 22.04 runner

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-07 19:02:35 +09:00
Callum Tait 775dc60c94
feat: dind 22.04 runner (#2030)
* feat: dind 22.04 runner

* chore: remove zstd

* chore: remove test

* chore: add missing make targets and bcump

* runner: Add missing iptables package to dind ubuntu 22.04

* feat: use new ids

* feat: use new ids

* Revert "feat: use new ids"

This reverts commit 2e4e2bb6d9.

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-07 14:20:45 +09:00
Yusuke Kuoka ecd7531917
feat: Set runner UID and docker GID to match github actions runner (#2077)
This is a successor to #1688

Co-authored-by: Suhas Gaddam <sgaddam@trueaccord.com>
2022-12-07 14:17:57 +09:00
Callum Tait ad1989072e
feat: use new uid for 22.04 images (#2079)
* feat: use new uid for 22.04 images

* feat: use new gid for docker group

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-12-07 14:14:31 +09:00
Callum Tait 212b9daec3
feat: 22.04 default runner image (#2050)
* feat: 22.04 default runner image

* docs: update bundled software

* chore: remove test in Dockerfile

* ci: add 22.04 runner build

* chore: remove build-essential

* chore: remove python path entry

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-12-02 07:29:59 +09:00
Callum Tait c1fb793773
feat: bump docker and hooks in 20.04 (#2063)
Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-12-02 06:40:12 +09:00
Callum Tait 63d2cbfdaa
ci: multiple ubuntu version (#2036)
* ci: prepare ci for multiple runners

* chore: rename dockerfiles

* chore: sup multiple os in makefile

* chore: changes to support multiple versions

* chore: remove test for TARGETPLATFORM

* chore: fixes and add individual targets

* ci: add latest tag back in

* ci: remove latest suffix tag

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-12-01 00:00:16 +09:00
Igor Sarkisov 95c324b550
Add rootless runner to the Makefile and improve target platform handling. (#2005)
* Add rootless runner to the Makefile and improve target platform handling

* Add rootless image to docker-push-ubuntu target

* Update runner/Makefile

* Update runner/actions-runner-dind-rootless.dockerfile

* Update runner/actions-runner-dind.dockerfile

* Update runner/actions-runner.dockerfile

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-26 18:10:26 +09:00
Callum Tait 87f566e1e6
feat: add docker-compose and clean up the default runner (#1924)
* feat: clean and add docker-compose

* feat: make docker compose download arch aware

* fix: use new ARG name

* fix: correct case in url

* ci: add some debug output to workflow

* ci: add ARG for docker

* fix: various fixes

* chore: more alignment changes

* chore: use /usr/bin over /usr/local/bin

* chore: more logical order

* fix: add recursive flag

* chore: actions/runner stuff with actions/runner

* ci: bump checkout to latest

* fix: rootless build

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-25 10:31:13 +09:00
Callum Tait 666ce8f917
feat: add docker-compose and clean up the dind runner (#1925)
* feat: align runner and add docker compose

* feat: make docker compose download arch aware

* fix: use new ARG name

* chore: alignment stuff

* chore: use /usr/bin over /usr/local/bin

* chore: replicate default runner order

* feat: set-up actions container hooks

* chore: small flags

* fix: install all docker components

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-11-22 12:10:38 +09:00
Callum Tait 9ba4b6b96a
chore: clean up the dind rootless dockerfile so it aligns with the other runners (#1926)
* chore: align dockerfile with other runners

* chore: superfluous comments

* feat: make docker compose download arch aware

* chore: stuff

* chore: align runner tool cache set-up

* fix: copy and paste error

* feat: add container hooks

* feat: add rootless into makefile

* feat: support all architectures and fix compose

* fix: export SKIP_IPTABLES correctly

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-11-22 12:10:28 +09:00
Yusuke Kuoka 154fcde7d0
runner: Make WAIT_FOR_DOCKER_SECONDS configurable and working (#1999)
* runner: Make WAIT_FOR_DOCKER_SECONDS configurable and working

Ref #1830
Ref #1804

* Update acceptance/testdata/runnerdeploy.envsubst.yaml

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>

* Update docs/detailed-docs.md

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>
2022-11-22 12:08:54 +09:00
Richard Fussenegger 61d1235d2a
Added `DEBIAN_FRONTEND=noninteractive` to `sudo` (#1859)
By default `sudo` drops all environment variables and executes its commands with a clean environment. This is by design, but for the `DEBIAN_FRONTEND` environment variable it is not what we want, since it results in installers being interactive. This adds the `env_keep` instruction to `/etc/sudoers` to keep `DEBIAN_FRONTEND` with its `noninteractive` value, and thus pass it on to commands that care about it. Note that this makes no difference in our builds, because we are running them directly as `root`. However, for users of our image this is going to make a difference, since they start out as `runner` and have to use `sudo`.

Co-authored-by: Fleshgrinder <fleshgrinder@users.noreply.github.com>
2022-11-05 17:20:53 +09:00
Claudio Vellage 3b36a81db6
Allow to set docker default address pool (#1971)
* Allow to set docker default address pool

* fixup! Allow to set docker default address pool

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Revert unnecessary chart ver bump

* Update docs for DOCKER_DEFAULT_ADDRESS_POOL_*

* Fix the dockerd default address pool scripts to actually work as probably intended

* Update the E2E testdata runnerdeployment to accomodate the new docker default addr pool options

* Correct default dockerd addr pool doc

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
Co-authored-by: Claudio Vellage <claudio.vellage@pm.me>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-05 14:46:32 +09:00
Yusuke Kuoka 63e8f32281
Fix permission issue when you use PV for rootless dind cache (#1977)
* Fix permission issue when you use PV for rootless dind cache

This fixes the said issue I have found while testing #1759.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-04 06:46:21 +09:00
Yusuke Kuoka 8505c95719
runner: Fix rootless dind to respect specified MTU (#1976)
While testing #1759, I found an issue in the rootless dind entrypoint that it was not respecting the configured MTU for dind docker due to a permission issue. This fixes that.
2022-11-04 06:29:03 +09:00
Yusuke Kuoka 3de8085b87
Fix rootless dind to do write logs (#1978)
It turned out too hard to debug configuration issues on the rootless dind daemon as it was not writing any logs to stdout/stderr of the container. This fixes that, so that any rootless dind configuration or startup errors are visible in e.g. the kubectl-logs output.
2022-11-04 06:28:47 +09:00
renovate[bot] 6234c568bd
chore(deps): update dependency actions/runner to v2.299.1 (#1973)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-03 14:40:06 +09:00
Yusuke Kuoka c74ad6195f
Fix runners to do their best to gracefully stop on pod eviction (#1759)
Ref #1535
Ref #1581

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-01 20:30:10 +09:00
Yusuke Kuoka e1762ba746
Fix inability to configure MTU for rootless dind runner (#1856)
Follow-up for https://github.com/actions-runner-controller/actions-runner-controller/pull/1644
2022-10-13 09:04:56 +09:00
renovate[bot] 437d0173b0
chore(deps): update dependency actions/runner to v2.298.2 (#1891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-05 08:16:38 +09:00
Yusuke Kuoka 2dd13b4a19
runner: Address all shellcheck findings (#1854)
I am about to revisit #1517, #1454, #1561, and #1560 as a part of our on-going effort for a major enhancement to the runner entrypoints being made in #1759.

This change updates and reintroduces #1517 contributed by @CASABECI in a way it becomes applicable to today's code-base.
2022-10-04 20:30:27 +09:00
renovate[bot] 5fd6ec4bc8
chore(deps): update dependency actions/runner to v2.297.0 (#1860)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-27 09:11:53 +09:00
Yusuke Kuoka f3fcb428ae rootless-dind-dockerfile: Add comment about installation path 2022-09-25 07:50:12 +09:00
Yusuke Kuoka 41bae32a9f runner: Dump supervisor log on dockerd timeout 2022-09-25 07:50:12 +09:00
Yusuke Kuoka e5bb130fda Add MTU propagation docker-shim also to rootless dind runner images
Related to #1201
2022-09-25 07:50:12 +09:00
Tiago Melo e7a21cfc53
feat: Add container to propagate host network MTU (#1201)
* feat: Add container to propagate host network MTU

Some network environments use non-standard MTU values. In these
situations, the `DockerMTU` setting might be used to specify the MTU
setting for the `bridge` network created by Docker. However, when the
Github Actions workflow creates networks, it doesn't propagate the
`bridge` network MTU which can lead to `connection reset by peer`
messages.

To overcome this, I've created a new docker image called
`summerwind/actions-runner-mtu` that shims the docker binary in order to
propagate the MTU setting to networks created by Github workflows.

This is a follow-up on the discussion in
(#1046)[https://github.com/actions-runner-controller/actions-runner-controller/issues/1046]
and uses a separate image since there might be some unintended
side-effects with this approach.

* fixup! feat: Add container to propagate host network MTU

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-23 17:08:28 +09:00
Frederic MARTIN e32a8054d0
🍱 add git-lfs package as standard tool (#1821) 2022-09-21 11:04:43 +09:00
David Girón e4fd4bc99c
Update dependency docker/cli to v20.10.18 (#1803) 2022-09-16 10:25:12 +09:00
renovate[bot] 0615c2adb1
chore(deps): update dependency actions/runner to v2.296.2 (#1791)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-09 18:43:00 +09:00
renovate[bot] e233f7ad6a chore(deps): update dependency actions/runner to v2.296.1 2022-09-01 12:31:39 +00:00
renovate[bot] 55ca7bfdf5 chore(deps): update dependency actions/runner to v2.296.0 2022-08-23 19:47:18 +00:00
Callum Tait 3724b46033
chore(deps): update dependency actions/runner to v2.295.0 (#1723) 2022-08-16 20:11:46 +09:00
renovate[bot] 784019f3d7 chore(deps): update dependency actions/runner to v2.295.0 2022-08-11 11:36:27 +00:00
Natalie Somersall fc55477c1c
remove fuse-overlayfs (#1690) 2022-08-04 13:25:55 +09:00
Natalie Somersall 37aa1a0b8c
Add rootless DinD runner (#1644)
* add rootless dind images

* add small blurb on rootless dind

* Add ToC entry for README section
2022-08-03 11:45:02 +09:00
k.bigwheel (kazufumi nishida) 98b17dc0a5
Fix the dind image to work with the latest entrypoint.sh (#1624)
Fixes #1621
2022-07-12 09:11:04 +09:00
Giovanni Barillari c658dcfa6d fix #1621: add missing COPY statements to dind docker image 2022-07-11 20:44:35 +09:00
Felipe Galindo Sanchez 11cb9b7882
feat: allow to discover runner statuses (#1268)
* feat: allow to discover runner statuses

* fix manifests

* Bump runner version to 2.289.1 which includes the hooks support

* Add feedback from review

* Update reference to newRunnerPod

* Fix TestNewRunnerPodFromRunnerController and make hooks file names job specific

* Fix additional TestNewRunnerPod test

* Cover additional feedback from review

* fix rbac manager role

* Add permissions to service account for container mode if not provided

* Rename flag to runner.statusUpdateHook.enabled and fix needsServiceAccount

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-07-10 15:11:29 +09:00
Callum Tait e3deb0d752
chore: move runner docker check (#1548) 2022-06-30 11:31:50 +09:00
Callum Tait 82641e5036
chore: move HOME to more logical place (#1460)
* chore: move HOME to more logical place

* chore: don't break the PATH

* chore: don't break the PATH

Co-authored-by: toast-gear <toast-gear@users.noreply.github.com>
2022-06-30 11:21:05 +09:00
Vladyslav Miletskyi 2fe6adf5b7
Runner Entrypoint: fix daemon.json (#1409)
* Runner Entrypoint: fix daemon.json

Do not owerwrite daemon.json if it already exists.
Usage: custom images, which are using public image as source.

* Update runner/startup.sh

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>
2022-06-30 11:03:12 +09:00
Yusuke Kuoka 9b28e633c1
Drop support for --once (#1580)
Ref #1196
2022-06-29 21:49:52 +09:00
Thomas Boop 0386c0734c
`containerMode` option to allow running jobs in k8's instead of docker (#1546)
* added containerMode=kubernetes env variables to the runner

* removed unused logging

* restored configs and charts

* restored makefile cert version and acceptance/run

* added workVolumeClaimTemplate in pod definition, including logic

* added claim template name based on the runner

* Apply suggestions from code review

update errors

* added concurrent cleanup before runner pod is deleted

* update manifests

* added retry after 30s if pod cleanup contains err

* added admission webhook check, made workVolumeClaimTemplate mandatory for k8s

* style changes and added comments

* added izZero timestamp check for deleting runner-linked pods

* changed order of local variable to avoid copy if p is deleted

* removed docker from container mode k8s

* restored charts, config, makefile

* restored forked files back and not the ARC ones

* created PersistentVolume on containerMode k8s

* create pv only if storage class name is local-storage

* removed actions if storage class name is local-storage

* added service account validation if container mode kubernetes

* changed the coding style to match rest of the ARC

* added validation to the runnerdeployment webhook

* specified fields more precisely, added webhook validation to the replicaset as well

* remake manifests

* wraped delete runner-linked-pods in kube mode

* fixed empty line

* fixed import

* makefile changes for hooks

* added cleanup secrets

* create manifests

* docs

* update access modes

* update dockerfile

* nit changes

* fixed dockerfile

* rewrite allowing reuse for runners and runnersets

* deepcopy forgot to stage

* changed privileged

* make manifests

* partly moved to finalizer, still need to apply finalizer first

* finalizer added if env variable used in container mode exists

* bump runner version

* error message moved from Error to Info on cleanup pods/secrets

* removed useless dereferencing, added transformation tests of workVolumeClaimTemplate

* Apply suggestions from code review

* Update controllers/utils_test.go

Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com>

* Update controllers/utils_test.go

Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com>

* add hook version to cli, update to 0.1.2

* Apply suggestions from code review

* Update controllers/utils_test.go

* Update runner/Makefile

* Fix missing secret permission and the error handling

* Fix a runnerpod reconciler finalizer to not trigger unnecessary retry

Co-authored-by: Nikola Jokic <nikola-jokic@github.com>
Co-authored-by: Nikola Jokic <97525037+nikola-jokic@users.noreply.github.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-06-28 14:12:40 +09:00
Callum Tait 84d16c1c12
revert: "Overhauled `startup.sh` Script (#1454)" (#1561)
This reverts commit 071898c96b.
2022-06-23 12:39:32 +01:00
Richard Fussenegger 071898c96b
Overhauled `startup.sh` Script (#1454)
This overhaul turns it into a shellcheck valid script with explicit error handling for all possible situations I could think of. This change takes https://github.com/actions-runner-controller/actions-runner-controller/pull/1409 into account and things can be merged in any order. There are a few important changes here to the logic:

- The wait logic for checking if docker comes up was fundamentally flawed because it checks for the PID. Docker will always come up and thus become visible in the process list, just to immediately die when it encounters an issue, after which supervisor starts it again. This means that our check so far is flaky due to the `sleep 1` it might encounter a PID, or it might not, and the existence of the PID does not mean anything. The `docker ps` check we have in the `entrypoint.sh` script does not suffer from this as it checks for a feature of docker and not a PID. I thus entirely removed the PID check, and instead I am handing things over to our `entrypoint.sh` script by setting the environment variables correctly.
- This change has an influence on the `docker0` interface MTU configuration, because the interface might or might not exist after we started docker. Hence, I changed this to a time boxed loop that tries for one minute to set up the interface's MTU. In case the command fails we log an error and continue with the run.
- I changed the entire MTU handling by validating its value before configuring it, logging an error and continuing without if it is set incorrectly. This ensures that we are not going to send our users on a bug hunt.
- The way we started supervisord did not make much sense to me. It sends itself into the background automatically, there is no need for us to do so with Bash.

The decision to not fail on errors but continue is a deliberate choice, because I believe that running a build is more important than having a perfectly configured system. However, this strategy might also hide issues for all users who are not properly checking their logs. It also makes testing harder. Hence, we could change all error conditions from graceful to panicking. We should then align the exit codes across `startup.sh` and `entrypoint.sh` to ensure that every possible error condition has its own unique error code for easy debugging.
2022-06-23 09:37:01 +09:00
renovate[bot] f24e2fa44e chore(deps): update dependency actions/runner to v2.294.0 2022-06-22 21:45:32 +00:00
Renovate Bot 933b0c7888 chore(deps): update dependency actions/runner to v2.293.0 2022-06-13 17:09:29 +00:00
renovate[bot] ac27df8301
chore(deps): update dependency actions/runner to v2.292.0 (#1475)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-05-27 09:49:46 +09:00
Bernardo Meurer bf45aa9f6b
refactor(runner/entrypoint): don't mv externalstmp if it's not there (#1315) 2022-05-16 18:37:37 +09:00