Update for latest act_runner.
This commit is contained in:
parent
945842e0b5
commit
6e7ff26347
14
gitea/Dockerfile.task-executor
Normal file
14
gitea/Dockerfile.task-executor
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
# Install basic tools
|
||||||
|
RUN apt update && apt install -y gpg curl apt-transport-https ca-certificates lsb-release build-essential
|
||||||
|
|
||||||
|
# Add Docker repo
|
||||||
|
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
|
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
|
# Add NodeJS repo
|
||||||
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
|
|
||||||
|
# Install Docker and NodeJS packages.
|
||||||
|
RUN apt update && apt install -y docker-ce nodejs && rm -rf /var/lib/apt/lists/*
|
50
gitea/config/act-runner-config.yml
Normal file
50
gitea/config/act-runner-config.yml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# Example configuration file, it's safe to copy this as the default config file without any modification.
|
||||||
|
|
||||||
|
log:
|
||||||
|
# The level of logging, can be trace, debug, info, warn, error, fatal
|
||||||
|
level: info
|
||||||
|
|
||||||
|
runner:
|
||||||
|
# Where to store the registration result.
|
||||||
|
file: /data/.runner
|
||||||
|
# Execute how many tasks concurrently at the same time.
|
||||||
|
capacity: 1
|
||||||
|
# # Extra environment variables to run jobs.
|
||||||
|
# envs:
|
||||||
|
# A_TEST_ENV_NAME_1: a_test_env_value_1
|
||||||
|
# A_TEST_ENV_NAME_2: a_test_env_value_2
|
||||||
|
# # Extra environment variables to run jobs from a file.
|
||||||
|
# # It will be ignored if it's empty or the file doesn't exist.
|
||||||
|
# env_file: .env
|
||||||
|
# # The timeout for a job to be finished.
|
||||||
|
# # Please note that the Gitea instance also has a timeout (3h by default) for the job.
|
||||||
|
# # So the job could be stopped by the Gitea instance if it's timeout is shorter than this.
|
||||||
|
timeout: 3h
|
||||||
|
# Whether skip verifying the TLS certificate of the Gitea instance.
|
||||||
|
insecure: false
|
||||||
|
# The timeout for fetching the job from the Gitea instance.
|
||||||
|
fetch_timeout: 5s
|
||||||
|
# The interval for fetching the job from the Gitea instance.
|
||||||
|
fetch_interval: 2s
|
||||||
|
|
||||||
|
cache:
|
||||||
|
# Enable cache server to use actions/cache.
|
||||||
|
enabled: true
|
||||||
|
# The directory to store the cache data.
|
||||||
|
# If it's empty, the cache data will be stored in $HOME/.cache/actcache.
|
||||||
|
dir: ""
|
||||||
|
# The host of the cache server.
|
||||||
|
# It's not for the address to listen, but the address to connect from job containers.
|
||||||
|
# So 0.0.0.0 is a bad choice, leave it empty to detect automatically.
|
||||||
|
host: ""
|
||||||
|
# The port of the cache server.
|
||||||
|
# 0 means to use a random available port.
|
||||||
|
port: 0
|
||||||
|
|
||||||
|
container:
|
||||||
|
# Which network to use for the job containers. Could be bridge, host, none, or the name of a custom network.
|
||||||
|
network_mode: bridge
|
||||||
|
# Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker).
|
||||||
|
privileged: true
|
||||||
|
# And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway).
|
||||||
|
options: --add-host=gitea.local:host-gateway
|
@ -53,12 +53,10 @@ services:
|
|||||||
image: cerc/act-runner:local
|
image: cerc/act-runner:local
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- GITEA_INSTANCE_INSECURE=1
|
|
||||||
- GITEA_RUNNER_REGISTRATION_TOKEN=eMdEwIzSo87nBh0UFWZlbp308j6TNWr3WhWxQqIc
|
- GITEA_RUNNER_REGISTRATION_TOKEN=eMdEwIzSo87nBh0UFWZlbp308j6TNWr3WhWxQqIc
|
||||||
- GITEA_INSTANCE_URL=http://gitea.local:3000
|
- GITEA_INSTANCE_URL=http://gitea.local:3000
|
||||||
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://cerc/act-runner-task-executor:local,ubuntu-22.04:docker://cerc/act-runner-task-executor:local
|
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://cerc/act-runner-task-executor:local,ubuntu-22.04:docker://cerc/act-runner-task-executor:local
|
||||||
- GITEA_RUNNER_DOCKER_CONTAINER_OPTIONS=--add-host=gitea.local:host-gateway
|
- CONFIG_FILE=/config/act-runner-config.yml
|
||||||
- GITEA_RUNNER_DOCKER_PRIVILEGED=true
|
|
||||||
networks:
|
networks:
|
||||||
- gitea
|
- gitea
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
@ -66,3 +64,4 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- ./act-runner:/data
|
- ./act-runner:/data
|
||||||
|
- ./config:/config:ro
|
||||||
|
Loading…
Reference in New Issue
Block a user