Skip to content

Commit

Permalink
runner: Convert idle-timeout="never" to 0 with GitLab driver (#1408)
Browse files Browse the repository at this point in the history
* 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

* Fix linting error

* Update src/drivers/gitlab.js

---------

Co-authored-by: Daniel Barnes <[email protected]>
  • Loading branch information
BradyJ27 and dacbd committed Jul 28, 2023
1 parent cbd84c4 commit b64044f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/drivers/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ class Gitlab {
const { protocol, host } = new URL(this.repo);
const { token } = await this.registerRunner({ tags: labels, name });

let waitTimeout = idleTimeout;
if (idleTimeout === 'never') {
waitTimeout = '0';
}

let dockerVolumesTpl = '';
dockerVolumes.forEach((vol) => {
dockerVolumesTpl += `--docker-volumes ${vol} `;
Expand All @@ -210,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' : ''} \
Expand Down

0 comments on commit b64044f

Please sign in to comment.