Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cx-custom-gitlab-runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lukas Werner
cx-custom-gitlab-runner
Commits
45e71fff
Commit
45e71fff
authored
3 years ago
by
Lukas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Better auth messages, check for max slurm time limit
parent
82ab7f8e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
runner_scripts/root/cleanup.sh
+1
-1
1 addition, 1 deletion
runner_scripts/root/cleanup.sh
runner_scripts/root/run.sh
+12
-4
12 additions, 4 deletions
runner_scripts/root/run.sh
with
13 additions
and
5 deletions
runner_scripts/root/cleanup.sh
+
1
−
1
View file @
45e71fff
...
@@ -38,7 +38,7 @@ do
...
@@ -38,7 +38,7 @@ do
diff <
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$AUTH_KEY
"
)
<
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$PUB
"
)
&&
exit
0
diff <
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$AUTH_KEY
"
)
<
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$PUB
"
)
&&
exit
0
done
<
"
$AUTH_PUB
"
done
<
"
$AUTH_PUB
"
exit
1
exit
1
)
||
error
"Authentication failed."
)
||
error
"Authentication
for user
$AUTH_USER
failed."
### Env cleanup
### Env cleanup
...
...
This diff is collapsed.
Click to expand it.
runner_scripts/root/run.sh
+
12
−
4
View file @
45e71fff
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
set
-euf
-o
pipefail
set
-euf
-o
pipefail
shopt
-s
inherit_errexit
shopt
-s
inherit_errexit
MAX_CI_JOB_RUNTIME
=
120
hash awk
hash awk
hash chown
hash chown
hash
diff
hash
diff
...
@@ -40,7 +42,7 @@ do
...
@@ -40,7 +42,7 @@ do
diff
--color
=
never <
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$AUTH_KEY
"
)
<
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$PUB
"
)
>
/dev/null
&&
exit
0
diff
--color
=
never <
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$AUTH_KEY
"
)
<
(
ssh-keygen
-y
-e
-f
/dev/stdin
<<<
"
$PUB
"
)
>
/dev/null
&&
exit
0
done
<
"
$AUTH_PUB
"
done
<
"
$AUTH_PUB
"
exit
1
exit
1
)
||
error
"Authentication failed."
)
||
error
"Authentication
for user
$AUTH_USER
failed."
### Env setup
### Env setup
...
@@ -56,8 +58,7 @@ BASE_DIR=$AUTH_USER_WORK/gitlab-runner/builds/${CUSTOM_ENV_CI_CONCURRENT_PROJECT
...
@@ -56,8 +58,7 @@ BASE_DIR=$AUTH_USER_WORK/gitlab-runner/builds/${CUSTOM_ENV_CI_CONCURRENT_PROJECT
runuser
"
$AUTH_USER
"
--login
--command
"mkdir -p
$BASE_DIR
"
runuser
"
$AUTH_USER
"
--login
--command
"mkdir -p
$BASE_DIR
"
if
[[
(
"
$2
"
==
"step_script"
||
"
$2
"
==
"build_script"
)
&&
${
CUSTOM_ENV_SUBMIT_TO_SLURM
:-}
]]
if
[[
(
"
$2
"
==
"step_script"
||
"
$2
"
==
"build_script"
)
&&
${
CUSTOM_ENV_SUBMIT_TO_SLURM
:-}
]]
;
then
then
## The script is the one specified in the gitlab-ci.yml script directive and the SUBMIT_TO_SLURM variable is set
## The script is the one specified in the gitlab-ci.yml script directive and the SUBMIT_TO_SLURM variable is set
for
E
in
$(
env
|
grep
-E
"^CUSTOM_ENV_SLURM_"
)
for
E
in
$(
env
|
grep
-E
"^CUSTOM_ENV_SLURM_"
)
...
@@ -66,13 +67,20 @@ then
...
@@ -66,13 +67,20 @@ then
done
done
:
"
${
SLURM_JOB_NAME
:
=
"gitlab-ci-
${
CUSTOM_ENV_CI_PROJECT_NAME
:?
}
-
${
CUSTOM_ENV_CI_PIPELINE_ID
:?
}
-
${
CUSTOM_ENV_CI_JOB_ID
:?
}
"
}
"
:
"
${
SLURM_JOB_NAME
:
=
"gitlab-ci-
${
CUSTOM_ENV_CI_PROJECT_NAME
:?
}
-
${
CUSTOM_ENV_CI_PIPELINE_ID
:?
}
-
${
CUSTOM_ENV_CI_JOB_ID
:?
}
"
}
"
:
"
${
SLURM_TIMELIMIT
:
=
"240"
}
"
:
"
${
SLURM_TIMELIMIT
:
=
$MAX_CI_JOB_RUNTIME
}
"
:
"
${
SLURM_TIME
:
=
$SLURM_TIMELIMIT
}
"
:
"
${
SLURM_TIME
:
=
$SLURM_TIMELIMIT
}
"
export
SLURM_JOB_NAME
export
SLURM_JOB_NAME
export
SLURM_TIME
export
SLURM_TIME
unset
SLURM_TIMELIMIT
unset
SLURM_TIMELIMIT
# limit max job run time
if
[[
$SLURM_TIME
>
$MAX_CI_JOB_RUNTIME
]]
;
then
echo
"SLURM_TIMELIMIT or SLURM_TIME larger than
$MAX_CI_JOB_RUNTIME
(s), limiting to
$MAX_CI_JOB_RUNTIME
."
1>&2
SLURM_TIME
=
$MAX_CI_JOB_RUNTIME
export
SLURM_TIME
fi
# Generate salloc arguments from SLURM_* environment variables
# Generate salloc arguments from SLURM_* environment variables
SALLOC_OPTIONS
=()
SALLOC_OPTIONS
=()
for
E
in
$(
env
|
grep
-E
"^SLURM_"
)
for
E
in
$(
env
|
grep
-E
"^SLURM_"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment