Skip to content
Snippets Groups Projects
Commit 9e60c9ba authored by Phil Dawson's avatar Phil Dawson Committed by Phil Dawson
Browse files

Revert "WIP: use priority queue in schedular"

This reverts commit 34395d06.
parent 34395d06
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,3 @@ class CacheSizeJob(Job):
def child_process_data(self):
return {}
def key(self):
return (100, 'cache-size')
......@@ -32,6 +32,3 @@ class CleanupJob(Job):
def parent_complete(self, success, result):
if success:
self._artifacts.set_cache_size(result)
def key(self):
return (0, 'cleanup')
......@@ -22,13 +22,6 @@ from ..._message import Message, MessageType
from .job import Job
_ACTIONS = {
"Build": 10,
"Fetch": 20,
"Pull": 30,
"Push": 40,
"Track": 50,
}
# ElementJob()
#
......@@ -120,6 +113,3 @@ class ElementJob(Job):
data['workspace'] = workspace.to_dict()
return data
def key(self):
return (_ACTIONS.get(self.action_name, 100), self._element.name)
......@@ -353,10 +353,6 @@ class Job():
def child_process_data(self):
return {}
def key(self):
raise ImplError("Job '{kind}' does not implement key()"
.format(kind=type(self).__name__))
#######################################################
# Local Private Methods #
#######################################################
......
......@@ -25,7 +25,6 @@ from itertools import chain
import signal
import datetime
from contextlib import contextmanager
from sortedcontainers import SortedList
# Local imports
from .resources import Resources, ResourceType
......@@ -73,7 +72,7 @@ class Scheduler():
# Public members
#
self.active_jobs = [] # Jobs currently being run in the scheduler
self.waiting_jobs = SortedList([], key=lambda job: job.key()) # Jobs waiting for resources
self.waiting_jobs = [] # Jobs waiting for resources
self.queues = None # Exposed for the frontend to print summaries
self.context = context # The Context object shared with Queues
self.terminated = False # Whether the scheduler was asked to terminate or has terminated
......@@ -223,7 +222,7 @@ class Scheduler():
#
def schedule_jobs(self, jobs):
for job in jobs:
self.waiting_jobs.add(job)
self.waiting_jobs.append(job)
# job_completed():
#
......
......@@ -343,7 +343,6 @@ setup(name='BuildStream',
'jinja2 >= 2.10',
'protobuf >= 3.5',
'grpcio >= 1.10',
'sortedcontainers >= 1.5.7',
],
entry_points=bst_install_entry_points,
tests_require=dev_requires,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment