Skip to content

Conversation

@mihow
Copy link
Collaborator

@mihow mihow commented Jul 7, 2023

Data source status placeholder endpoint

To test the storage settings of a deployment, send a POST request to /api/v2/status/storage/ with the data_source path 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/
image

New jobs modal and placeholder endpoints

The batch ID job names & statuses can be fetched with /api/v2/jobs/ to create the jobs table

The 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: config and progress. 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 a key property for each stage and parameter that can be used.

image image image
{
    "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": {}
}

@netlify
Copy link

netlify bot commented Jul 7, 2023

Deploy Preview for ami-web canceled.

Name Link
🔨 Latest commit 904d809
🔍 Latest deploy log https://app.netlify.com/sites/ami-web/deploys/64a7bbdc8c2f900008e35c38

@netlify
Copy link

netlify bot commented Jul 7, 2023

Deploy Preview for ami-storybook canceled.

Name Link
🔨 Latest commit 904d809
🔍 Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/64a7bbdc9d3a690007db60fe

@mihow mihow marked this pull request as ready for review July 7, 2023 06:38
@mihow mihow merged commit 90a7b40 into main Jul 7, 2023
@annavik
Copy link
Member

annavik commented Jul 7, 2023

Thanks for the detailed explanation!!

@mihow mihow deleted the jobs-data branch August 14, 2023 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants