Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
Mirrors
mutalyzer
Commits
05ad5b87
Commit
05ad5b87
authored
9 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Group batch jobs by client IP if email address is missing
parent
4c1baaef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mutalyzer/Scheduler.py
+3
-3
3 additions, 3 deletions
mutalyzer/Scheduler.py
mutalyzer/services/rpc.py
+18
-8
18 additions, 8 deletions
mutalyzer/services/rpc.py
with
21 additions
and
11 deletions
mutalyzer/Scheduler.py
+
3
−
3
View file @
05ad5b87
...
@@ -97,9 +97,9 @@ class Scheduler() :
...
@@ -97,9 +97,9 @@ class Scheduler() :
if
settings
.
TESTING
:
if
settings
.
TESTING
:
return
return
# Mail is set to '
job
@webservice' if the batch job was
submitted using
# Mail is set to '
<IP ADDRESS>
@webservice' if the batch job was
#
the webservice
.
#
submitted using the webservice without specifying an email address
.
if
mailTo
==
'
job
@webservice
'
:
if
mailTo
.
endswith
(
'
@webservice
'
)
:
return
return
#TODO: Handle Connection errors in a try, except clause
#TODO: Handle Connection errors in a try, except clause
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/services/rpc.py
+
18
−
8
View file @
05ad5b87
...
@@ -12,7 +12,7 @@ Mutalyzer RPC services.
...
@@ -12,7 +12,7 @@ Mutalyzer RPC services.
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
binning
import
binning
from
spyne.decorator
import
srpc
from
spyne.decorator
import
rpc
,
srpc
from
spyne.service
import
ServiceBase
from
spyne.service
import
ServiceBase
from
spyne.model.primitive
import
Integer
,
Boolean
,
DateTime
,
Unicode
from
spyne.model.primitive
import
Integer
,
Boolean
,
DateTime
,
Unicode
from
spyne.model.complex
import
Array
from
spyne.model.complex
import
Array
...
@@ -71,8 +71,8 @@ class MutalyzerService(ServiceBase):
...
@@ -71,8 +71,8 @@ class MutalyzerService(ServiceBase):
super
(
MutalyzerService
,
self
).
__init__
(
environ
)
super
(
MutalyzerService
,
self
).
__init__
(
environ
)
#__init__
#__init__
@
s
rpc
(
Mandatory
.
ByteArray
,
Unicode
,
Unicode
,
Unicode
,
_returns
=
Unicode
)
@rpc
(
Mandatory
.
ByteArray
,
Unicode
,
Unicode
,
Unicode
,
_returns
=
Unicode
)
def
submitBatchJob
(
data
,
process
=
'
NameChecker
'
,
argument
=
''
,
email
=
None
):
def
submitBatchJob
(
ctx
,
data
,
process
=
'
NameChecker
'
,
argument
=
''
,
email
=
None
):
"""
"""
Submit a batch job.
Submit a batch job.
...
@@ -80,10 +80,10 @@ class MutalyzerService(ServiceBase):
...
@@ -80,10 +80,10 @@ class MutalyzerService(ServiceBase):
website <https://mutalyzer.nl/batch>.
website <https://mutalyzer.nl/batch>.
Batch jobs are processed using round-robin scheduling grouped by email
Batch jobs are processed using round-robin scheduling grouped by email
address
. Per email address, jobs are processed sequentially in ord
er
address
(or client IP address if no email address is specified). P
er
of submission. Jobs with no email address specified end up in a shared
email address, jobs are processed sequentially in order of submission.
group.
This means you
r job is likely to be
pro
c
ess
ed sooner if
you
This means you
will not see any
pro
gr
ess
on this job until all
you
r
provide an email address
.
earlier jobs have finished
.
On error an exception is raised:
On error an exception is raised:
- detail: Human readable description of the error.
- detail: Human readable description of the error.
...
@@ -147,7 +147,17 @@ class MutalyzerService(ServiceBase):
...
@@ -147,7 +147,17 @@ class MutalyzerService(ServiceBase):
if
job
is
None
:
if
job
is
None
:
raise
Fault
(
'
EPARSE
'
,
'
Could not parse input file, please check your file format.
'
)
raise
Fault
(
'
EPARSE
'
,
'
Could not parse input file, please check your file format.
'
)
result_id
=
scheduler
.
addJob
(
email
or
'
job@webservice
'
,
job
,
columns
,
if
not
email
:
# If no email address is specified, we create a fake one based on
# the caller's IP address. This makes sure the scheduler processes
# jobs grouped by user.
try
:
address
=
unicode
(
ctx
.
transport
.
req_env
[
'
REMOTE_ADDR
'
])
except
(
AttributeError
,
KeyError
):
address
=
'
localhost
'
email
=
'
%s@webservice
'
%
address
result_id
=
scheduler
.
addJob
(
email
,
job
,
columns
,
batch_types
[
process
],
argument
)
batch_types
[
process
],
argument
)
return
result_id
return
result_id
...
...
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