Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
ExaCT
Rosetta
Commits
35a06a98
Commit
35a06a98
authored
4 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Added support for user data folder with local Docker containers. Cleaned up some conf vars.
parent
3be32e1a
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
services/webapp/code/rosetta/core_app/computing_managers.py
+6
-5
6 additions, 5 deletions
services/webapp/code/rosetta/core_app/computing_managers.py
services/webapp/code/rosetta/settings.py
+3
-4
3 additions, 4 deletions
services/webapp/code/rosetta/settings.py
with
9 additions
and
9 deletions
services/webapp/code/rosetta/core_app/computing_managers.py
+
6
−
5
View file @
35a06a98
from
.models
import
TaskStatuses
,
KeyPair
,
Task
from
.utils
import
os_shell
from
.exceptions
import
ErrorMessage
,
ConsistencyException
from
django.conf
import
settings
# Setup logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
# Conf
TASK_DATA_DIR
=
"
/data
"
class
ComputingManager
(
object
):
...
...
@@ -77,6 +75,9 @@ class LocalComputingManager(ComputingManager):
def
_start_task
(
self
,
task
):
if
task
.
container
.
type
!=
'
docker
'
:
raise
ErrorMessage
(
'
Sorry, only Docker container are supported on this computing resource.
'
)
# Init run command #--cap-add=NET_ADMIN --cap-add=NET_RAW
run_command
=
'
sudo docker run --network=rosetta_default --name rosetta-task-{}
'
.
format
(
task
.
id
)
...
...
@@ -84,8 +85,8 @@ class LocalComputingManager(ComputingManager):
if
task
.
auth_pass
:
run_command
+=
'
-eAUTH_PASS={}
'
.
format
(
task
.
auth_pass
)
#
D
ata volume
run_command
+=
'
-v {}/
task
-{}:/data
'
.
format
(
TASK
_DATA_DIR
,
task
.
id
)
#
User d
ata volume
run_command
+=
'
-v {}/
user
-{}:/data
'
.
format
(
settings
.
LOCAL_USER
_DATA_DIR
,
task
.
user
.
id
)
# Set registry string
if
task
.
container
.
registry
==
'
local
'
:
...
...
This diff is collapsed.
Click to expand it.
services/webapp/code/rosetta/settings.py
+
3
−
4
View file @
35a06a98
...
...
@@ -151,10 +151,6 @@ SWAGGER_SETTINGS = {
'
USE_SESSION_AUTH
'
:
False
}
# Data path for resources etc.
DATA_PATH
=
'
/data/
'
TMP_PATH
=
'
/tmp/
'
#===============================
# Email settings
...
...
@@ -227,6 +223,9 @@ LOGGING = {
}
# Local user data dir
LOCAL_USER_DATA_DIR
=
os
.
environ
.
get
(
'
LOCAL_USER_DATA_DIR
'
,
'
/data
'
)
#===============================
# Auth
...
...
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