Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
medema-group
BiG-SCAPE
Commits
d65bd1a0
Commit
d65bd1a0
authored
Aug 06, 2018
by
Jorge Navarro Muñoz
Browse files
Add file to easily run BiG-SCAPE using a docker image (single use)
parent
a1db4f4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
run_bigscape
0 → 100644
View file @
d65bd1a0
#!/bin/bash
if
[[
$#
-eq
0
||
$1
==
"-h"
||
$1
==
"--help"
]]
;
then
docker run
\
--detach
=
false
\
--rm
\
--user
=
$(
id
-u
)
:
$(
id
-g
)
\
docker-registry.wur.nl/medema-group/big-scape
\
$@
else
set
-o
errexit
set
-o
nounset
function
realpath
()
{
echo
$(
readlink
-f
$1
2>/dev/null
||
python
-c
"import sys; import os; print(os.path.realpath(os.path.expanduser(sys.argv[1])))"
$1
)
}
# handle input file
readonly
INPUT_FILE
=
$(
basename
$1
)
echo
input
${
INPUT_FILE
}
readonly
INPUT_DIR
=
$(
dirname
$(
realpath
$1
))
shift
# handle output file
if
[[
$#
-eq
0
]]
;
then
echo
You must specify an output
dir
exit
1
;
else
readonly
OUTPUT_FILE
=
$(
basename
$1
)
echo
output
${
OUTPUT_FILE
}
readonly
OUTPUT_DIR
=
$(
dirname
$(
realpath
$1
))
shift
fi
if
[
!
-d
${
OUTPUT_DIR
}
]
;
then
mkdir
${
OUTPUT_DIR
}
fi
# Links within the container
readonly
CONTAINER_SRC_DIR
=
/home/input
readonly
CONTAINER_DST_DIR
=
/home/output
#if [ ${INPUT_FILE} ${OUTPUT_FILE} ]; then
if
[
!
-z
${
INPUT_FILE
}
]
&&
[
!
-z
${
OUTPUT_FILE
}
]
;
then
echo
bigscape is running now
docker run
\
--volume
${
INPUT_DIR
}
:
${
CONTAINER_SRC_DIR
}
:ro
\
--volume
${
OUTPUT_DIR
}
:
${
CONTAINER_DST_DIR
}
:rw
\
--detach
=
false
\
--rm
\
--user
=
$(
id
-u
)
:
$(
id
-g
)
\
docker-registry.wur.nl/medema-group/big-scape
\
-i
${
CONTAINER_SRC_DIR
}
/
${
INPUT_FILE
}
\
-o
${
CONTAINER_DST_DIR
}
/
${
OUTPUT_FILE
}
\
$@
fi
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment