Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
ALMF
SVLT
Commits
8863f3fa
Commit
8863f3fa
authored
4 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Added method to support queue-based tasks execution
parent
3776345f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_server/base/api.py
+3
-1
3 additions, 1 deletion
model_server/base/api.py
model_server/base/session.py
+11
-0
11 additions, 0 deletions
model_server/base/session.py
with
14 additions
and
1 deletion
model_server/base/api.py
+
3
−
1
View file @
8863f3fa
...
...
@@ -234,4 +234,6 @@ def list_tasks() -> Dict[str, TaskInfo]:
@app.put
(
'
/tasks/run/on_files
'
)
def
task_file_batch
():
# new callable that parameterizes file name to acc_id, then passes this to to /tasks/*/run
pass
\ No newline at end of file
pass
# TODO: tasks to run all enqueued items
\ No newline at end of file
This diff is collapsed.
Click to expand it.
model_server/base/session.py
+
11
−
0
View file @
8863f3fa
...
...
@@ -69,6 +69,16 @@ class TaskCollection(object):
def
list_tasks
(
self
)
->
OrderedDict
:
return
self
.
_tasks
@property
def
next_waiting
(
self
):
"""
Return the task_id of the first status waiting for completion, or else None
"""
for
k
,
v
in
self
.
_tasks
.
items
():
if
v
[
k
][
'
status
'
]
==
self
.
status_codes
[
'
waiting
'
]:
return
k
return
None
def
run_task
(
self
,
task_id
:
str
):
task
=
self
.
_tasks
[
task_id
]
f
=
self
.
_handles
[
task_id
]
...
...
@@ -137,6 +147,7 @@ class _Session(object):
raise
InvalidPathError
(
f
'
Could not find
{
path
}
'
)
self
.
paths
[
key
]
=
Path
(
path
)
# TODO: option to automatically write to file e.g. in automated task queue processing
def
add_accessor
(
self
,
acc
:
GenericImageDataAccessor
,
accessor_id
:
str
=
None
)
->
str
:
"""
Add an accessor to session context
...
...
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