implement act_runner rootless image #208

Merged
wolfogre merged 6 commits from :feat/rootless-runner into main 2023-06-12 06:35:29 +00:00
Contributor

This PR creates a rootless Docker image that runs both dockerd and act_runner using supervisord. It has been tested locally for a few days and seems stable.

This PR creates a rootless Docker image that runs both `dockerd` and `act_runner` using `supervisord`. It has been tested locally for a few days and seems stable.
ccureau added 1 commit 2023-05-22 15:35:39 +00:00
implement rootless image
All checks were successful
checks / check and test (pull_request) Successful in 2m32s
3452b8cdec
ccureau changed title from WIP: implement rootless image to WIP: implement act_runner rootless image 2023-05-22 16:03:02 +00:00
ccureau added 1 commit 2023-05-22 17:04:02 +00:00
Merge branch 'main' into feat/rootless-runner
All checks were successful
checks / check and test (pull_request) Successful in 1m46s
99bdb39673
ccureau changed title from WIP: implement act_runner rootless image to implement act_runner rootless image 2023-05-23 15:50:10 +00:00
wolfogre reviewed 2023-06-05 06:58:30 +00:00
@ -0,0 +11,4 @@
USER root
RUN apk add --no-cache \
git=2.40.1-r0 bash=5.2.15-r3 supervisor=4.2.5-r2 \
&& rm -rf /var/cache/apk/*
Owner

Just a question, do we need rm -rf /var/cache/apk/* when there's --no-cache?

Just a question, do we need `rm -rf /var/cache/apk/*` when there's `--no-cache`?
Author
Contributor

Nope. I'll remove it. This was in in the original Dockerfile, so I left it as is.

Nope. I'll remove it. This was in in the original Dockerfile, so I left it as is.
ccureau marked this conversation as resolved
@ -0,0 +14,4 @@
&& rm -rf /var/cache/apk/*
COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner
COPY /scripts/supervisord.conf /etc/supervisord.conf
Owner

Why is the source file an absolute path? I mean maybe people want to build on their local env.

Why is the source file an absolute path? I mean maybe people want to build on their local env.
Author
Contributor

I was going back and forth with this one too. It makes sense to build it once and then copy the image into the container image, but at the same time the way it is now sets up for completely clean builds each time without a dependency on golang being installed. Six of one, half dozen of the other.

What do you think?

I was going back and forth with this one too. It makes sense to build it once and then copy the image into the container image, but at the same time the way it is now sets up for completely clean builds each time without a dependency on golang being installed. Six of one, half dozen of the other. What do you think?
Owner

How about

COPY --from=builder /opt/src/act_runner/act_runner/scripts/supervisord.conf /etc/supervisord.conf
COPY --from=builder /opt/src/act_runner/act_runner/scripts/run.sh /opt/act/run.sh

The files exist in the builder too, right?

How about ```dockerfile COPY --from=builder /opt/src/act_runner/act_runner/scripts/supervisord.conf /etc/supervisord.conf COPY --from=builder /opt/src/act_runner/act_runner/scripts/run.sh /opt/act/run.sh ``` The files exist in the builder too, right?
Author
Contributor

They do, but if the builder doesn't change, there's a chance that older files can make it into the newer image.

They do, but if the builder doesn't change, there's a chance that older files can make it into the newer image.
scripts/run.sh Outdated
@ -0,0 +44,4 @@
# Prevent reading the token from the act_runner process
unset GITEA_RUNNER_REGISTRATION_TOKEN
# wait for docker daemon
Owner

This file is also used by

Dockerfile Line 16 in e3271d8469
COPY run.sh /opt/act/run.sh

Maybe we should update the path in Dockerfile as well, and add an additional environment variable to determine whether to wait for the docker daemon.

This file is also used by https://gitea.com/gitea/act_runner/src/commit/e3271d8469b605cc1a380b6e1e835aff6178170a/Dockerfile#L16 Maybe we should update the path in `Dockerfile` as well, and add an additional environment variable to determine whether to wait for the docker daemon.
ccureau marked this conversation as resolved
wolfogre added the
kind
build
label 2023-06-05 06:58:39 +00:00
techknowlogick reviewed 2023-06-05 14:49:18 +00:00
techknowlogick left a comment
Owner

thanks for the PR! I've made a few minor comments :)

thanks for the PR! I've made a few minor comments :)
@ -0,0 +1,24 @@
FROM golang:1.20-alpine3.17 as builder

please target alpine 3.18

please target alpine 3.18
ccureau marked this conversation as resolved
@ -0,0 +1,24 @@
FROM golang:1.20-alpine3.17 as builder
# Do not remove `git` here, it is required for getting runner version when executing `make build`
RUN apk add --no-cache make=4.3-r1 git=2.38.5-r0

no need to target specific versions of packages

no need to target specific versions of packages
Owner

hadolint-action asks for it, see #190 (comment)

hadolint-action asks for it, see https://gitea.com/gitea/act_runner/pulls/190#issuecomment-740325

until we get renovate up and running, I think we should skip hardcoding then.

until we get renovate up and running, I think we should skip hardcoding then.
Owner

I see, so should we remove hadolint-action?

I see, so should we remove `hadolint-action`?
Member

Yes. maybe we should remove the hadolint-action

Yes. maybe we should remove the `hadolint-action`
Owner
#234
wolfogre marked this conversation as resolved
wolfogre added 1 commit 2023-06-09 02:54:46 +00:00
Merge branch 'main' into feat/rootless-runner
All checks were successful
checks / check and test (pull_request) Successful in 1m6s
e95566afca
Owner

@ccureau Could you please follow #234? I know I pushed a little hard, but I really want merge this PR. 😂

@ccureau Could you please follow #234? I know I pushed a little hard, but I really want merge this PR. 😂
Author
Contributor

@ccureau Could you please follow #234? I know I pushed a little hard, but I really want merge this PR. 😂

You didn't push hard at all! I've just been busy as we had a RIF at work. I'll get it done today.

> @ccureau Could you please follow #234? I know I pushed a little hard, but I really want merge this PR. 😂 You didn't push hard at all! I've just been busy as we had a RIF at work. I'll get it done today.
ccureau added 1 commit 2023-06-10 12:12:01 +00:00
additional comments
All checks were successful
checks / check and test (pull_request) Successful in 58s
b8f9e7fc75
ccureau added 1 commit 2023-06-10 12:16:11 +00:00
Additional documentation
All checks were successful
checks / check and test (pull_request) Successful in 53s
55e7f13aee
Author
Contributor

@wolfogre That should take care of all of the suggestions above!

@wolfogre That should take care of all of the suggestions above!
ccureau added 1 commit 2023-06-10 12:36:28 +00:00
Merge branch 'main' into feat/rootless-runner
All checks were successful
checks / check and test (pull_request) Successful in 53s
ec067f8a44
wolfogre approved these changes 2023-06-12 06:34:43 +00:00
wolfogre merged commit 341d49a24d into main 2023-06-12 06:35:29 +00:00
Sign in to join this conversation.
No description provided.