Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
HTConfig
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
Rene Caspart
HTConfig
Commits
85dc422d
Commit
85dc422d
authored
4 years ago
by
Maximilian Horzela
Browse files
Options
Downloads
Patches
Plain Diff
Adding soft memory limit for docker jobs while turning off swapping
parent
aa27f73c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/docker_wrapper.py
+6
-2
6 additions, 2 deletions
scripts/docker_wrapper.py
with
6 additions
and
2 deletions
scripts/docker_wrapper.py
+
6
−
2
View file @
85dc422d
...
...
@@ -82,9 +82,13 @@ def main():
if
arg
in
[
'
exe
'
,
'
image
'
,
'
command
'
]:
continue
for
val
in
vals
or
[]:
docker_opts
+=
[
'
--
'
+
arg
,
val
]
if
arg
==
'
memory
'
:
docker_opts
+=
[
'
--memory-swap
'
,
val
]
docker_opts
+=
[
'
--memory
'
,
int
(
val
)
*
2
]
docker_opts
+=
[
'
--memory-swap
'
,
int
(
val
)
*
2
]
docker_opts
+=
[
'
--memory-reservation
'
,
val
]
docker_opts
+=
[
'
--memory-swappiness
'
,
0
]
else
:
docker_opts
+=
[
'
--
'
+
arg
,
val
]
# Enable GPUS if CUDA_VISIBLE_DEVICES is set to a GPU but --gpus flag is not present
if
[
x
for
x
in
docker_opts
if
((
'
CUDA_VISIBLE_DEVICES=
'
in
x
)
and
not
(
'
CUDA_VISIBLE_DEVICES=10000
'
in
x
))]
and
(
'
--gpus
'
not
in
docker_opts
):
...
...
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