Skip to content
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

Add Mast Center and North San Juan Hydrophones #197

Merged
merged 8 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion InferenceSystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions InferenceSystem/config/Production/FastAI_LiveHLS_MastCenter.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions InferenceSystem/config/Production/FastAI_LiveHLS_NorthSJC.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions InferenceSystem/deploy-aci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,36 @@ properties:
requests:
cpu: 1.0
memoryInGB: 3
- name: mast-center-live
properties:
environmentVariables:
- name: AZURE_COSMOSDB_PRIMARY_KEY
secureValue: '<cosmos_primary_key>'
- name: AZURE_STORAGE_CONNECTION_STRING
secureValue: '<storage_connection_string>'
- name: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING
secureValue: '<appinsights_connection_string>'
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: '<cosmos_primary_key>'
- name: AZURE_STORAGE_CONNECTION_STRING
secureValue: '<storage_connection_string>'
- name: INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING
secureValue: '<appinsights_connection_string>'
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
Expand Down
38 changes: 38 additions & 0 deletions InferenceSystem/deploy/mast-center.yaml
Original file line number Diff line number Diff line change
@@ -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
38 changes: 38 additions & 0 deletions InferenceSystem/deploy/north-sjc.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion InferenceSystem/src/LiveInferenceOrchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
2 changes: 2 additions & 0 deletions InferenceSystem/src/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down