Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
e3ceb19f
Commit
e3ceb19f
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Name docker client like mentioned in the api docs
parent
db0c2532
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
app/scheduler_functions.py
+3
-7
3 additions, 7 deletions
app/scheduler_functions.py
with
3 additions
and
7 deletions
app/scheduler_functions.py
+
3
−
7
View file @
e3ceb19f
...
...
@@ -9,7 +9,7 @@ import os
def
check_jobs
():
app
=
create_minimal_app
(
os
.
getenv
(
'
FLASK_CONFIG
'
)
or
'
default
'
)
app
.
app_context
().
push
()
docker_
client
=
docker
.
from_env
()
client
=
docker
.
from_env
()
jobs
=
db
.
session
.
query
(
Job
)
submitted_jobs
=
jobs
.
filter_by
(
status
=
'
submitted
'
).
all
()
foo_jobs
=
jobs
.
filter
(
Job
.
status
!=
'
complete
'
,
...
...
@@ -54,12 +54,8 @@ def check_jobs():
'
has the required ressources available (not reserved), the
'
service gets queued by the Docker engine until a node is able
'
to meet the requirements.
'
'
TODO: The name argument should be used with the prepared value
'
(name=_name). Because there is no id generator for now, it is
'
not set, so that the Docker engine assigns a random name.
'''
service
=
docker_
client
.
services
.
create
(
service
=
client
.
services
.
create
(
_image
,
command
=
_command
,
constraints
=
_constraints
,
...
...
@@ -74,7 +70,7 @@ def check_jobs():
'''
'
TODO: Handle service not found error.
'''
service
=
docker_
client
.
services
.
get
(
str
(
job
.
id
))
service
=
client
.
services
.
get
(
str
(
job
.
id
))
job
.
status
=
service
.
tasks
()[
0
].
get
(
'
Status
'
).
get
(
'
State
'
)
if
job
.
status
==
'
complete
'
or
job
.
status
==
'
failed
'
:
job
.
end_date
=
datetime
.
utcnow
()
...
...
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