Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
fab73f7e
Commit
fab73f7e
authored
Jan 31, 2017
by
BAIRE Anthony
Browse files
add MAX_JOBS to configure the number of concurrent jobs
parent
5fe27202
Changes
3
Hide whitespace changes
Inline
Side-by-side
docker/Dockerfile
View file @
fab73f7e
...
...
@@ -20,6 +20,7 @@ EXPOSE 4567
ENV
PORT="4567" \
ENV="" \
REGISTRY="" \
MAX_JOBS="4" \
DATASTORE_PATH="/data/{ENV}/rails/rw/datastore/" \
SANDBOX_PATH="/data/{ENV}/ssh/cache/sandbox/" \
DOCKER_HOST="unix:///run/docker.sock" \
...
...
docker/controller.py
View file @
fab73f7e
...
...
@@ -739,8 +739,8 @@ EOF
class
JobManager
(
Manager
):
def
__init__
(
self
,
ctrl
,
nb_
thread
s
=
NB_JOB_TASKS
):
super
().
__init__
(
nb_
thread
s
)
def
__init__
(
self
,
ctrl
,
nb_
job
s
=
NB_JOB_TASKS
):
super
().
__init__
(
nb_
job
s
)
self
.
ctrl
=
ctrl
def
_run_job
(
self
,
job_id
,
ver_id
):
...
...
@@ -1036,7 +1036,8 @@ class ImageManager:
class
DockerController
:
def
__init__
(
self
,
sandbox_host
,
swarm_host
,
mysql_host
,
port
,
registry
,
env
,
datastore_path
,
sandbox_path
):
port
,
registry
,
env
,
datastore_path
,
sandbox_path
,
max_jobs
):
self
.
sandbox
=
docker
.
Client
(
sandbox_host
)
self
.
swarm
=
self
.
sandbox
if
sandbox_host
==
swarm_host
else
docker
.
Client
(
swarm_host
)
...
...
@@ -1053,7 +1054,7 @@ class DockerController:
self
.
image_manager
=
ImageManager
(
self
)
self
.
sandbox_manager
=
SandboxManager
(
self
)
self
.
job_manager
=
JobManager
(
self
)
self
.
job_manager
=
JobManager
(
self
,
max_jobs
)
self
.
registry
=
registry
self
.
env
=
env
...
...
docker/test_controller.py
View file @
fab73f7e
...
...
@@ -154,6 +154,7 @@ class ControllerTestCase(unittest.TestCase):
env
=
ENV
,
datastore_path
=
"/data/dev/cache/test/datastore"
,
sandbox_path
=
"/data/dev/ssh/cache/sandbox"
,
max_jobs
=
4
,
)
@
classmethod
...
...
Write
Preview
Markdown
is supported
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