Skip to content

Commit

Permalink
add and activate point robinson hydrophone
Browse files Browse the repository at this point in the history
  • Loading branch information
salsal97 committed Sep 14, 2023
1 parent 3f782c1 commit 713c54d
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 2 deletions.
16 changes: 15 additions & 1 deletion InferenceSystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ This can be completed in two ways.
INFERENCESYSTEM_APPINSIGHTS_CONNECTION_STRING=<string>
```

## Adding a new hydrophone

1. Create a new config file under the [config](config) folder

2. Update the last line of the [Dockerfile](Dockerfile) to point to the new config file

3. Create a new deployment YAML under the [deploy](deploy) folder

4. Update [src/LiveInferenceOrchestrator.py](src/LiveInferenceOrchestrator.py) and [src/globals.py](src/globals.py) to add variables for the new hydrophone location

5. Follow all other steps below until you update the kubernetes cluster with the new namespace

## Building the docker container for production

From the `InferenceSystem` directory, run the following command.
Expand All @@ -164,7 +176,8 @@ 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 3 different docker containers for the 3 hydrophone locations. Each time you will need to edit the Dockerfile and replace the config for each hydrophone location (OrcasoundLab, BushPoint, PortTownsend).
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).


## Running the docker container

Expand Down Expand Up @@ -300,6 +313,7 @@ kubectl logs -n bush-point inference-system-6d4845c5bc-tfsbw
<details>
<summary>Deployment to Azure Container Instances (deprecated)</summary>
# Deploying an updated docker build to Azure Container Instances
# This method has been deprecated

## Prerequisites

Expand Down
10 changes: 10 additions & 0 deletions InferenceSystem/config/Production/FastAI_LiveHLS_PointRobinson.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_point_robinson"
upload_to_azure: True
delete_local_wavs: True
15 changes: 15 additions & 0 deletions InferenceSystem/deploy-aci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ properties:
requests:
cpu: 1.0
memoryInGB: 3
- name: point-robinson-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:11-15-20.FastAI.R1-12.PointRobinson.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/point-robinson.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: point-robinson
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:11-15-20.FastAI.R1-12.PointRobinson.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
3 changes: 2 additions & 1 deletion InferenceSystem/src/LiveInferenceOrchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
PORT_TOWNSEND_LOCATION = {"id": "rpi_port_townsend", "name": "Port Townsend", "longitude": -122.76045, "latitude": 48.13569}
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}

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 }
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 }

def assemble_blob_uri(container_name, item_name):

Expand Down
1 change: 1 addition & 0 deletions InferenceSystem/src/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"port_townsend": "https://s3-us-west-2.amazonaws.com/streaming-orcasound-net/rpi_port_townsend",
"bush_point": "https://s3-us-west-2.amazonaws.com/streaming-orcasound-net/rpi_bush_point",
"sunset_bay": "https://s3-us-west-2.amazonaws.com/streaming-orcasound-net/rpi_sunset_bay",
"point_robinson": "https://s3-us-west-2.amazonaws.com/streaming-orcasound-net/rpi_point_robinson",
}

# Limits time window (end - start) of negative samples to be downloaded for retraining
Expand Down

0 comments on commit 713c54d

Please sign in to comment.