Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
919f821f
Commit
919f821f
authored
1 month ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Import: amend restart mode (-r true) to create mkexp date file
Needs separation of script and work dirs, moved to common temp dir
parent
d6c291ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
importexp
+20
-7
20 additions, 7 deletions
importexp
with
20 additions
and
7 deletions
importexp
+
20
−
7
View file @
919f821f
...
...
@@ -47,10 +47,13 @@ then
TMPDIR
=
$PWD
export
TMPDIR
fi
$DEBUG
||
trap
'rm -rf $RUN_FILE $LOG_FILE $WORK_DIR'
0
RUN_FILE
=
$(
mktemp
)
LOG_FILE
=
$(
mktemp
)
WORK_DIR
=
$(
mktemp
-d
)
$DEBUG
||
trap
'rm -rf $MKTEMP_DIR'
0
MKTEMP_DIR
=
$(
mktemp
-d
)
RUN_FILE
=
$MKTEMP_DIR
/run
LOG_FILE
=
$MKTEMP_DIR
/log
WORK_DIR
=
$MKTEMP_DIR
/work
SCRIPT_DIR
=
$MKTEMP_DIR
/scripts
mkdir
$WORK_DIR
$SCRIPT_DIR
for
RUN_SCRIPT
do
...
...
@@ -129,11 +132,11 @@ done\
sed
-r
'
s@^(\s*)(cat\s+\$thisscript)@\1: \2@
2 i\
cd '
$
WORK
_DIR
'
cd '
$
SCRIPT
_DIR
'
/^\s*#.*start\s+experiment/ i'
"
$SHOW_HERE_DOCS
"
'
s:^(\s*)(set\s+\+x\s*$|(set\s+\+\w+)x):\1\3:
'
"
${
REMOVE_ERROR_FLAG_SH
-
}
"
'
s:^(\s*)SCRIPT_DIR=.*$:\1SCRIPT_DIR='
$
WORK
_DIR
':
s:^(\s*)SCRIPT_DIR=.*$:\1SCRIPT_DIR='
$
SCRIPT
_DIR
':
s:^(\s*)experiments_dir=.*$:\1experiments_dir='
$WORK_DIR
':
s:^(\s*)BUILD_DIR=.*$:\1BUILD_DIR='
$BUILD_DIR
':
s:^(\s*)EXPDIR=.*$:\1EXPDIR='
$WORK_DIR
':
...
...
@@ -164,10 +167,20 @@ cd '$WORK_DIR'
if
[
"x
$RESTART
"
!=
x
]
# Try to mimic restart logic
then
restart
=
"
$RESTART
"
restart
=
"
.
$RESTART
.
"
export
restart
fi
if
[
"x
$RESTART
"
=
xtrue
]
# Also, create date file for mkexp based scripts
then
eval
"
$(
perl
-lne
'/^\s*(?:export\s)?\s*(
EXPNAME |
initial_date
)(=.*)$/x and print($1, $2)'
$RUN_FILE
)
"
echo
"
$initial_date
"
>
$SCRIPT_DIR
/
$EXPNAME
.date
fi
echo
"Running '
$RUN_SCRIPT
'"
>
&2
${
COMMAND
:-
/bin/sh
}
-x
$RUN_FILE
>
$LOG_FILE
2>&1
...
...
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