Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AMBS
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
AMBS
Commits
942a7f63
Commit
942a7f63
authored
4 years ago
by
Michael Langguth
Browse files
Options
Downloads
Patches
Plain Diff
Several bugfixes in generate_workflow_runscripts.sh
parent
489ec562
No related branches found
No related tags found
No related merge requests found
Pipeline
#45263
failed
4 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
video_prediction_savp/env_setup/generate_workflow_runscripts.sh
+15
-8
15 additions, 8 deletions
...prediction_savp/env_setup/generate_workflow_runscripts.sh
with
15 additions
and
8 deletions
video_prediction_savp/env_setup/generate_workflow_runscripts.sh
+
15
−
8
View file @
942a7f63
...
@@ -16,25 +16,32 @@ HOST_NAME=`hostname`
...
@@ -16,25 +16,32 @@ HOST_NAME=`hostname`
### some sanity checks ###
### some sanity checks ###
# check input arguments
# check input arguments
if
!
[
$#
-lt
1]
;
then
if
[[
"$#"
-lt
1
]]
;
then
echo
"ERROR: Pass path to workflow script to be generated..."
echo
"ERROR: Pass path to workflow runscript (without '_template.sh') to be generated..."
exit
1
else
else
curr_script
=
$1
curr_script
=
$1
if
[
$#
-gt
1]
;
then
if
[
[
"
$#
"
-gt
1
]
]
;
then
exp_id
=
$2
exp_id
=
$2
else
else
exp_id
=
"exp1"
exp_id
=
"exp1"
fi
fi
fi
fi
# check existence of template script
# check existence of template script
if
!
[[
-f
${
curr_script
}
_template.sh
]]
;
then
if
!
[[
-f
${
curr_script
}
_template.sh
]]
;
then
echo
"WARNING: Could not find expected Batch script '
${
curr_script
}
_template.sh'."
echo
"WARNING: Could not find expected Batch script '
${
curr_script
}
_template.sh'."
echo
"Thus, no corresponding executable script is created!"
echo
"Thus, no corresponding executable script is created!"
if
[[
${
curr_script
}
==
*
"template"
*
||
${
curr_script
}
==
*
".sh"
*
]]
;
then
echo
"ERROR: Omit '_template' and/or '.sh' from Bash script argument."
exit
1
else
exit
0
# still ok, i.e. only a WARNING is raised
exit
0
# still ok, i.e. only a WARNING is raised
fi
fi
fi
# check if target script is unique
# check if target script is unique
target_script
=
${
curr_script
}
_
${
exp_id
}
.sh
target_script
=
${
curr_script
}
_
${
exp_id
}
.sh
if
[[
]]
;
then
if
[[
-f
${
target_script
}
]]
;
then
echo
"ERROR:
${
target_script
}
already exist."
echo
"ERROR:
${
target_script
}
already exist."
echo
"Set explicitly a different experiment identifier."
echo
"Set explicitly a different experiment identifier."
exit
1
exit
1
...
@@ -43,21 +50,21 @@ fi
...
@@ -43,21 +50,21 @@ fi
# create copy of template which is modified subsequently
# create copy of template which is modified subsequently
cp
${
curr_script
}
_template.sh
${
target_script
}
cp
${
curr_script
}
_template.sh
${
target_script
}
# remove template identifiers
# remove template identifiers
num_lines
=
`
awk
'/Template identifier
s
/{ print NR }'
${
target_script
}
`
num_lines
=
`
awk
'/Template identifier/{ print NR }'
${
target_script
}
`
line_s
=
`
echo
${
num_lines
}
|
cut
-d
' '
-f
1
`
line_s
=
`
echo
${
num_lines
}
|
cut
-d
' '
-f
1
`
line_e
=
`
echo
${
num_lines
}
|
cut
-d
' '
-f
2
`
line_e
=
`
echo
${
num_lines
}
|
cut
-d
' '
-f
2
`
if
[[
${
line_s
}
==
""
||
${
line_e
}
==
""
]]
;
then
if
[[
${
line_s
}
==
""
||
${
line_e
}
==
""
]]
;
then
echo
"ERROR:
${
curr_script
}
_template.sh exists, but does not seem to be a valid template script."
echo
"ERROR:
${
curr_script
}
_template.sh exists, but does not seem to be a valid template script."
rm
${
target_script
}
# remove copy again
exit
1
exit
1
else
else
sed
-
e
'
${line_s},${line_e}d
'
${
target_script
}
sed
-
i
"
${
line_s
}
,
${
line_e
}
d
"
${
target_script
}
fi
fi
# set exp_id in (Batch) script if present
# set exp_id in (Batch) script if present
if
[[
`
grep
"exp_id="
${
target_script
}
`
]]
;
then
if
[[
`
grep
"exp_id="
${
target_script
}
`
]]
;
then
sed
-i
"s/exp_id=.*/exp_id=
$exp_id
/g"
${
target_script
}
sed
-i
"s/exp_id=.*/exp_id=
$exp_id
/g"
${
target_script
}
fi
fi
grep
-Fxq
"
$FILENAME
"
my_list.txt
# set correct e-mail address in Batch scripts on Juwels and HDF-ML
# set correct e-mail address in Batch scripts on Juwels and HDF-ML
if
[[
"
${
HOST_NAME
}
"
==
hdfml
*
||
"
${
HOST_NAME
}
"
==
juwels
*
]]
;
then
if
[[
"
${
HOST_NAME
}
"
==
hdfml
*
||
"
${
HOST_NAME
}
"
==
juwels
*
]]
;
then
if
[
command
-v
jutil
]
;
then
if
[
command
-v
jutil
]
;
then
...
...
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