Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ssa/workspaces
1 result
Show changes
Commits on Source (5)
......@@ -27,5 +27,4 @@ export class WorkspacesComponent implements OnInit {
constructor() {}
ngOnInit(): void {}
}
......@@ -84,9 +84,7 @@ def add_cors_headers_response_callback(event: NewRequest):
# ---------------------------------------------------------
def add_services(
config: Configurator, session_factory: BeakerSessionFactoryConfig
) -> Configurator:
def add_services(config: Configurator, session_factory: BeakerSessionFactoryConfig) -> Configurator:
"""
Add capability info, capability service, and workflow service to Pyramid request configuration
......@@ -97,12 +95,8 @@ def add_services(
# # these objects should exist across request boundaries
workflow_rest_client = WorkflowServiceRESTClient()
notification_rest_client = TransactionalNotificationSender(transaction.manager)
capability_info = CapabilityInfo(
get_tm_session(session_factory, transaction.manager)
)
state_machine_info = StateMachineInfo(
get_tm_session(session_factory, transaction.manager)
)
capability_info = CapabilityInfo(get_tm_session(session_factory, transaction.manager))
state_machine_info = StateMachineInfo(get_tm_session(session_factory, transaction.manager))
capability_service = CapabilityService(
capability_info,
state_machine_info,
......@@ -137,19 +131,13 @@ def add_services(
)
# make capability launcher available for use in Pyramid
config.add_request_method(
create_capability_launcher, "capability_launcher", reify=True
)
config.add_request_method(create_capability_launcher, "capability_launcher", reify=True)
# make capability queue starter available for use in Pyramid
config.add_request_method(
create_queue_restarter, "capability_queue_restarter", reify=True
)
config.add_request_method(create_queue_restarter, "capability_queue_restarter", reify=True)
# make capability canceller available for use in Pyramid
config.add_request_method(
create_capability_canceller, "capability_canceller", reify=True
)
config.add_request_method(create_capability_canceller, "capability_canceller", reify=True)
# make workflow_info available for use in Pyramid
config.add_request_method(
......@@ -159,21 +147,15 @@ def add_services(
reify=True,
)
config.add_request_method(
lambda request: notification_rest_client, "notification_service", reify=True
)
config.add_request_method(lambda request: notification_rest_client, "notification_service", reify=True)
# make archive_service available for use in Pyramid
config.add_request_method(
lambda request: archive_service, "archive_service", reify=True
)
config.add_request_method(lambda request: archive_service, "archive_service", reify=True)
return config
def lookup_request(request):
return request.capability_info.lookup_capability_request(
request.matchdict["request_id"]
)
return request.capability_info.lookup_capability_request(request.matchdict["request_id"])
# ---------------------------------------------------------
......@@ -205,9 +187,7 @@ def get_tm_session(
# ---------------------------------------------------------
# Prometheus logging
http_requests = Summary(
"http_request_timing", "HTTP Requests", ["status_code", "route_name"]
)
http_requests = Summary("http_request_timing", "HTTP Requests", ["status_code", "route_name"])
def prometheus_route_timing_factory(handler, registry):
......@@ -217,9 +197,9 @@ def prometheus_route_timing_factory(handler, registry):
response = handler(request)
end = time.time()
if request.matched_route:
http_requests.labels(
status_code=response.status_code, route_name=request.matched_route.name
).observe(end - start)
http_requests.labels(status_code=response.status_code, route_name=request.matched_route.name).observe(
end - start
)
return response
return prometheus_route_timer
......
......@@ -49,7 +49,6 @@ def add_services(config: Configurator, session_factory: BeakerSessionFactoryConf
# make notification_info available for use in Pyramid
config.add_request_method(attach_session, "notification_info", reify=True)
config.add_request_method(lambda request: notification_service, "notification_service", reify=True)
return config
......
......@@ -137,7 +137,7 @@ class WorkflowInfo(WorkflowInfoIF):
def all_external_controllers(self) -> List[Controller]:
"""
Queries the processing_controllers table for all non-workspaces control systems and their attributes
Queries the processing_controllers table for all non-workspaces control systmes and their attributes
:return: List of external controller objects
"""
......
......@@ -820,7 +820,7 @@ class WorkflowMessageHandler:
# find the path to the delivery.json file
delivery_file = pathlib.Path(wf_request.results_dir) / "delivery.json"
logger.info(f"workflow type {wf_request.workflow_name} trying to send delivery message to {controller}")
# does it exist? if so, we need to send out a new event with its contents
if delivery_file.exists():
logger.debug("Found delivery.json file, sending delivery notification")
......@@ -836,7 +836,6 @@ class WorkflowMessageHandler:
# send the message
self.messenger.send_message(**msg)
elif controller.control_system == "AAT":
logger.info(f"Attempting to send delivery notification to AAT from propagate delivery")
# construct the AAT message
routing_key = f"ws-workflow.download.{wf_request.workflow_request_id}"
msg = ArchiveMessageArchitect(
......@@ -1076,9 +1075,7 @@ class WorkflowMessageHandler:
return False
def _post_workflow_cleanup(self, message: Dict, request: WorkflowRequest, event_type: str):
logger.info(f"Controller for workflow request {request.workflow_request_id} is {request.controller}")
if any(c.control_system == request.controller for c in self.info.all_external_controllers()):
logger.info(f"Attempting to send final message to {request.controller} for {request.workflow_request_id}")
self.send_external_event(event_type, **message)
self.clean_remote_workflow(request)
......@@ -1115,7 +1112,6 @@ class WorkflowMessageHandler:
return False
self.info.save_progress(request, stage, start, end)
logger.info(f"Updated current stage of {request.workflow_request_id}")
return {
"stage_info": {
"stage": stage,
......@@ -1150,9 +1146,6 @@ class WorkflowMessageHandler:
if controller.control_system == "AAT":
# download_complete will be sent from propagate_delivery method
if wf_request.workflow_name == "download" and event_type == "complete":
logger.info(
f"Tried to send download workflow complete event from send_external_event to {controller.control_system}"
)
return
if wf_request.workflow_name == "carta":
......