From 2b4b285a5f332d6fbe87571b8e11cb6e0ea3f951 Mon Sep 17 00:00:00 2001 From: tanviraja24 <128422635+tanviraja24@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:44:12 -0400 Subject: [PATCH] Add Mast Center and North San Juan Hydrophones (#197) * Add in references for Mast Center and North San Juan Center * Update files for Mast Center and North JSC * Updated bucket version and re-deployed all 5 hydrophones * Update Readme for InferenceSystem * Update Lat/Long for SJC and Readme * deployed San Juan and Mast Center * revert dockerfile --- InferenceSystem/README.md | 2 +- .../Production/FastAI_LiveHLS_MastCenter.yml | 10 +++++ .../Production/FastAI_LiveHLS_NorthSJC.yml | 10 +++++ InferenceSystem/deploy-aci.yaml | 30 +++++++++++++++ InferenceSystem/deploy/mast-center.yaml | 38 +++++++++++++++++++ InferenceSystem/deploy/north-sjc.yaml | 38 +++++++++++++++++++ .../src/LiveInferenceOrchestrator.py | 4 +- InferenceSystem/src/globals.py | 2 + 8 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 InferenceSystem/config/Production/FastAI_LiveHLS_MastCenter.yml create mode 100644 InferenceSystem/config/Production/FastAI_LiveHLS_NorthSJC.yml create mode 100644 InferenceSystem/deploy/mast-center.yaml create mode 100644 InferenceSystem/deploy/north-sjc.yaml diff --git a/InferenceSystem/README.md b/InferenceSystem/README.md index abf70dbe..2cbc5e3f 100644 --- a/InferenceSystem/README.md +++ b/InferenceSystem/README.md @@ -176,7 +176,7 @@ docker build . -t live-inference-system -f ./Dockerfile Note: the config used in the Dockerfile is a Production config. -TODO: fix. For now, you will have to manually create 5 different docker containers for the 5 hydrophone locations. Each time you will need to edit the Dockerfile and replace the config for each hydrophone location (OrcasoundLab, BushPoint, PortTownsend, Sunset Bay and Point Robinson). +TODO: fix. For now, you will have to manually create 5 different docker containers for the 7 hydrophone locations. Each time you will need to edit the Dockerfile and replace the config for each hydrophone location (OrcasoundLab, BushPoint, PortTownsend, Sunset Bay, Point Robinson, Mast Center, and North San Juan Center). ## Running the docker container diff --git a/InferenceSystem/config/Production/FastAI_LiveHLS_MastCenter.yml b/InferenceSystem/config/Production/FastAI_LiveHLS_MastCenter.yml new file mode 100644 index 00000000..a7e68fd7 --- /dev/null +++ b/InferenceSystem/config/Production/FastAI_LiveHLS_MastCenter.yml @@ -0,0 +1,10 @@ +model_type: "FastAI" +model_local_threshold: 0.5 +model_global_threshold: 3 +model_path: "./model" +model_name: "model.pkl" +hls_stream_type: "LiveHLS" +hls_polling_interval: 60 +hls_hydrophone_id: "rpi_mast_center" +upload_to_azure: True +delete_local_wavs: True diff --git a/InferenceSystem/config/Production/FastAI_LiveHLS_NorthSJC.yml b/InferenceSystem/config/Production/FastAI_LiveHLS_NorthSJC.yml new file mode 100644 index 00000000..567bd685 --- /dev/null +++ b/InferenceSystem/config/Production/FastAI_LiveHLS_NorthSJC.yml @@ -0,0 +1,10 @@ +model_type: "FastAI" +model_local_threshold: 0.5 +model_global_threshold: 3 +model_path: "./model" +model_name: "model.pkl" +hls_stream_type: "LiveHLS" +hls_polling_interval: 60 +hls_hydrophone_id: "rpi_north_sjc" +upload_to_azure: True +delete_local_wavs: True diff --git a/InferenceSystem/deploy-aci.yaml b/InferenceSystem/deploy-aci.yaml index e8ef294c..944ef0f3 100644 --- a/InferenceSystem/deploy-aci.yaml +++ b/InferenceSystem/deploy-aci.yaml @@ -80,6 +80,36 @@ properties: requests: cpu: 1.0 memoryInGB: 3 + - name: mast-center-live + properties: + environmentVariables: + - name: AZURE_COSMOSDB_PRIMARY_KEY + secureValue: '' + - name: AZURE_STORAGE_CONNECTION_STRING + secureValue: '' + - name: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING + secureValue: '' + image: orcaconservancycr.azurecr.io/live-inference-system:09-19-24.FastAI.R1-12.MastCenter.v0 + ports: [] + resources: + requests: + cpu: 1.0 + memoryInGB: 3 + - name: north-sjc-live + properties: + environmentVariables: + - name: AZURE_COSMOSDB_PRIMARY_KEY + secureValue: '' + - name: AZURE_STORAGE_CONNECTION_STRING + secureValue: '' + - name: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING + secureValue: '' + image: orcaconservancycr.azurecr.io/live-inference-system:09-19-24.FastAI.R1-12.NorthSJC.v0 + ports: [] + resources: + requests: + cpu: 1.0 + memoryInGB: 3 imageRegistryCredentials: - server: orcaconservancycr.azurecr.io username: orcaconservancycr diff --git a/InferenceSystem/deploy/mast-center.yaml b/InferenceSystem/deploy/mast-center.yaml new file mode 100644 index 00000000..a68e2afe --- /dev/null +++ b/InferenceSystem/deploy/mast-center.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: inference-system + namespace: mast-center +spec: + replicas: 1 + selector: + matchLabels: + app: inference-system + template: + metadata: + labels: + app: inference-system + spec: + containers: + - name: inference-system + image: orcaconservancycr.azurecr.io/live-inference-system:09-19-24.FastAI.R1-12.MastCenter.v0 + resources: + limits: + cpu: 1 + memory: 3G + env: + - name: AZURE_COSMOSDB_PRIMARY_KEY + valueFrom: + secretKeyRef: + name: inference-system + key: AZURE_COSMOSDB_PRIMARY_KEY + - name: AZURE_STORAGE_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: inference-system + key: AZURE_STORAGE_CONNECTION_STRING + - name: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: inference-system + key: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING diff --git a/InferenceSystem/deploy/north-sjc.yaml b/InferenceSystem/deploy/north-sjc.yaml new file mode 100644 index 00000000..f539b766 --- /dev/null +++ b/InferenceSystem/deploy/north-sjc.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: inference-system + namespace: north-sjc +spec: + replicas: 1 + selector: + matchLabels: + app: inference-system + template: + metadata: + labels: + app: inference-system + spec: + containers: + - name: inference-system + image: orcaconservancycr.azurecr.io/live-inference-system:09-19-24.FastAI.R1-12.NorthSJC.v0 + resources: + limits: + cpu: 1 + memory: 3G + env: + - name: AZURE_COSMOSDB_PRIMARY_KEY + valueFrom: + secretKeyRef: + name: inference-system + key: AZURE_COSMOSDB_PRIMARY_KEY + - name: AZURE_STORAGE_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: inference-system + key: AZURE_STORAGE_CONNECTION_STRING + - name: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: inference-system + key: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING diff --git a/InferenceSystem/src/LiveInferenceOrchestrator.py b/InferenceSystem/src/LiveInferenceOrchestrator.py index 25bbc226..d29d4b6b 100644 --- a/InferenceSystem/src/LiveInferenceOrchestrator.py +++ b/InferenceSystem/src/LiveInferenceOrchestrator.py @@ -38,8 +38,10 @@ BUSH_POINT_LOCATION = {"id": "rpi_bush_point", "name": "Bush Point", "longitude": -122.6039, "latitude": 48.03371} SUNSET_BAY_LOCATION = {"id": "rpi_sunset_bay", "name": "Sunset Bay", "longitude": -122.3339, "latitude": 47.86497} POINT_ROBINSON_LOCATION = {"id": "rpi_point_robinson", "name": "Point Robinson", "longitude": -122.37267, "latitude": 47.38838} +MAST_CENTER_LOCATION = {"id": "rpi_mast_center", "name": "Mast Center", "longitude": -122.32512, "latitude": 47.34922} +NORTH_SJC_LOCATION = {"id": "rpi_north_sjc", "name": "North SJC", "longitude": -123.058779, "latitude": 48.591294} -source_guid_to_location = {"rpi_orcasound_lab" : ORCASOUND_LAB_LOCATION, "rpi_port_townsend" : PORT_TOWNSEND_LOCATION, "rpi_bush_point": BUSH_POINT_LOCATION, "rpi_sunset_bay": SUNSET_BAY_LOCATION, "rpi_point_robinson": POINT_ROBINSON_LOCATION } +source_guid_to_location = {"rpi_orcasound_lab" : ORCASOUND_LAB_LOCATION, "rpi_port_townsend" : PORT_TOWNSEND_LOCATION, "rpi_bush_point": BUSH_POINT_LOCATION, "rpi_sunset_bay": SUNSET_BAY_LOCATION, "rpi_point_robinson": POINT_ROBINSON_LOCATION, "rpi_mast_center": MAST_CENTER_LOCATION, "rpi_north_sjc": NORTH_SJC_LOCATION} def assemble_blob_uri(container_name, item_name): diff --git a/InferenceSystem/src/globals.py b/InferenceSystem/src/globals.py index 94118c0a..23eb14c7 100644 --- a/InferenceSystem/src/globals.py +++ b/InferenceSystem/src/globals.py @@ -6,6 +6,8 @@ "bush_point": "https://s3-us-west-2.amazonaws.com/audio-orcasound-net/rpi_bush_point", "sunset_bay": "https://s3-us-west-2.amazonaws.com/audio-orcasound-net/rpi_sunset_bay", "point_robinson": "https://s3-us-west-2.amazonaws.com/audio-orcasound-net/rpi_point_robinson", + "mast_center": "https://s3-us-west-2.amazonaws.com/audio-orcasound-net/rpi_mast_center", + "north_sjc": "https://s3-us-west-2.amazonaws.com/audio-orcasound-net/rpi_north_sjc" } # Limits time window (end - start) of negative samples to be downloaded for retraining