|
@@ -52,6 +52,7 @@ from pycs.frontend.endpoints.results.ResetResults import ResetResults
|
|
|
from pycs.frontend.notifications.NotificationManager import NotificationManager
|
|
|
from pycs.frontend.util.JSONEncoder import JSONEncoder
|
|
|
from pycs.jobs.JobRunner import JobRunner
|
|
|
+from pycs.util.PipelineCache import PipelineCache
|
|
|
|
|
|
|
|
|
class WebServer:
|
|
@@ -76,6 +77,10 @@ class WebServer:
|
|
|
self.logger.info('Starting job runner... ')
|
|
|
self.jobs = JobRunner()
|
|
|
|
|
|
+ # create pipeline cache
|
|
|
+ self.logger.info('Creating pipeline cache')
|
|
|
+ self.pipelines = PipelineCache(self.jobs)
|
|
|
+
|
|
|
init_func = self.production_init if exists('webui/index.html') else self.development_init
|
|
|
kwargs, static_files = init_func()
|
|
|
|
|
@@ -284,11 +289,13 @@ class WebServer:
|
|
|
)
|
|
|
self.app.add_url_rule(
|
|
|
'/projects/<int:identifier>/label_provider',
|
|
|
- view_func=ExecuteLabelProvider.as_view('execute_label_provider', self.db, self.notifications, self.jobs)
|
|
|
+ view_func=ExecuteLabelProvider.as_view('execute_label_provider', self.db,
|
|
|
+ self.notifications, self.jobs)
|
|
|
)
|
|
|
self.app.add_url_rule(
|
|
|
'/projects/<int:identifier>/external_storage',
|
|
|
- view_func=ExecuteExternalStorage.as_view('execute_external_storage', self.db, self.notifications, self.jobs)
|
|
|
+ view_func=ExecuteExternalStorage.as_view('execute_external_storage', self.db,
|
|
|
+ self.notifications, self.jobs)
|
|
|
)
|
|
|
self.app.add_url_rule(
|
|
|
'/projects/<int:identifier>/remove',
|
|
@@ -300,21 +307,24 @@ class WebServer:
|
|
|
)
|
|
|
self.app.add_url_rule(
|
|
|
'/projects/<int:identifier>/description',
|
|
|
- view_func=EditProjectDescription.as_view('edit_project_description', self.db, self.notifications)
|
|
|
+ view_func=EditProjectDescription.as_view('edit_project_description', self.db,
|
|
|
+ self.notifications)
|
|
|
)
|
|
|
|
|
|
# pipelines
|
|
|
self.app.add_url_rule(
|
|
|
'/projects/<int:project_id>/pipelines/fit',
|
|
|
- view_func=FitModel.as_view('fit_model', self.db, self.jobs)
|
|
|
+ view_func=FitModel.as_view('fit_model', self.db, self.jobs, self.pipelines)
|
|
|
)
|
|
|
self.app.add_url_rule(
|
|
|
'/projects/<int:project_id>/pipelines/predict',
|
|
|
- view_func=PredictModel.as_view('predict_model', self.db, self.notifications, self.jobs)
|
|
|
+ view_func=PredictModel.as_view('predict_model', self.db, self.notifications,
|
|
|
+ self.jobs, self.pipelines)
|
|
|
)
|
|
|
self.app.add_url_rule(
|
|
|
'/data/<int:file_id>/predict',
|
|
|
- view_func=PredictFile.as_view('predict_file', self.db, self.notifications, self.jobs)
|
|
|
+ view_func=PredictFile.as_view('predict_file', self.db, self.notifications,
|
|
|
+ self.jobs, self.pipelines)
|
|
|
)
|
|
|
|
|
|
def run(self):
|