From 7b294b5a4a8695cd96dd42da6cc2dc493142ea18 Mon Sep 17 00:00:00 2001 From: Dan Birman Date: Mon, 14 Oct 2024 13:57:47 -0700 Subject: [PATCH] chore: removing apprunner, adding debug statemetns for server --- apprunner.yaml | 22 ---------------------- src/aind_qc_portal/docdb/database.py | 5 +++-- 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 apprunner.yaml diff --git a/apprunner.yaml b/apprunner.yaml deleted file mode 100644 index f15519b..0000000 --- a/apprunner.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: 1.10 # Version of the AppRunner specification -runtime: python311 # Runtime to use - -build: - commands: - build: - - pip3 install . # Install dependencies, assumes your app has a setup.py or pyproject.toml - -run: - runtime-version: 3.11 # Specify Python version - pre-run: - - pip3 install . # Install dependencies before the app starts - command: panel serve src/aind_qc_portal/qc_portal_app.py src/aind_qc_portal/qc_asset_app.py src/aind_qc_portal/qc_app.py --port 8080 --allow-websocket-origin=* --keep-alive 10000 - network: - port: 8080 # Port that AppRunner will expose to the internet - env: # Define environment variables if needed - - name: API_GATEWAY_HOST - value: 'api.allenneuraldynamics-test.org' - - name: DATABASE - value: 'metadata_index' - - name: COLLECTION - value: 'data_assets' \ No newline at end of file diff --git a/src/aind_qc_portal/docdb/database.py b/src/aind_qc_portal/docdb/database.py index a4f51f5..7baac1b 100644 --- a/src/aind_qc_portal/docdb/database.py +++ b/src/aind_qc_portal/docdb/database.py @@ -9,8 +9,6 @@ DATABASE = os.getenv("DATABASE", "metadata_index") COLLECTION = os.getenv("COLLECTION", "data_assets") -print(API_GATEWAY_HOST, DATABASE, COLLECTION) - TIMEOUT_1M = 60 TIMEOUT_1H = 60 * 60 TIMEOUT_24H = 60 * 60 * 24 @@ -28,9 +26,12 @@ def qc_from_id(id: str): def qc_update_to_id(id: str, qc: QualityControl): + print('Uploading QC') + print(qc.model_dump()) response = client.upsert_one_docdb_record( record={"_id": id, "quality_control": qc.model_dump()} ) + print(response) if response.status_code != 200: print(response.json())