Use act_runner without docker seems impossible? #613

Open
opened 2024-10-17 05:21:52 +00:00 by jjanvier · 4 comments
jjanvier commented 2024-10-17 05:21:52 +00:00 (Migrated from gitea.com)

We are a small office and don't want to spend too much resources on maintaining a complex build environment. We just left Gitlab and moved over to Gitea, because Gitea is claiming to be lightweight.

Now I just try to setup a single build machine for all our projects by using the act_runner without docker.
According to the documentation the runner can be used without docker.

However after registering the runner and starting it up with the daemon parameter, it won't start because it can't find docker.
We don't want to maintain a docker build environment, we just want the runner to run some scripts on the local machine.
Am I missing the lightweight concept here?

I can't find anything about how to configure act_runner as a service without using docker, How to do this?

We are a small office and don't want to spend too much resources on maintaining a complex build environment. We just left Gitlab and moved over to Gitea, because Gitea is claiming to be lightweight. Now I just try to setup a single build machine for all our projects by using the act_runner without docker. According to the documentation the runner can be used without docker. However after registering the runner and starting it up with the daemon parameter, it won't start because it can't find docker. We don't want to maintain a docker build environment, we just want the runner to run some scripts on the local machine. Am I missing the lightweight concept here? I can't find anything about how to configure act_runner as a service without using docker, How to do this?
techknowlogick commented 2024-10-18 15:38:31 +00:00 (Migrated from gitea.com)

Could you share the labels you've setup for your runner? If you don't have any set, then by default it uses the docker configuration, but if the runner has only labels that are setup as "host-only" then the runner won't try to connect to the docker daemon.

Could you share the labels you've setup for your runner? If you don't have any set, then by default it uses the docker configuration, but if the runner has only labels that are setup as "host-only" then the runner won't try to connect to the docker daemon.
fraud commented 2024-11-15 09:53:21 +00:00 (Migrated from gitea.com)

@jjanvier you need to add a label "self-hosted:host" in the runner section in your actrunner.yaml

Here is an example:

runner:
  file: .runner
  capacity: 1
  envs:
    A_TEST_ENV_NAME_1: a_test_env_value_1
    A_TEST_ENV_NAME_2: a_test_env_value_2
  env_file: .env
  timeout: 3h
  insecure: false
  fetch_timeout: 5s
  fetch_interval: 59s
  labels: ["self-hosted:host"]
@jjanvier you need to add a label `"self-hosted:host"` in the `runner` section in your `actrunner.yaml` Here is an example: ``` runner: file: .runner capacity: 1 envs: A_TEST_ENV_NAME_1: a_test_env_value_1 A_TEST_ENV_NAME_2: a_test_env_value_2 env_file: .env timeout: 3h insecure: false fetch_timeout: 5s fetch_interval: 59s labels: ["self-hosted:host"] ```
marza-sergey commented 2024-11-29 00:42:42 +00:00 (Migrated from gitea.com)

I'm having the same problem. We don't have docker installed on our windows build machine and even after specifying "labels": ["windows:host"] the job still fails after trying to pull ubuntu-latest with:

2024-11-28T09:40:17.1580703Z unable to determine if image already exists for image 'gitea/runner-images:ubuntu-latest' (): error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.44/images/gitea/runner-images:ubuntu-latest/json": open //./pipe/docker_engine: The system cannot find the file specified.

You can see more details in #626

I'm having the same problem. We don't have docker installed on our windows build machine and even after specifying `"labels": ["windows:host"]` the job still fails after trying to pull ubuntu-latest with: ``` 2024-11-28T09:40:17.1580703Z unable to determine if image already exists for image 'gitea/runner-images:ubuntu-latest' (): error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.44/images/gitea/runner-images:ubuntu-latest/json": open //./pipe/docker_engine: The system cannot find the file specified. ``` You can see more details in #626
marza-sergey commented 2024-11-29 02:28:16 +00:00 (Migrated from gitea.com)

I tried debugging act_runner and this might be actually a problem with how gitea handles labels for reusable workflows https://github.com/go-gitea/gitea/issues/32348
Currently we have 2 runners with labels: rocky-8 - which runs on linux host with docker and windows which runs directly on host.
At some point gitea pushed a job with label rocky-8 to windows machine and it got cached. Since windows runner doesn't know about rocky-8 label, it defaulted to gitea/runner-images:ubuntu-latest https://gitea.com/gitea/act_runner/src/commit/8bc0275e74af3516cb9d952e144e48405c084aa5/internal/pkg/labels/labels.go#L82
and failed, since docker is not installed.

After clearing cache modifying reusable workflow to support windows via input parameter and making sure to pass this input parameter:

...
jobs:
  pypi-publish:
    runs-on: ${{ inputs.os }}
    steps:
...

everything worked.

I tried debugging act_runner and this might be actually a problem with how gitea handles labels for reusable workflows https://github.com/go-gitea/gitea/issues/32348 Currently we have 2 runners with labels: `rocky-8` - which runs on linux host with docker and `windows` which runs directly on host. At some point gitea pushed a job with label `rocky-8` to `windows` machine and it got cached. Since windows runner doesn't know about `rocky-8` label, it defaulted to `gitea/runner-images:ubuntu-latest` https://gitea.com/gitea/act_runner/src/commit/8bc0275e74af3516cb9d952e144e48405c084aa5/internal/pkg/labels/labels.go#L82 and failed, since docker is not installed. After clearing cache modifying reusable workflow to support windows via input parameter and making sure to pass this input parameter: ```yaml ... jobs: pypi-publish: runs-on: ${{ inputs.os }} steps: ... ``` everything worked.
Sign in to join this conversation.