Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Lustrec - public version
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LustreC
Lustrec - public version
Commits
7f2767c0
Commit
7f2767c0
authored
2 years ago
by
GARION Christophe
Browse files
Options
Downloads
Patches
Plain Diff
[scripts] refactor script to launch docker
parent
3b482498
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
rundocker.sh
+0
-11
0 additions, 11 deletions
rundocker.sh
scripts/rundocker.sh
+59
-0
59 additions, 0 deletions
scripts/rundocker.sh
with
59 additions
and
11 deletions
rundocker.sh
deleted
100644 → 0
+
0
−
11
View file @
3b482498
#!/usr/bin/env bash
containerId
=
leliobrun/lustrec-env
command
-v
docker
>
/dev/null 2>&1
||
{
\
echo
>
&2
"docker is required but could not be found. Aborting."
;
\
echo
>
&2
"To setup Docker: https://docs.docker.com/engine/getstarted/step_one/"
;
\
exit
1
;
}
docker run
-it
--rm
--user
$(
id
-u
)
:
$(
id
-g
)
\
-v
$PWD
:/home/opam/lustrec
$containerId
$1
This diff is collapsed.
Click to expand it.
scripts/rundocker.sh
0 → 100644
+
59
−
0
View file @
7f2767c0
#!/usr/bin/env bash
# shell script to launch LustreC docker, mainly for launching tests
# see the usage function for more explanations
# usage function
usage
()
{
echo
"Usage: "
$0
" [-h|--help] [-i|--id ID] [-t|--tmp TMP_DIR] [options passed to docker]"
echo
" Run a docker instance named
\"
lustrec_docker
\"
built with image "
$CONTAINER_ID
" by default."
echo
" Available options:"
echo
" - [-i|--id ID] | change container image ID"
echo
" - [-t|--tmp TMP_DIR] | change binding for /tmp dir in container. Default to /tmp"
exit
1
}
# default values
CONTAINER_ID
=
leliobrun/lustrec-env
TMP_DIR
=
/tmp
# use getopt to get arguments
TEMP
=
$(
getopt
-o
'hi:t:'
--long
'help,id:,tmp:'
-n
'rundocker.sh'
--
"
$@
"
)
eval set
--
"
$TEMP
"
unset
TEMP
# main loop to get arguments
while
true
;
do
case
"
$1
"
in
'-h'
|
'--help'
)
usage
;;
'-i'
|
'--id'
)
CONTAINER_ID
=
"
$2
"
shift
2
continue
;;
'-t'
|
'--tmp'
)
TMP_DIR
=
"
$2
"
shift
2
continue
;;
*
)
shift
break
;;
esac
done
# check if docker is available
command
-v
docker
>
/dev/null 2>&1
||
{
\
echo
>
&2
"docker is required but could not be found. Aborting."
;
\
echo
>
&2
"To setup Docker: https://docs.docker.com/engine/getstarted/step_one/"
;
\
exit
1
;
}
# launch docker
docker run
-it
--rm
--user
$(
id
-u
)
:
$(
id
-g
)
\
-name
"lustrec_docker"
\
-v
${
TMP_DIR
}
:/tmp
-v
${
PWD
}
:/home/opam/lustrec
\
${
CONTAINER_ID
}
$@
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