Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
beat
beat.web
Commits
d5d550d2
Commit
d5d550d2
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[backend] Improved scheduling and current load calculation
parent
77caca35
No related branches found
No related tags found
1 merge request
!194
Scheduler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/backend/schedule.py
+10
-0
10 additions, 0 deletions
beat/web/backend/schedule.py
with
10 additions
and
0 deletions
beat/web/backend/schedule.py
+
10
−
0
View file @
d5d550d2
...
@@ -176,6 +176,11 @@ def schedule():
...
@@ -176,6 +176,11 @@ def schedule():
(taking into consideration blocking as executed on step 3) and leave the
(taking into consideration blocking as executed on step 3) and leave the
job split on the list if there is a free slot, otherwise remove it.
job split on the list if there is a free slot, otherwise remove it.
Returns:
list: The list of splits assigned at this scheduling iteration
'''
'''
# updates jobs with split errors, cancel experiments if problems occur
# updates jobs with split errors, cancel experiments if problems occur
...
@@ -201,6 +206,8 @@ def schedule():
...
@@ -201,6 +206,8 @@ def schedule():
if
availability
<=
0
:
continue
if
availability
<=
0
:
continue
whitelist
[
worker
]
=
availability
whitelist
[
worker
]
=
availability
assigned_splits
=
[]
for
batch
in
splits_to_consider
:
for
batch
in
splits_to_consider
:
if
not
batch
:
continue
#empty list
if
not
batch
:
continue
#empty list
...
@@ -217,6 +224,7 @@ def schedule():
...
@@ -217,6 +224,7 @@ def schedule():
if
avail
>=
required_cores
:
if
avail
>=
required_cores
:
logger
.
info
(
"
Assigning `%s
'
to worker `%s
'"
,
split
,
c
)
logger
.
info
(
"
Assigning `%s
'
to worker `%s
'"
,
split
,
c
)
split
.
schedule
(
c
)
#assign job split to worker
split
.
schedule
(
c
)
#assign job split to worker
assigned_splits
.
append
(
split
)
whitelist
[
c
]
-=
required_cores
whitelist
[
c
]
-=
required_cores
logger
.
debug
(
"
`%s
'
cores available: %d
"
,
c
,
whitelist
[
c
])
logger
.
debug
(
"
`%s
'
cores available: %d
"
,
c
,
whitelist
[
c
])
assigned
=
True
assigned
=
True
...
@@ -231,6 +239,8 @@ def schedule():
...
@@ -231,6 +239,8 @@ def schedule():
job
,
c0
)
job
,
c0
)
del
whitelist
[
c0
]
del
whitelist
[
c0
]
return
assigned_splits
def
process
(
split
,
environments
,
cpulimit
=
None
):
def
process
(
split
,
environments
,
cpulimit
=
None
):
'''
Process assigned job splits using beat.core
'''
Process assigned job splits using beat.core
...
...
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