docker-compose example #72

Merged
earl-warren merged 1 commit from earl-warren/runner:wip-dind into main 2023-08-26 09:54:40 +00:00
Owner

Test run at https://code.forgejo.org/earl-warren/runner/actions/runs/185


Goal

  • build runner binaries
  • launch the runner in a docker-compose
  • add the example to a workflow

Container image design

KISS

  • it contains a single command, forgejo-runner
  • the working directory and the HOME are /data
  • the user and group ids are 1000:1000

The /data directory is mounted from the host or another volume and contain

  • config.yaml
  • .runner

Examples

Using the host docker server

Assuming the docker group is GID 133

docker run -v /var/run/docker.sock:/var/run/docker.sock  -v /tmp/data:/data --user 1000:133 --rm code.forgejo.org/forgejo/runner:latest --config runner-config.yaml daemon

Using dind

  • in the examples/docker-compose directory
  • add a workflow to verify the docker-compose file works

Other implementations

Test run at https://code.forgejo.org/earl-warren/runner/actions/runs/185 --- ## Goal - [x] build runner binaries - [x] launch the runner in a docker-compose - [x] add the example to a workflow ## Container image design KISS - it contains a single command, `forgejo-runner` - the working directory and the HOME are `/data` - the user and group ids are 1000:1000 The `/data` directory is mounted from the host or another volume and contain - config.yaml - .runner ## Examples ### Using the host docker server Assuming the docker group is GID 133 ``` docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/data:/data --user 1000:133 --rm code.forgejo.org/forgejo/runner:latest --config runner-config.yaml daemon ``` ### Using dind - [x] in the examples/docker-compose directory - [x] add a workflow to verify the docker-compose file works ## Other implementations * https://github.com/vegardit/docker-gitea-act-runner * https://gitea.com/gitea/act_runner/src/branch/main/Dockerfile.rootless
earl-warren added the
Kind/Enhancement
label 2023-08-23 20:13:59 +00:00
earl-warren added 1 commit 2023-08-23 20:14:01 +00:00
All checks were successful
checks / check and test (pull_request) Successful in 37s
2408c9134d
general purpose rootless container
earl-warren force-pushed wip-dind from 2408c9134d to 1945384266 2023-08-24 10:28:41 +00:00 Compare
earl-warren force-pushed wip-dind from 1945384266 to 238b5f3ea9 2023-08-25 12:26:13 +00:00 Compare
earl-warren force-pushed wip-dind from 238b5f3ea9 to a23d446757 2023-08-25 12:33:59 +00:00 Compare
earl-warren force-pushed wip-dind from a23d446757 to 146cb46e53 2023-08-25 12:45:53 +00:00 Compare
earl-warren force-pushed wip-dind from 146cb46e53 to 8286ebaf9b 2023-08-25 13:11:31 +00:00 Compare
earl-warren force-pushed wip-dind from 8286ebaf9b to b16686d506 2023-08-25 13:18:44 +00:00 Compare
earl-warren force-pushed wip-dind from b16686d506 to 26c90f3bf4 2023-08-25 13:45:54 +00:00 Compare
earl-warren force-pushed wip-dind from 26c90f3bf4 to d868585ad3 2023-08-25 14:36:24 +00:00 Compare
earl-warren force-pushed wip-dind from d868585ad3 to 4d9b72dd5b 2023-08-25 14:46:51 +00:00 Compare
earl-warren force-pushed wip-dind from 4d9b72dd5b to b0512c8190 2023-08-25 15:06:51 +00:00 Compare
earl-warren force-pushed wip-dind from b0512c8190 to 7ac8a82590 2023-08-25 15:09:36 +00:00 Compare
earl-warren force-pushed wip-dind from 7ac8a82590 to bf827ec1be 2023-08-25 15:13:29 +00:00 Compare
earl-warren added 1 commit 2023-08-25 15:20:26 +00:00
earl-warren force-pushed wip-dind from 89a6d48593 to ec648619f1 2023-08-25 15:21:24 +00:00 Compare
earl-warren added 1 commit 2023-08-25 15:26:55 +00:00
earl-warren force-pushed wip-dind from 40e7771776 to cb2c49e442 2023-08-25 15:31:38 +00:00 Compare
earl-warren force-pushed wip-dind from cb2c49e442 to ec6d2ac50f 2023-08-25 15:46:48 +00:00 Compare
earl-warren added 1 commit 2023-08-25 16:17:48 +00:00
earl-warren force-pushed wip-dind from 9ef49ce871 to 9a09498a70 2023-08-25 16:22:13 +00:00 Compare
earl-warren added 1 commit 2023-08-25 22:11:02 +00:00
earl-warren added 1 commit 2023-08-26 07:38:58 +00:00
earl-warren added 1 commit 2023-08-26 07:46:35 +00:00
earl-warren force-pushed wip-dind from 0f26280569 to 3826bb553c 2023-08-26 07:47:38 +00:00 Compare
earl-warren added 1 commit 2023-08-26 07:50:10 +00:00
earl-warren added 1 commit 2023-08-26 07:52:23 +00:00
earl-warren added 1 commit 2023-08-26 07:58:14 +00:00
earl-warren added 1 commit 2023-08-26 08:33:18 +00:00
earl-warren added 1 commit 2023-08-26 08:37:32 +00:00
earl-warren added 1 commit 2023-08-26 08:40:35 +00:00
earl-warren added 1 commit 2023-08-26 08:46:02 +00:00
earl-warren added 1 commit 2023-08-26 08:52:44 +00:00
earl-warren added 1 commit 2023-08-26 09:00:11 +00:00
earl-warren added 1 commit 2023-08-26 09:05:33 +00:00
earl-warren added 1 commit 2023-08-26 09:12:22 +00:00
earl-warren added 1 commit 2023-08-26 09:21:39 +00:00
earl-warren added 1 commit 2023-08-26 09:29:13 +00:00
earl-warren changed title from WIP: general purpose rootless image to WIP: docker-compose example 2023-08-26 09:30:35 +00:00
earl-warren force-pushed wip-dind from 1c42fcae22 to 9b115fce92 2023-08-26 09:33:52 +00:00 Compare
earl-warren changed title from WIP: docker-compose example to docker-compose example 2023-08-26 09:34:55 +00:00
earl-warren requested review from dachary 2023-08-26 09:37:22 +00:00
earl-warren requested review from rome-user 2023-08-26 09:37:22 +00:00
earl-warren requested review from gmem 2023-08-26 09:37:22 +00:00
dachary reviewed 2023-08-26 09:45:48 +00:00
@ -4,0 +58,4 @@
A wait loop expects the status of the check associated with the
commit in Forgejo to show "success" to assert the workflow was run.
Member

