sequenceDiagram
title: High Level Sequence Diagram 1.0.0
actor Client
participant frontend
participant backend
participant EndpointAPI
participant AzureStorageAPI
Client->>+frontend: getDirectoriesList()
frontend->>+backend: HTTP POST req.
backend->>+AzureStorageAPI: get_blobs()
AzureStorageAPI-->>-backend: blobListObject
backend-->>frontend: directories list res.
frontend-->>Client: display directories
Client->>frontend: handleInference()
frontend->>backend: HTTP POST req.
backend->>+AzureStorageAPI: upload_image(image)
AzureStorageAPI-->>-backend: imageBlobObject
backend->>+EndpointAPI: get_inference_result(image)
EndpointAPI-->>-backend: inference res.
backend->>backend: process inf. result
backend-->>frontend: inference res.
frontend-->>-Client: display inference res.
backend->>+AzureStorageAPI: (async) upload_inference_result(json)
app.py
in the root foldermodel_inference/inference.py
When developping you first need to install the packages required.
This command must be run the first time you want to run the backend on your computer, but also every time you update the requirements.txt file and every time the datastore repo is updated
pip install -r requirements.txt
Then, you can run the backend while in the devcontainer by using this command:
hypercorn -b :8080 app:app
If you want to run the program as a Docker container (e.g., for production), use:
docker build -t nachet-backend .
docker run -p 8080:8080 -e PORT=8080 -v $(pwd):/app nachet-backend
If you want to run the frontend and backend together in Docker, use:
docker-compose up --build
You can then visit the web client at http://localhost:80
. The backend will be
build from the Dockerfile enabling preview of local changes and the frontend
will be pulled from our Github registry.
To test the program, use this command:
python -m unittest discover -s tests
Start by making a copy of .env.template
and renaming it .env
. For the
backend to function, you will need to add the missing values:
client_max_body_size
value
set from the deployment in Howard.If you need help deploying Nachet for your own needs, please contact us at cfia.ai-ia.acia@inspection.gc.ca.