|
@@ -46,6 +46,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:
|
|
@@ -54,7 +55,7 @@ class WebServer:
|
|
|
"""
|
|
|
|
|
|
# pylint: disable=line-too-long
|
|
|
- def __init__(self, settings: dict, database: Database, jobs: JobRunner):
|
|
|
+ def __init__(self, settings: dict, database: Database, jobs: JobRunner, pipelines: PipelineCache):
|
|
|
# initialize web server
|
|
|
if exists('webui/index.html'):
|
|
|
print('production build')
|
|
@@ -247,11 +248,13 @@ class WebServer:
|
|
|
)
|
|
|
self.__flask.add_url_rule(
|
|
|
'/projects/<int:identifier>/label_provider',
|
|
|
- view_func=ExecuteLabelProvider.as_view('execute_label_provider', database, notifications, jobs)
|
|
|
+ view_func=ExecuteLabelProvider.as_view('execute_label_provider', database,
|
|
|
+ notifications, jobs)
|
|
|
)
|
|
|
self.__flask.add_url_rule(
|
|
|
'/projects/<int:identifier>/external_storage',
|
|
|
- view_func=ExecuteExternalStorage.as_view('execute_external_storage', database, notifications, jobs)
|
|
|
+ view_func=ExecuteExternalStorage.as_view('execute_external_storage', database,
|
|
|
+ notifications, jobs)
|
|
|
)
|
|
|
self.__flask.add_url_rule(
|
|
|
'/projects/<int:identifier>/remove',
|
|
@@ -263,21 +266,23 @@ class WebServer:
|
|
|
)
|
|
|
self.__flask.add_url_rule(
|
|
|
'/projects/<int:identifier>/description',
|
|
|
- view_func=EditProjectDescription.as_view('edit_project_description', database, notifications)
|
|
|
+ view_func=EditProjectDescription.as_view('edit_project_description', database,
|
|
|
+ notifications)
|
|
|
)
|
|
|
|
|
|
# pipelines
|
|
|
self.__flask.add_url_rule(
|
|
|
'/projects/<int:project_id>/pipelines/fit',
|
|
|
- view_func=FitModel.as_view('fit_model', database, jobs)
|
|
|
+ view_func=FitModel.as_view('fit_model', database, jobs, pipelines)
|
|
|
)
|
|
|
self.__flask.add_url_rule(
|
|
|
'/projects/<int:project_id>/pipelines/predict',
|
|
|
- view_func=PredictModel.as_view('predict_model', database, notifications, jobs)
|
|
|
+ view_func=PredictModel.as_view('predict_model', database, notifications, jobs,
|
|
|
+ pipelines)
|
|
|
)
|
|
|
self.__flask.add_url_rule(
|
|
|
'/data/<int:file_id>/predict',
|
|
|
- view_func=PredictFile.as_view('predict_file', database, notifications, jobs)
|
|
|
+ view_func=PredictFile.as_view('predict_file', database, notifications, jobs, pipelines)
|
|
|
)
|
|
|
|
|
|
# finally start web server
|