Commit Graph

281 Commits

Author SHA1 Message Date
Jörg Thalheim
301d6bb9c2 nixos/hercules-ci-agent: increase stack limit
see https://github.com/hercules-ci/hercules-ci-agent/pull/451 for context
2023-05-02 09:53:41 +02:00
Artturi
b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
Jörg Thalheim
90b750456e buildbot: move out of python3.pkgs
By moving it out we can start apply overrides to python dependendencies
starting with sqlalchemy.

This fixes the build with the current version.
2023-04-11 12:38:58 +02:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Bruno BELANYI
6048912d8b nixos/woodpecker-*: add myself as maintainer 2023-03-23 21:33:21 +00:00
Bruno BELANYI
67de7d105e nixos/woodpecker-agents: per-agent 'enable' option 2023-03-23 21:33:20 +00:00
Bruno BELANYI
cd116db45e nixos/woodpecker-agents: bind network files
Otherwise the agent might experience trouble with DNS resolution [1].

[1]: https://github.com/woodpecker-ci/plugin-git/issues/65
2023-03-23 14:16:45 +00:00
Bruno BELANYI
eb3bea6359 nixos/woodpecker-agents: simplify 'extraGroups' handling 2023-03-23 14:16:45 +00:00
Bruno BELANYI
c3afdb82db nixos/woodpecker-agents: use list for environment files 2023-03-23 14:16:44 +00:00
Bruno BELANYI
e4f5f1b718 nixos/woodpecker: refactor to multi-agents setup
The module file has been renamed from `agent.nix` to `agents.nix` to
mirror the change.
2023-03-23 12:47:47 +00:00
Janik H
dafedbbba6 nixos/woodpecker: init 2023-03-14 20:31:39 +01:00
Rick van Schijndel
8d8f5ede91
Merge pull request #216451 from Mindavi/hydra/systemd-target
nixos/hydra: wait for network-online before evaluator start
2023-03-09 20:53:21 +01:00
Rick van Schijndel
60446dda1f nixos/hydra: wait for network-online before evaluator start
This prevents issues I'm seeing with the hydra I'm running on my laptop.
Every time I reboot it I see eval errors like this:

```
error fetching latest change from git repo at `https://github.com/nixos/nixpkgs.git':
fatal: unable to access 'https://github.com/nixos/nixpkgs.git/': Could not resolve host: github.com
```

This is because the evaluator already starts before the network is
actually online. It should wait until the network is fully online before
starting evaluation to prevent evaluation errors like above.
2023-03-07 21:58:23 +01:00
Ilan Joselevich
edff57cff4
Merge pull request #218455 from veehaitch/gh-runner-builddotnet
github-runner: switch to `buildDotnetModule`
2023-03-06 19:11:06 +02:00
Stefan Frijters
2af041ab44 nixos/gitlab-runner: do not pull in Docker if gitlab-runner-clear-docker-cache is disabled
Only create the service if the option is enabled and if any docker executors exist.
2023-02-27 22:24:14 +01:00
Vincent Haupert
137db83090 nixos/github-runners: use Runner.Listener directly for registration
Nothing the script `config.sh` does prior to the final call to
`Runner.Listener configure` is relevant for the systemd service.
Particularly, we don't need (nor want) any of the artifacts the `env.sh`
script creates.
2023-02-26 15:39:19 +01:00
Aaron Andersen
d8c0a9204a
Merge pull request #217834 from yaxitech/gh-runner-workdir-clean
nixos/github-runners: clean `workDir` as root
2023-02-26 08:05:05 -05:00
Profpatsch
d316c28a30 modules/github-runner: Improve tokenFile docs
We’ve been having trouble figuring out which kind of token to use and
why our setup would break every few system updates.

This should clarify which options there are, and which ones lead to
better results.

Ideally there would be a manual section that has a step-by-step guide
on how to set up the github runner, with screenshots and everything.
2023-02-23 12:37:30 +01:00
Vincent Haupert
36949b9718 nixos/github-runners: clean workDir as root
Purge contents of `workDir` as root to also allow the removal of files
marked as read-only. It is easy to create read-only files in `workDir`,
e.g., by copying files from the Nix store.
2023-02-23 09:05:27 +01:00
Karel Kočí
116872aedd
nixos/gitlab-runner: fix shell syntax preventing build
The build fails when configFile is provided because of shellcheck
detects missing quotes here.
2023-02-13 13:20:26 +01:00
Vincent Haupert
57a517db35 nixos/github-runner{,s}: add @veehaitch and @newam as maintainers 2023-01-09 09:37:00 +01:00
Vincent Haupert
b634dbe576 nixos/github-runners: fix format of service file 2023-01-09 09:36:59 +01:00
Vincent Haupert
66dbf9b199 nixos/github-runners: use mkMerge for serviceConfig
The `serviceOverrides` module option is commonly used to loosen the
systemd unit's hardening. This commit merges the `serviceConfig` with
`mkMerge` instead of using the update operator `//` which discards all
existing values on conflict. To avoid a breaking change which requires
defining each option with a higher priority (e.g., through `mkForce`),
this commit prefixes hardening values with `mkDefault`.

Notable exceptions are list hardening options which use `mkBefore`
instead of `mkDefault`. This allows for easy extension of the existing
settings. Resetting redefinitions are still possible through `mkForce`.
2023-01-09 09:36:04 +01:00
Aaron Andersen
4769274f53
Merge pull request #205526 from newAM/github-runner-oom
nixos/github-runner: add workDir option
2023-01-08 19:01:44 -05:00
Maciej Pasternacki
c3ec444a61 nixos/gitlab-runner: fix style issues flagged by statix 2023-01-08 17:37:43 +01:00
Maciej Pasternacki
d5cb89b024 nixos/gitlab-runner: fix problems introduced by last #209716 2023-01-08 17:36:45 +01:00
Matthieu Coudron
c61f554c1a modules.gitlab-runner: accept space in names
when you register a runner with spaces in its name (possible if you use 'description' option) then the runners never get unregistered because our bash scripts assume no space in names.

This solves the issue

Retreiving the fullname of the runner via `gitlab-runner list` got surprisingly hard between lazy-capture issues and `gitlab-runner list` displaying invisible (CSI) characters that break the regex etc.
Which is why I fell back on the pseudo-json format.

This PR adds the hash in the name, which allows to keep both the
stateless aspect of the module while allowing for a freeform name.

I found using bash associative arrays easier to use/debug than the current
approach.
2023-01-05 11:43:32 +01:00
Alex Martens
307730fb72 nixos/github-runner: add workDir option 2023-01-03 19:54:25 -08:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Daniel Nagy
ad866e565d
treewide: switch to port type for nixos modules 2022-12-08 00:00:00 +01:00
Daniel Nagy
dbe8182e74
treewide: switch to port type for nixos modules 2022-12-01 22:30:00 +01:00
figsoda
1b9b057d92 nixos/buildbot: syntax clean up 2022-11-30 17:31:28 -05:00
Vincent Haupert
847774470e nixos/github-runners: restart service if exit code signals a retryable error
On some occasions, the GitHub runner service encounters errors which are
deemed retryable but result in the runner's termination. To signal a
retryable error, the runner exits with status code 2:

https://github.com/actions/runner/blob/40ed7f8/src/Runner.Common/Constants.cs#L146

To account for that behavior, this commit sets
`RestartForceExitStatus=2` which results in a service restart regardless
of using an ephemeral runner or not.
2022-11-10 11:06:04 -05:00
Bjørn Forsman
fcf81f91a3 nixos/jenkins-job-builder: better defaults for accessUser/accessTokenFile
The new defaults allows jenkins-job-builder to reload the configuration
out-of-the-box, whereas the previous defaults required users to manually
reload/restart jenkins, or configure accessUser/accessTokenFile
themselves.

(If `extraJavaOptions = [ "-Djenkins.install.runSetupWizard=false" ]`
then the initial admin user is *not* created and you have to use JCasC
or something else to bootstrap.)
2022-10-30 19:01:48 +01:00
Sandro
b05729432a
Merge pull request #196060 from risicle/ris-gocd-22.2.0 2022-10-27 01:07:34 +02:00
ajs124
3dd1098f45
Merge pull request #195567 from helsinki-systems/feat/jenkins-jdk17
nixos/jenkins: jdk11 -> jdk17
2022-10-21 22:59:03 +02:00
Vincent Haupert
ea8cf2e486 nixos/github-runners: support fine-grained personal access tokens
Add support for GitHub's new fine-grained personal access tokens [1]. As
opposed to the classic PATs, those start with `github_pat_` instead of
`ghp_`.

Make sure to use a token which has read and write access to the
"Administration" resource group [2] to allow for registrations of new
runners.

[1] https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github/

[2] https://docs.github.com/en/rest/overview/permissions-required-for-github-apps#administration
2022-10-19 13:50:34 +02:00
Domen Kožar
ff27dc3a09
Merge pull request #176691 from codedownio/multiple-github-runners
GitHub runners: configurable user, environment, and service overrides + multiple runners
2022-10-19 13:38:23 +02:00
Tom McLaughlin
c2cc9aeafd Use config name by default, falling back to attr name 2022-10-19 03:33:30 -07:00
Tom McLaughlin
5221e7af04 Add comments to explain about the name defaults 2022-10-17 00:04:52 -07:00
Tom McLaughlin
2c099d1a14 Set runner name to attr name for github-runners.${name} 2022-10-17 00:01:04 -07:00
Robert Scott
4f54ef201d gocd-server: 19.3.0 -> 22.2.0 2022-10-15 13:34:50 +01:00
Tom McLaughlin
fc8fdb03a0 Try simpler github-runner.nix 2022-10-13 19:54:36 -06:00
Tom McLaughlin
69d9538b34
Update nixos/modules/services/continuous-integration/github-runners.nix
Co-authored-by: Vincent Haupert <mail@vincent-haupert.de>
2022-10-13 18:53:25 -06:00
Tom McLaughlin
cf1b952988
Update nixos/modules/services/continuous-integration/github-runner.nix
Co-authored-by: Vincent Haupert <mail@vincent-haupert.de>
2022-10-13 18:49:02 -06:00
Pascal Bach
1ca4c178dd
Merge pull request #195488 from KoviRobi/gitlab-runner-clear-docker-cache
Gitlab runner clear docker cache
2022-10-12 07:56:46 +02:00
ajs124
18a17d11ff nixos/jenkins: jdk11 -> jdk17
see https://www.jenkins.io/doc/upgrade-guide/2.361/
we'll need to do this eventually, not sure when the best point in time is
2022-10-11 21:16:37 +02:00
Tom McLaughlin
0b67081ad8 Cherry-pick 499748b 2022-10-11 06:10:11 -06:00
Tom McLaughlin
9a7f38040b Fix user type 2022-10-11 06:04:25 -06:00
Tom McLaughlin
b744fee880 Re-add DynamicUser = true per review discussion 2022-10-11 06:04:25 -06:00