Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IMP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IMP-dev
IMP
Commits
3e88cfc9
Commit
3e88cfc9
authored
9 years ago
by
Yohan Jarosz
Browse files
Options
Downloads
Patches
Plain Diff
mount config dir
parent
6fefce81
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
IMP
+11
-4
11 additions, 4 deletions
IMP
with
11 additions
and
4 deletions
IMP
+
11
−
4
View file @
3e88cfc9
...
...
@@ -144,18 +144,21 @@ def init(args):
"""
CURRENT_PATH
=
Path
(
__file__
).
parent
.
abspath
()
database_path
=
Path
(
args
[
'
-d
'
]).
abspath
()
config_file
=
str
(
Path
(
args
[
'
-c
'
]).
name
)
config_directory
=
Path
(
args
[
'
-c
'
]).
parent
.
abspath
()
# prepare docker command
docker_cmd
=
'
docker run --rm -v {d}:/databases -e CONFIGFILE={c} {n}:{v}
'
docker_cmd
=
'
docker run --rm -v {d}:/databases
-v {conf}:/conf
-e CONFIGFILE={c} {n}:{v}
'
formatting_args
=
{
'
d
'
:
database_path
,
'
n
'
:
args
[
'
-n
'
],
'
v
'
:
args
[
'
-v
'
],
'
c
'
:
args
[
'
-c
'
]
'
c
'
:
config_file
,
'
conf
'
:
config_directory
}
# override docker command if the user want to mount a specific version of IMP codebase.
if
args
[
'
--current
'
]:
formatting_args
[
'
p
'
]
=
CURRENT_PATH
docker_cmd
=
'
docker run --rm -v {p}:/code -v {d}:/databases -e CONFIGFILE={c} {n}:{v}
'
docker_cmd
=
'
docker run --rm -v {p}:/code -v {d}:/databases
-v {conf}:/conf
-e CONFIGFILE={c} {n}:{v}
'
# format docker command
docker_cmd
=
docker_cmd
.
format
(
**
formatting_args
)
...
...
@@ -190,11 +193,15 @@ def run(args):
database_path
=
Path
(
args
[
'
-d
'
]).
abspath
()
config_file
=
str
(
Path
(
args
[
'
-c
'
]).
name
)
config_directory
=
Path
(
args
[
'
-c
'
]).
parent
.
abspath
()
# configure IMP mount point to the docker container
mount_points
=
[
'
-v %s:/data
'
%
common_path
,
'
-v %s:/output
'
%
output
,
'
-v %s:/databases
'
%
database_path
,
'
-v %s:/conf
'
%
config_directory
]
# add code mount point if the user want to mount a specific version of IMP codebase.
if
args
[
'
--current
'
]:
...
...
@@ -213,7 +220,7 @@ def run(args):
envs
+=
[
'
-e MT=
"
%s
"'
%
'
'
.
join
(
mt
)]
if
args
[
'
-c
'
]:
envs
+=
[
'
-e CONFIGFILE=%s
'
%
args
[
'
-c
'
]
]
envs
+=
[
'
-e CONFIGFILE=%s
'
%
config_file
]
if
args
[
'
-a
'
]:
envs
+=
[
'
-e IMP_ASSEMBLER=%s
'
%
args
[
'
-a
'
]]
...
...
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