From 55a9de4ce288b1c4a60f30d45ec9331c925995a4 Mon Sep 17 00:00:00 2001 From: Brady Johnson Date: Thu, 27 Jul 2023 18:00:13 -0600 Subject: [PATCH 1/3] runner: Convert idle-timeout="never" to 0 with GitLab driver GitLab runners do not support "never" as an argument for --wait-timeout, instead this should be 0, which by default is no timeout. Fixes #1407 --- src/drivers/gitlab.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index 932964ea6..ed3c45055 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -200,6 +200,10 @@ class Gitlab { const { protocol, host } = new URL(this.repo); const { token } = await this.registerRunner({ tags: labels, name }); + if (idleTimeout === 'never') { + idleTimeout = '0'; + } + let dockerVolumesTpl = ''; dockerVolumes.forEach((vol) => { dockerVolumesTpl += `--docker-volumes ${vol} `; From aaaba575936f6ae3db367b379040313327c0d16c Mon Sep 17 00:00:00 2001 From: Brady Johnson Date: Thu, 27 Jul 2023 19:31:19 -0600 Subject: [PATCH 2/3] Fix linting error --- src/drivers/gitlab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index ed3c45055..9096184a7 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -200,8 +200,9 @@ class Gitlab { const { protocol, host } = new URL(this.repo); const { token } = await this.registerRunner({ tags: labels, name }); + var waitTimeout = idleTimeout; if (idleTimeout === 'never') { - idleTimeout = '0'; + waitTimeout = '0'; } let dockerVolumesTpl = ''; @@ -214,7 +215,7 @@ class Gitlab { --url "${protocol}//${host}" \ --name "${name}" \ --token "${token}" \ - --wait-timeout ${idleTimeout} \ + --wait-timeout ${waitTimeout} \ --executor "${IN_DOCKER ? 'shell' : 'docker'}" \ --docker-image "iterativeai/cml:${gpu ? 'latest-gpu' : 'latest'}" \ ${gpu ? '--docker-runtime nvidia' : ''} \ From 536bba0976f833cc176135857acc53a6db4f6fae Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Thu, 27 Jul 2023 18:56:38 -0700 Subject: [PATCH 3/3] Update src/drivers/gitlab.js --- src/drivers/gitlab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index 9096184a7..489f64d35 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -200,7 +200,7 @@ class Gitlab { const { protocol, host } = new URL(this.repo); const { token } = await this.registerRunner({ tags: labels, name }); - var waitTimeout = idleTimeout; + let waitTimeout = idleTimeout; if (idleTimeout === 'never') { waitTimeout = '0'; }