Split that into a separate section like the above for unification.

### Running
Split that into a separate section like the above for unification. ``` ### Running ```
dachary reviewed 2023-08-26 09:46:39 +00:00
@ -4,0 +29,4 @@
* user: root
* password: admin1234
`Forgejo Actions` are enabled by default when creating a repository.
Member

s/are enabled/is enabled/

s/are enabled/is enabled/
dachary reviewed 2023-08-26 09:47:10 +00:00
@ -4,0 +41,4 @@
## Tests workflow
The `compose-demo-workflow.yml` compose file runs a demo workflow to
verify the Forgejo runner can pick up a task from the Forgejo instance
Member

Forgejo runner

`Forgejo runner`
dachary reviewed 2023-08-26 09:48:25 +00:00
@ -0,0 +49,4 @@
sleep 1 ;
done ;
forgejo-runner generate-config > config.yml ;
sed -i -e "s|labels: \[\]|labels: \[\"docker:docker://node:16-bullseye\"\]|" config.yml ;
Member

using alpine:3.18 will be lighter

using `alpine:3.18` will be lighter
dachary approved these changes 2023-08-26 09:48:50 +00:00
dachary left a comment
Member

A few details.

A few details.
earl-warren added 1 commit 2023-08-26 09:49:45 +00:00
All checks were successful
checks / check and test (pull_request) Successful in 38s
62efd1f11d
use alpine
earl-warren added 1 commit 2023-08-26 09:51:41 +00:00
All checks were successful
checks / check and test (pull_request) Successful in 41s
ab868afa3b
typos and cosmetic changes
earl-warren force-pushed wip-dind from ab868afa3b to deefb19f21 2023-08-26 09:52:32 +00:00 Compare
earl-warren merged commit 8d49cc7e27 into main 2023-08-26 09:54:40 +00:00
earl-warren deleted branch wip-dind 2023-08-26 09:54:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: forgejo/runner#72
No description provided.