-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ Add startup logs to RUT #6921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
matusdrobuliak66
merged 5 commits into
ITISFoundation:master
from
matusdrobuliak66:fix-rut-listing
Dec 9, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a66fa89
fix
matusdrobuliak66 dc79a85
Merge branch 'master' into fix-rut-listing
matusdrobuliak66 7b81d39
Merge branch 'master' into fix-rut-listing
matusdrobuliak66 ee0d8f9
review Dustin
matusdrobuliak66 b14a780
Merge branch 'master' into fix-rut-listing
matusdrobuliak66 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -17,12 +17,12 @@ AGENT_VOLUMES_CLEANUP_S3_ENDPOINT=http://172.17.0.1:9001 | |
| AGENT_VOLUMES_CLEANUP_S3_PROVIDER=MINIO | ||
| AGENT_VOLUMES_CLEANUP_S3_REGION=us-east-1 | ||
| AGENT_VOLUMES_CLEANUP_S3_SECRET_KEY=12345678 | ||
| AGENT_TRACING={} | ||
| AGENT_TRACING=null | ||
|
|
||
| API_SERVER_DEV_FEATURES_ENABLED=0 | ||
| API_SERVER_LOGLEVEL=INFO | ||
| API_SERVER_PROFILING=1 | ||
| API_SERVER_TRACING={} | ||
| API_SERVER_TRACING=null | ||
| TRAEFIK_API_SERVER_INFLIGHTREQ_AMOUNT=25 | ||
|
|
||
| AUTOSCALING_DASK=null | ||
|
|
@@ -35,7 +35,7 @@ AUTOSCALING_LOGLEVEL=INFO | |
| AUTOSCALING_NODES_MONITORING=null | ||
| AUTOSCALING_POLL_INTERVAL="00:00:10" | ||
| AUTOSCALING_SSM_ACCESS=null | ||
| AUTOSCALING_TRACING={} | ||
| AUTOSCALING_TRACING=null | ||
|
|
||
| AWS_S3_CLI_S3=null | ||
|
|
||
|
|
@@ -47,7 +47,7 @@ CATALOG_PORT=8000 | |
| CATALOG_PROFILING=1 | ||
| CATALOG_SERVICES_DEFAULT_RESOURCES='{"CPU": {"limit": 0.1, "reservation": 0.1}, "RAM": {"limit": 2147483648, "reservation": 2147483648}}' | ||
| CATALOG_SERVICES_DEFAULT_SPECIFICATIONS='{}' | ||
| CATALOG_TRACING={} | ||
| CATALOG_TRACING=null | ||
|
|
||
| CLUSTERS_KEEPER_COMPUTATIONAL_BACKEND_DEFAULT_CLUSTER_AUTH='{"type":"tls","tls_ca_file":"/home/scu/.dask/dask-crt.pem","tls_client_cert":"/home/scu/.dask/dask-crt.pem","tls_client_key":"/home/scu/.dask/dask-key.pem"}' | ||
| CLUSTERS_KEEPER_COMPUTATIONAL_BACKEND_DOCKER_IMAGE_TAG=master-github-latest | ||
|
|
@@ -61,7 +61,7 @@ CLUSTERS_KEEPER_MAX_MISSED_HEARTBEATS_BEFORE_CLUSTER_TERMINATION=5 | |
| CLUSTERS_KEEPER_PRIMARY_EC2_INSTANCES=null | ||
| CLUSTERS_KEEPER_TASK_INTERVAL=00:00:30 | ||
| CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES=null | ||
| CLUSTERS_KEEPER_TRACING={} | ||
| CLUSTERS_KEEPER_TRACING=null | ||
|
|
||
| DASK_SCHEDULER_HOST=dask-scheduler | ||
| DASK_SCHEDULER_PORT=8786 | ||
|
|
@@ -81,7 +81,7 @@ DIRECTOR_PUBLISHED_HOST_NAME="127.0.0.1:9081" | |
| DIRECTOR_REGISTRY_CACHING_TTL=00:15:00 | ||
| DIRECTOR_REGISTRY_CACHING=True | ||
| DIRECTOR_SERVICES_CUSTOM_CONSTRAINTS=null | ||
| DIRECTOR_TRACING={} | ||
| DIRECTOR_TRACING=null | ||
|
|
||
| EFS_USER_ID=8006 | ||
| EFS_USER_NAME=efs | ||
|
|
@@ -90,11 +90,11 @@ EFS_GROUP_NAME=efs-group | |
| EFS_DNS_NAME=fs-xxx.efs.us-east-1.amazonaws.com | ||
| EFS_MOUNTED_PATH=/tmp/efs | ||
| EFS_PROJECT_SPECIFIC_DATA_DIRECTORY=project-specific-data | ||
| EFS_GUARDIAN_TRACING={} | ||
| EFS_GUARDIAN_TRACING=null | ||
| EFS_DEFAULT_USER_SERVICE_SIZE_BYTES=10000 | ||
|
|
||
| # DATCORE_ADAPTER | ||
| DATCORE_ADAPTER_TRACING={} | ||
| DATCORE_ADAPTER_TRACING=null | ||
|
|
||
| # DIRECTOR_V2 ---- | ||
| COMPUTATIONAL_BACKEND_DEFAULT_CLUSTER_AUTH='{"type":"tls","tls_ca_file":"/home/scu/.dask/dask-crt.pem","tls_client_cert":"/home/scu/.dask/dask-crt.pem","tls_client_key":"/home/scu/.dask/dask-key.pem"}' | ||
|
|
@@ -121,14 +121,14 @@ DYNAMIC_SIDECAR_LOG_LEVEL=DEBUG | |
| DYNAMIC_SIDECAR_PROMETHEUS_MONITORING_NETWORKS=[] | ||
| DYNAMIC_SIDECAR_PROMETHEUS_SERVICE_LABELS={} | ||
| DYNAMIC_SIDECAR_API_SAVE_RESTORE_STATE_TIMEOUT=01:00:00 | ||
| DIRECTOR_V2_TRACING={} | ||
| DIRECTOR_V2_TRACING=null | ||
|
|
||
| # DYNAMIC_SCHEDULER ---- | ||
| DYNAMIC_SCHEDULER_LOGLEVEL=DEBUG | ||
| DYNAMIC_SCHEDULER_PROFILING=1 | ||
| DYNAMIC_SCHEDULER_USE_INTERNAL_SCHEDULER=0 | ||
| DYNAMIC_SCHEDULER_STOP_SERVICE_TIMEOUT=01:00:00 | ||
| DYNAMIC_SCHEDULER_TRACING={} | ||
| DYNAMIC_SCHEDULER_TRACING=null | ||
| DYNAMIC_SCHEDULER_UI_STORAGE_SECRET=adminadmin | ||
|
|
||
| FUNCTION_SERVICES_AUTHORS='{"UN": {"name": "Unknown", "email": "[email protected]", "affiliation": "unknown"}}' | ||
|
|
@@ -143,7 +143,7 @@ INVITATIONS_PORT=8000 | |
| INVITATIONS_SECRET_KEY='REPLACE_ME_with_result__Fernet_generate_key=' | ||
| INVITATIONS_SWAGGER_API_DOC_ENABLED=1 | ||
| INVITATIONS_USERNAME=admin | ||
| INVITATIONS_TRACING={} | ||
| INVITATIONS_TRACING=null | ||
|
|
||
| LOG_FORMAT_LOCAL_DEV_ENABLED=1 | ||
| LOG_FILTER_MAPPING='{}' | ||
|
|
@@ -168,7 +168,7 @@ PAYMENTS_STRIPE_API_SECRET='REPLACE_ME_with_api_secret' | |
| PAYMENTS_STRIPE_URL=https://api.stripe.com | ||
| PAYMENTS_SWAGGER_API_DOC_ENABLED=1 | ||
| PAYMENTS_USERNAME=admin | ||
| PAYMENTS_TRACING={} | ||
| PAYMENTS_TRACING=null | ||
|
|
||
| POSTGRES_DB=simcoredb | ||
| POSTGRES_ENDPOINT=postgres:5432 | ||
|
|
@@ -209,7 +209,7 @@ RESOURCE_USAGE_TRACKER_MISSED_HEARTBEAT_CHECK_ENABLED=1 | |
| RESOURCE_USAGE_TRACKER_MISSED_HEARTBEAT_COUNTER_FAIL=6 | ||
| RESOURCE_USAGE_TRACKER_MISSED_HEARTBEAT_INTERVAL_SEC=300 | ||
| RESOURCE_USAGE_TRACKER_S3=null | ||
| RESOURCE_USAGE_TRACKER_TRACING={} | ||
| RESOURCE_USAGE_TRACKER_TRACING=null | ||
|
|
||
| # NOTE: 172.17.0.1 is the docker0 interface, which redirect from inside a container onto the host network interface. | ||
| R_CLONE_OPTION_BUFFER_SIZE=16M | ||
|
|
@@ -243,7 +243,7 @@ STORAGE_HOST=storage | |
| STORAGE_LOGLEVEL=INFO | ||
| STORAGE_PORT=8080 | ||
| STORAGE_PROFILING=1 | ||
| STORAGE_TRACING={} | ||
| STORAGE_TRACING=null | ||
| # STORAGE ---- | ||
|
|
||
| SWARM_STACK_NAME=master-simcore | ||
|
|
@@ -389,6 +389,6 @@ WEBSERVER_SOCKETIO=1 | |
| WEBSERVER_STATICWEB={} | ||
| WEBSERVER_STUDIES_DISPATCHER={} | ||
| WEBSERVER_TAGS=1 | ||
| WEBSERVER_TRACING={} | ||
| WEBSERVER_TRACING=null | ||
| WEBSERVER_USERS={} | ||
| WEBSERVER_VERSION_CONTROL=1 | ||
20 changes: 15 additions & 5 deletions
20
...ices/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rest/routes.py
This file contains hidden or 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 |
|---|---|---|
| @@ -1,16 +1,26 @@ | ||
| import logging | ||
|
|
||
| from fastapi import APIRouter, FastAPI | ||
| from servicelib.logging_utils import log_context | ||
|
|
||
| from ..._meta import API_VTAG | ||
| from . import _health, _meta, _resource_tracker | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def setup_api_routes(app: FastAPI): | ||
| """ | ||
| Composes resources/sub-resources routers | ||
| """ | ||
| app.include_router(_health.router) | ||
| with log_context( | ||
| _logger, | ||
| logging.INFO, | ||
| msg="RUT setup_api_routes", | ||
| ): | ||
| app.include_router(_health.router) | ||
|
|
||
| api_router = APIRouter(prefix=f"/{API_VTAG}") | ||
| api_router.include_router(_meta.router, tags=["meta"]) | ||
| api_router.include_router(_resource_tracker.router) | ||
| app.include_router(api_router) | ||
| api_router = APIRouter(prefix=f"/{API_VTAG}") | ||
| api_router.include_router(_meta.router, tags=["meta"]) | ||
| api_router.include_router(_resource_tracker.router) | ||
| app.include_router(api_router) |
21 changes: 16 additions & 5 deletions
21
services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rpc/routes.py
This file contains hidden or 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 |
|---|---|---|
| @@ -1,23 +1,34 @@ | ||
| import logging | ||
|
|
||
| from fastapi import FastAPI | ||
| from models_library.api_schemas_resource_usage_tracker import ( | ||
| RESOURCE_USAGE_TRACKER_RPC_NAMESPACE, | ||
| ) | ||
| from servicelib.logging_utils import log_context | ||
| from servicelib.rabbitmq import RPCRouter | ||
|
|
||
| from ...services.modules.rabbitmq import get_rabbitmq_rpc_server | ||
| from . import _resource_tracker | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| ROUTERS: list[RPCRouter] = [ | ||
| _resource_tracker.router, | ||
| ] | ||
|
|
||
|
|
||
| def setup_rpc_api_routes(app: FastAPI) -> None: | ||
| async def startup() -> None: | ||
| rpc_server = get_rabbitmq_rpc_server(app) | ||
| for router in ROUTERS: | ||
| await rpc_server.register_router( | ||
| router, RESOURCE_USAGE_TRACKER_RPC_NAMESPACE, app | ||
| ) | ||
| with log_context( | ||
| _logger, | ||
| logging.INFO, | ||
| msg="RUT startup RPC API Routes", | ||
| ): | ||
| rpc_server = get_rabbitmq_rpc_server(app) | ||
| for router in ROUTERS: | ||
| await rpc_server.register_router( | ||
| router, RESOURCE_USAGE_TRACKER_RPC_NAMESPACE, app | ||
| ) | ||
|
|
||
| app.add_event_handler("startup", startup) |
19 changes: 17 additions & 2 deletions
19
...-usage-tracker/src/simcore_service_resource_usage_tracker/services/modules/db/__init__.py
This file contains hidden or 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 |
|---|---|---|
| @@ -1,13 +1,28 @@ | ||
| import logging | ||
|
|
||
| from fastapi import FastAPI | ||
| from servicelib.fastapi.db_asyncpg_engine import close_db_connection, connect_to_db | ||
| from servicelib.logging_utils import log_context | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def setup(app: FastAPI): | ||
| async def on_startup() -> None: | ||
| await connect_to_db(app, app.state.settings.RESOURCE_USAGE_TRACKER_POSTGRES) | ||
| with log_context( | ||
| _logger, | ||
| logging.INFO, | ||
| msg="RUT startup DB", | ||
| ): | ||
| await connect_to_db(app, app.state.settings.RESOURCE_USAGE_TRACKER_POSTGRES) | ||
|
|
||
| async def on_shutdown() -> None: | ||
| await close_db_connection(app) | ||
| with log_context( | ||
| _logger, | ||
| logging.INFO, | ||
| msg="RUT shutdown DB", | ||
| ): | ||
| await close_db_connection(app) | ||
|
|
||
| app.add_event_handler("startup", on_startup) | ||
| app.add_event_handler("shutdown", on_shutdown) |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.