Skip to content

Allow setting runners.docker.services in toml #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonmcewen opened this issue May 19, 2022 · 6 comments
Closed

Allow setting runners.docker.services in toml #489

jonmcewen opened this issue May 19, 2022 · 6 comments
Labels
enhancement 🆕 New feature or request

Comments

@jonmcewen
Copy link
Contributor

I've been trying to find a way to configure a docker mirror in the docker+machine runners, but had some problems. I have set runners_docker_registry_mirror

  1. If I set runners_add_dind_volumes, then a job script of docker info shows the Registry Mirrors, but this conflicts with services in jobs such as the auto-devops code_quality job, which also try to mount var/run/docker.sock.
  2. If I don't set runners_add_dind_volumes (using instead runners_additional_volumes to mount all but the docker.sock) then the services start correctly, but docker info doesn't show the mirror.

I think I have a workaround though, in which I start a docker service in the runner by modifying the config.toml

I have a requirement that users can use auto-devops without modification, so simply modifying the service(s) in the pipeline config is not an option.

Have I missed a trick, or is adding [[runners.docker.services]] a sensible approach? If so, I'll raise a PR to allow this.

@jonmcewen
Copy link
Contributor Author

See also this issue for more background: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27173

@jonmcewen
Copy link
Contributor Author

@npalm I'm working on a PR for this. Will be pretty basic initially, but will work for the docker mirror use case

jonmcewen added a commit to jonmcewen/terraform-aws-gitlab-runner that referenced this issue May 20, 2022
jonmcewen added a commit to jonmcewen/terraform-aws-gitlab-runner that referenced this issue May 23, 2022
@kayman-mk
Copy link
Collaborator

If I understand you correctly, @jonmcewen, the problem is, that the mirror disappears if runners_additional_volumes is used? Using runners_add_dind_volumes everything is fine.

Another question which came into my mind: Why is a job trying to mount a docker.sock? Do you have a link to the mentioned code_qualityjob?

@jonmcewen
Copy link
Contributor Author

If I understand you correctly, @jonmcewen, the problem is, that the mirror disappears if runners_additional_volumes is used? Using runners_add_dind_volumes everything is fine.

Another question which came into my mind: Why is a job trying to mount a docker.sock? Do you have a link to the mentioned code_qualityjob?

Please see the first comment on this issue: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4260

Rest assured I spent many days going round in circles on this issue. I stand behind my solution until a better one is proposed.

npalm added a commit that referenced this issue Dec 11, 2022
* fix: Pass token to metadata service requests.

close: #476

* docs: fix generation tf docs

* docs: auto update terraform docs

* feat: allow setting runners.docker.services. #489

* add description to new variable

* Comment out docker service in example. Improve docs

* remove accidentally added file

Co-authored-by: Niek Palm <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@kayman-mk kayman-mk added the enhancement 🆕 New feature or request label Dec 31, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the stale Issue/PR is stale and closed automatically label Mar 2, 2023
@kayman-mk
Copy link
Collaborator

Guess this wasn't closed then #491 was merged months ago.

@kayman-mk kayman-mk removed the stale Issue/PR is stale and closed automatically label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🆕 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants