Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
076e0795
Unverified
Commit
076e0795
authored
7 years ago
by
Nathaniel Kofalt
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1032 from scitran/user-cancel
Allow users to cancel running jobs
parents
1c312f70
ec16cbaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/jobs/handlers.py
+0
-3
0 additions, 3 deletions
api/jobs/handlers.py
api/jobs/queue.py
+3
-1
3 additions, 1 deletion
api/jobs/queue.py
api/placer.py
+0
-1
0 additions, 1 deletion
api/placer.py
with
3 additions
and
5 deletions
api/jobs/handlers.py
+
0
−
3
View file @
076e0795
...
...
@@ -310,7 +310,6 @@ class JobsHandler(base.RequestHandler):
count
=
Queue
.
scan_for_orphans
()
return
{
'
orphaned
'
:
count
}
class
JobHandler
(
base
.
RequestHandler
):
"""
Provides /Jobs/<jid> routes.
"""
...
...
@@ -376,7 +375,6 @@ class JobHandler(base.RequestHandler):
encoded
=
pseudo_consistent_json_encode
({
"
config
"
:
c
})
self
.
response
.
app_iter
=
StringIO
.
StringIO
(
encoded
)
@require_login
def
put
(
self
,
_id
):
"""
...
...
@@ -420,7 +418,6 @@ class JobHandler(base.RequestHandler):
job
.
inputs
[
x
].
check_access
(
self
.
uid
,
'
ro
'
)
# Unlike jobs-add, explicitly not checking write access to destination.
def
get_logs
(
self
,
_id
):
"""
Get a job
'
s logs
"""
...
...
This diff is collapsed.
Click to expand it.
api/jobs/queue.py
+
3
−
1
View file @
076e0795
...
...
@@ -32,6 +32,7 @@ JOB_STATES_ALLOWED_MUTATE = [
JOB_TRANSITIONS
=
[
'
pending --> running
'
,
'
pending --> cancelled
'
,
'
running --> cancelled
'
,
'
running --> failed
'
,
'
running --> complete
'
,
]
...
...
@@ -57,8 +58,9 @@ class Queue(object):
"""
if
job
.
state
not
in
JOB_STATES_ALLOWED_MUTATE
:
raise
Exception
(
'
Cannot mutate a job that is
'
+
job
.
state
+
'
.
'
)
raise
InputValidation
Exception
(
'
Cannot mutate a job that is
'
+
job
.
state
+
'
.
'
)
# TODO: This should use InputValidationException or similar
if
'
state
'
in
mutation
and
not
valid_transition
(
job
.
state
,
mutation
[
'
state
'
]):
raise
Exception
(
'
Mutating job from
'
+
job
.
state
+
'
to
'
+
mutation
[
'
state
'
]
+
'
not allowed.
'
)
...
...
This diff is collapsed.
Click to expand it.
api/placer.py
+
0
−
1
View file @
076e0795
...
...
@@ -104,7 +104,6 @@ class Placer(object):
session_id
=
AcquisitionStorage
().
get_container
(
str
(
self
.
id_
)).
get
(
'
session
'
)
SessionStorage
().
recalc_session_compliance
(
session_id
,
hard
=
True
)
class
TargetedPlacer
(
Placer
):
"""
A placer that can accept N files to a specific container (acquisition, etc).
...
...
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