-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
46 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
35 changes: 35 additions & 0 deletions
35
services/web/server/src/simcore_service_webserver/notifications/plugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
computation module is the main entry-point for computational backend | ||
""" | ||
import logging | ||
|
||
from aiohttp import web | ||
from servicelib.aiohttp.application_setup import ModuleCategory, app_module_setup | ||
|
||
from ..db import setup_db | ||
from ..rabbitmq import setup_rabbitmq | ||
from ._computation_comp_tasks_listening_task import create_comp_tasks_listening_task | ||
from ._rabbitmq_consumers import setup_rabbitmq_consumers | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
@app_module_setup( | ||
__name__, | ||
ModuleCategory.ADDON, | ||
settings_name="WEBSERVER_COMPUTATION", | ||
logger=log, | ||
depends=[ | ||
"simcore_service_webserver.diagnostics", | ||
], # depends on diagnostics for setting the instrumentation | ||
) | ||
def setup_computation(app: web.Application): | ||
setup_rabbitmq(app) | ||
# Subscribe to rabbit upon startup for logs, progress and other | ||
# metrics on the execution reported by sidecars | ||
app.cleanup_ctx.append(setup_rabbitmq_consumers) | ||
|
||
# Creates a task to listen to comp_task pg-db's table events | ||
setup_db(app) | ||
app.cleanup_ctx.append(create_comp_tasks_listening_task) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters