Add initial job models & endpoints #190
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Data source status placeholder endpoint
To test the storage settings of a deployment, send a POST request to
/api/v2/status/storage/with thedata_sourcepath configured for a Deployment (e.g. "s3://ami-trapdata/vermont/luna"). The endpoint will return "CONNECTED" or "ERROR". The frontend should show "CONNECTING" while waiting for a response. The endpoint will also return 10 random image paths from the data source that can be used in the example_captures slideshow in the Deployment details modal.https://api.dev.insectai.org/api/v2/status/storage/

New jobs modal and placeholder endpoints
The batch ID job names & statuses can be fetched with
/api/v2/jobs/to create the jobs tableThe job detail endpoint is a little more involved and could be ignore for now. It needs to be rather flexible since there will be multiple types of jobs with different stages. There are two main properties with nested attributes:
configandprogress. config is used to populate the Summary and Stages section of the job details modal. Here are several screenshots of the UI with notes about which properties each bit of data comes from. Below is the JSON for an example job. There is akeyproperty for each stage and parameter that can be used.{ "id": 2, "details": "http://localhost:8000/api/v2/jobs/2/", "name": "Quebec images", "project": "http://localhost:8000/api/v2/projects/1/", "deployment": "http://localhost:8000/api/v2/deployments/1/", "status": "PENDING", "started_at": null, "finished_at": null, "config": { "input": { "name": "Captures", "size": 100 }, "stages": [ { "name": "Object Detection", "key": "object_detection", "params": [ { "key": "model", "name": "Localization Model", "value": "yolov5s" }, { "key": "batch_size", "name": "Batch Size", "value": 8 }, { "key": "input_size", "name": "Images processed", "read_only": true }, { "key": "output_size", "name": "Objects detected", "read_only": true } ] }, { "name": "Objects of Interest Filter", "key": "binary_classification", "params": [ { "key": "algorithm", "name": "Binary classification model", "value": "resnet18" }, { "key": "batch_size", "name": "Batch Size", "value": 8 }, { "key": "input_size", "name": "Objects processed", "read_only": true }, { "key": "output_size", "name": "Objects of interest", "read_only": true } ] }, { "name": "Species Classification", "key": "species_classification", "params": [ { "key": "algorithm", "name": "Species classification model", "value": "resnet18" }, { "key": "batch_size", "name": "Batch Size", "value": 8 }, { "key": "input_size", "name": "Species processed", "read_only": true }, { "key": "output_size", "name": "Species classified", "read_only": true } ] }, { "name": "Occurrence Tracking", "key": "tracking", "params": [ { "key": "algorithm", "name": "Occurrence tracking algorithm", "value": "adityacombo" }, { "key": "input_size", "name": "Detections processed", "read_only": true }, { "key": "output_size", "name": "Occurrences identified", "read_only": true } ] } ] }, "progress": { "stages": [ { "key": "object_detection", "status": "WAITING", "progress": 0, "time_elapsed": 0, "time_remaining": null, "input_size": 0, "output_size": 0 }, { "key": "binary_classification", "status": "WAITING", "progress": 0, "time_elapsed": 0, "time_remaining": null, "input_size": 0, "output_size": 0 }, { "key": "species_classification", "status": "WAITING", "progress": 0, "time_elapsed": 0, "time_remaining": null, "input_size": 0, "output_size": 0 }, { "key": "tracking", "status": "WAITING", "progress": 0, "time_elapsed": 0, "time_remaining": null, "input_size": 0, "output_size": 0 } ] }, "result": {} }