Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Runner Mirror
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adrian Schmitz
Runner Mirror
Commits
ffe4ca13
Commit
ffe4ca13
authored
2 years ago
by
Felix Tomski
Browse files
Options
Downloads
Patches
Plain Diff
Fix direct write to service account directories
parent
cda1b6f4
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/modes/__init__.py
+13
-2
13 additions, 2 deletions
core/modes/__init__.py
core/scripts/batch.env
+1
-0
1 addition, 0 deletions
core/scripts/batch.env
core/scripts/chmodPath.sh
+1
-1
1 addition, 1 deletion
core/scripts/chmodPath.sh
with
15 additions
and
3 deletions
core/modes/__init__.py
+
13
−
2
View file @
ffe4ca13
...
@@ -404,14 +404,25 @@ class Batch(Slurm):
...
@@ -404,14 +404,25 @@ class Batch(Slurm):
class
Singularity_Batch
(
Default
):
class
Singularity_Batch
(
Default
):
container
=
''
container
=
''
@staticmethod
def
escape
(
s
):
return
s
.
replace
(
'
/
'
,
'
\/
'
)
def
custom_run_setup
(
self
,
**
kwargs
):
def
custom_run_setup
(
self
,
**
kwargs
):
Sbatch
.
custom_run_setup
(
self
,
**
kwargs
)
Sbatch
.
custom_run_setup
(
self
,
**
kwargs
)
if
kwargs
[
"
script_execution
"
]
and
kwargs
[
"
do_inbetween_processing
"
]:
if
kwargs
[
"
script_execution
"
]
and
kwargs
[
"
do_inbetween_processing
"
]:
logging
.
debug
(
'
Creating param file
'
)
logging
.
debug
(
'
Creating param file
'
)
# write env_file
# write env_file
with
open
(
f
'
{
self
.
slurm_output
_dir
}
/env
{
self
.
job
.
jobid
}
'
,
'
w
'
)
as
file
:
with
open
(
f
'
{
self
.
job
.
tmp
_dir
}
/env
{
self
.
job
.
jobid
}
'
,
'
w
'
)
as
file
:
file
.
write
(
f
"
CONTAINER=
{
self
.
container
}
\0
EXEC_WRAPPER=
{
srun_path
}
\0
PARAMS=
{
self
.
job
.
get_parameters
()
}
\0
OUTPUT_FILE=--output=
{
self
.
slurm_output_file
}
"
)
file
.
write
(
f
"
CONTAINER=
{
self
.
container
}
\0
EXEC_WRAPPER=
{
srun_path
}
\0
PARAMS=
{
self
.
job
.
get_parameters
()
}
\0
OUTPUT_FILE=--output=
{
self
.
slurm_output_file
}
"
)
self
.
job
.
execute
(
f
'
/usr/bin/cp /dev/stdin
'
f
'
{
self
.
slurm_output_dir
}
/batchEnv
{
self
.
job
.
jobid
}
'
,
f
"
{
self
.
job
.
tmp_dir
}
/env
{
self
.
job
.
jobid
}
"
,
f
"
{
self
.
job
.
driver_path
}
/core/scripts/pipeHelper.sh
"
,
skip_env
=
True
,
srun_wrap
=
True
)
def
get_combiner_script
(
self
):
def
get_combiner_script
(
self
):
self
.
_combiner_script
=
f
"
{
self
.
job
.
driver_path
}
/core/scripts/pipeHelper.sh
"
self
.
_combiner_script
=
f
"
{
self
.
job
.
driver_path
}
/core/scripts/pipeHelper.sh
"
return
self
.
_combiner_script
return
self
.
_combiner_script
...
@@ -445,7 +456,7 @@ class Singularity_Batch(Default):
...
@@ -445,7 +456,7 @@ class Singularity_Batch(Default):
skip_env
=
True
,
srun_wrap
=
True
)
skip_env
=
True
,
srun_wrap
=
True
)
# add singularity specific parameter to the properties
# add singularity specific parameter to the properties
property_split
=
self
.
_run_properties
.
split
(
"
"
)
property_split
=
self
.
_run_properties
.
split
(
"
"
)
property_split
.
insert
(
1
,
f
'
--export-file=
{
self
.
slurm_output_dir
}
/
e
nv
{
self
.
job
.
jobid
}
'
)
property_split
.
insert
(
1
,
f
'
--export-file=
{
self
.
slurm_output_dir
}
/
batchE
nv
{
self
.
job
.
jobid
}
'
)
self
.
_run_properties
=
"
"
.
join
(
property_split
)
self
.
_run_properties
=
"
"
.
join
(
property_split
)
return
self
.
_run_properties
return
self
.
_run_properties
...
...
This diff is collapsed.
Click to expand it.
core/scripts/batch.env
0 → 100644
+
1
−
0
View file @
ffe4ca13
CONTAINER=_CONTAINER\0EXEC_WRAPPER=_EXEC_WRAPPER\0PARAMS=_PARAMS\0OUTPUT_FILE=_OUTPUT_FILE
This diff is collapsed.
Click to expand it.
core/scripts/chmodPath.sh
+
1
−
1
View file @
ffe4ca13
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
_path
=
$1
_path
=
$1
set
-e
set
-e
while
test
"
$_path
"
!=
"/work"
;
do
while
test
"
$_path
"
!=
"/work"
;
do
chmod
o+
w
x
"
$_path
"
chmod
o+x
"
$_path
"
_path
=
$(
dirname
"
$_path
"
)
_path
=
$(
dirname
"
$_path
"
)
done
done
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