Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
argopkgs
Commits
7b9727b0
Commit
7b9727b0
authored
Jun 18, 2019
by
Valentin Reis
Browse files
adds concurrency option to gitlab runners
parent
b8810e2f
Pipeline
#7756
passed with stages
in 25 minutes and 16 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
7b9727b0
...
...
@@ -78,7 +78,7 @@ these are deployed via NixOps:
-
there are four shell scripts in
[
deployments/
](
deployments/
)
that can be used to redeploy, reboot, and restart systemd services.
-
access is granted to all keys in
[
deployment/keys
](
deployment/keys
)
so submit a pull request and ask someone to redeploy if you need access.
The gitlab-runner service is called "gitlab
-
runner
2
" on the machines. That
The gitlab-runner service is called "gitlabrunner" on the machines. That
systemd service registers runners on ExecStart and unregisters them on
ExecStop, so excess IPs will have to be merged manually from the gitlab
[
runner
...
...
deployments/argo.nixops
View file @
7b9727b0
No preview for this file type
deployments/ci.nix
View file @
7b9727b0
...
...
@@ -6,7 +6,7 @@ let
argopkgs
=
import
../pkgs
{};
hydraSrc
=
builtins
.
fetchTarball
https://github.com/nixos/hydra/archive/master.tar.gz
;
argomodules
=
import
../modules/module-list.nix
;
mkChameleonRunner
=
ip
:
name
:
{
...
}:
mkChameleonRunner
=
ip
:
{
...
}:
{
deployment
.
targetEnv
=
"none"
;
deployment
.
targetHost
=
ip
;
...
...
@@ -56,10 +56,10 @@ let
virtualisation
.
docker
.
enable
=
true
;
services
.
gitlab
-
runner
2
.
enable
=
true
;
services
.
gitlab
-
runner
2
.
name
=
name
;
services
.
gitlab
-
runner
2
.
registrationConfigFile
=
"/run/gitlab.cfg"
;
services
.
gitlab
-
runner
2
.
packages
=
[
pkgs
.
bash
pkgs
.
docker-machine
pkgs
.
shadow
pkgs
.
git
];
services
.
gitlabrunner
.
enable
=
true
;
services
.
gitlabrunner
.
name
=
"chameleon-runner-"
+
ip
;
services
.
gitlabrunner
.
registrationConfigFile
=
"/run/gitlab.cfg"
;
services
.
gitlabrunner
.
packages
=
[
pkgs
.
bash
pkgs
.
docker-machine
pkgs
.
shadow
pkgs
.
git
];
nix
.
gc
=
{
automatic
=
true
;
...
...
@@ -70,47 +70,25 @@ let
users
.
extraUsers
.
root
.
openssh
.
authorizedKeys
.
keys
=
[
(
pkgs
.
lib
.
readFile
./keys/id_buildfarm.pub
)]
++
keys
;
users
.
extraUsers
.
fre
.
openssh
.
authorizedKeys
.
keys
=
[
(
pkgs
.
lib
.
readFile
./keys/id_buildfarm.pub
)]
++
keys
;
};
mkBigChameleonRunner
=
ip
:
name
:
a
@
{
...
}:
((
mkChameleonRunner
ip
name
a
)
//
{
virtualisation
.
docker
=
{
enable
=
true
;
};
#networking.firewall.enable = false;
#systemd.services."rkt-afl" = {
#description = "Airflow";
#wantedBy = [ "multi-user.target" ];
#serviceConfig = {
#Slice = "machine.slice";
#ExecStart = ''\
#${pkgs.rkt}/bin/rkt run --insecure-options=image \
#--port=8080-tcp:8080 \
#--volume=volume-root-airflow,kind=host,source=/var/airflow,readOnly=false \
#docker://puckel/docker-airflow \
#webserver
#'';
#KillMode = "mixed";
#Restart = "always";
#};
#};
});
in
{
network
.
description
=
"argo-ci"
;
network
.
enableRollback
=
false
;
gitlab-runner-4
=
mkChameleonRunner
"129.114.111.114"
"chameleon-129.114.111.114"
;
gitlab-runner-3
=
mkChameleonRunner
"129.114.110.3"
"chameleon-129.114.110.3"
;
gitlab-runner-2
=
mkChameleonRunner
"129.114.111.116"
"chameleon-129.114.111.116"
;
gitlab-runner-1
=
mkChameleonRunner
"129.114.33.201"
"chameleon-129.114.33.201"
;
gitlab-runner-0
=
mkBigChameleonRunner
"129.114.111.64"
"chameleon-129.114.111.64"
;
gitlab-runner-1
=
mkChameleonRunner
"129.114.111.64"
;
gitlab-runner-2
=
mkChameleonRunner
"129.114.111.114"
;
gitlab-runner-3
=
mkChameleonRunner
"129.114.110.214"
;
gitlab-runner-4
=
mkChameleonRunner
"129.114.110.3"
;
gitlab-runner-5
=
mkChameleonRunner
"129.114.33.201"
;
gitlab-runner-6
=
mkChameleonRunner
"129.114.111.83"
;
gitlab-runner-7
=
mkChameleonRunner
"129.114.111.116"
;
gitlab-runner-physical
=
{
...
}:
let
ip
=
"140.221.10.9"
;
in
{
deployment
.
targetEnv
=
"none"
;
deployment
.
targetHost
=
"140.221.10.9"
;
deployment
.
targetHost
=
ip
;
environment
.
argo
.
singularity
=
{
enable
=
true
;
...
...
@@ -164,6 +142,7 @@ in
i18n
.
defaultLocale
=
"en_US.UTF-8"
;
nix
.
useSandbox
=
true
;
nix
.
maxJobs
=
5
;
nix
.
nrBuildUsers
=
30
;
nix
.
trustedUsers
=
[
"root"
"fre"
];
...
...
@@ -174,9 +153,10 @@ in
virtualisation
.
docker
.
enable
=
true
;
services
.
gitlab-runner2
.
enable
=
true
;
services
.
gitlab-runner2
.
registrationConfigFile
=
"/run/gitlab.cfg"
;
services
.
gitlab-runner2
.
packages
=
[
pkgs
.
bash
pkgs
.
docker-machine
pkgs
.
shadow
pkgs
.
git
];
services
.
gitlabrunner
.
name
=
"desktop-val-"
+
ip
;
services
.
gitlabrunner
.
enable
=
true
;
services
.
gitlabrunner
.
registrationConfigFile
=
"/run/gitlab.cfg"
;
services
.
gitlabrunner
.
packages
=
[
pkgs
.
bash
pkgs
.
docker-machine
pkgs
.
shadow
pkgs
.
git
];
nix
.
gc
=
{
automatic
=
true
;
...
...
deployments/gitlab-runner.nix
View file @
7b9727b0
...
...
@@ -5,10 +5,10 @@
{
config
,
pkgs
,
lib
,
...
}:
with
lib
;
let
cfg
=
config
.
services
.
gitlab
-
runner
2
;
cfg
=
config
.
services
.
gitlabrunner
;
in
{
options
.
services
.
gitlab
-
runner
2
=
{
options
.
services
.
gitlabrunner
=
{
enable
=
lib
.
mkEnableOption
"Gitlab Runner"
;
registrationConfigFile
=
lib
.
mkOption
{
description
=
''
...
...
@@ -50,6 +50,13 @@ in
description
=
''Time to wait until a graceful shutdown is turned into a forceful one.''
;
};
concurrency
=
mkOption
{
default
=
"1"
;
type
=
types
.
str
;
example
=
"2"
;
description
=
''Runner concurrency.''
;
};
workDir
=
mkOption
{
default
=
"/var/lib/gitlab-runner"
;
type
=
types
.
path
;
...
...
@@ -74,8 +81,8 @@ in
};
};
config
=
mkIf
cfg
.
enable
{
systemd
.
services
.
gitlab
-
runner
2
=
{
path
=
cfg
.
packages
;
systemd
.
services
.
gitlabrunner
=
{
path
=
cfg
.
packages
++
[
pkgs
.
gnused
]
;
environment
=
config
.
networking
.
proxy
.
envVars
;
description
=
"Gitlab Runner"
;
after
=
[
"network.target"
"docker.service"
];
...
...
@@ -83,14 +90,17 @@ in
wantedBy
=
[
"multi-user.target"
];
serviceConfig
=
{
EnvironmentFile
=
"
${
cfg
.
registrationConfigFile
}
"
;
ExecStartPre
=
''
${
cfg
.
package
.
bin
}
/bin/gitlab-runner register \
ExecStartPre
=
[
''
${
cfg
.
package
.
bin
}
/bin/gitlab-runner register \
--non-interactive=true \
--name
${
cfg
.
name
}
\
--executor "shell" \
--maximum-timeout 1800 \
--tag-list "integration,notknl"\
''
;
ExecStart
=
''
${
cfg
.
package
.
bin
}
/bin/gitlab-runner run \
--request-concurrency
${
cfg
.
concurrency
}
\
--tag-list "integration,notknl,singularity"\
''
"
${
pkgs
.
gnused
}
/bin/sed -i 's/concurrent = 1/concurrent =
${
cfg
.
concurrency
}
/' /etc/gitlab-runner/config.toml"
];
ExecStart
=
''
${
cfg
.
package
.
bin
}
/bin/gitlab-runner run \
--working-directory
${
cfg
.
workDir
}
\
--service gitlab-runner \
''
;
...
...
deployments/keygen-R-runners.sh
View file @
7b9727b0
#!/usr/bin/env bash
ssh-keygen
-R
140.221.10.9
ssh-keygen
-R
129.114.111.114
ssh-keygen
-R
129.114.110.3
ssh-keygen
-R
129.114.111.116
ssh-keygen
-R
129.114.111.64
ssh-keygen
-R
129.114.111.114
ssh-keygen
-R
129.114.110.214
ssh-keygen
-R
129.114.110.3
ssh-keygen
-R
129.114.33.201
ssh-keygen
-R
129.114.111.83
ssh-keygen
-R
129.114.111.116
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment