Skip to content

Conversation

@mihow
Copy link
Collaborator

@mihow mihow commented Nov 6, 2023

Summary

  • Adds views and serializers required to list, create, start and cancel jobs.
  • Adds fields for our most typical jobs directly to the Job model
    • source_image_collection
    • source_image_single (for Process button on capture detail page)
    • pipeline (for a pre-configured series of machine learning models)
    • delay (a value in seconds, mostly for testing fake jobs)
  • Adds new jobs[] list to SourceImage (Capture) detail and SourceImageCollection list responses for displaying inline status
  • Test for updating job progress as it advances
  • Introduce pydantic models for enforcing the schema of JSON fields, in this case the progress object on jobs.

Endpoints

  • GET /jobs/?project={id} (list jobs for a project)
  • POST /jobs/ (create)
  • POST /jobs/?start_now (create and queue immediately)
  • POST /jobs/{id}/run/ (add job to queue)
  • POST /jobs/{id}/cancel/ (terminate job)

See https://api.dev.insectai.org/api/v2/jobs/ for documentation and testing

TODO

  • Add job links to Collection table? Add job link to Capture detail "Process" status

@netlify
Copy link

netlify bot commented Nov 6, 2023

Deploy Preview for ami-web canceled.

Name Link
🔨 Latest commit f86611a
🔍 Latest deploy log https://app.netlify.com/sites/ami-web/deploys/65486a27a34211000892f990

@mihow mihow mentioned this pull request Nov 6, 2023
@netlify
Copy link

netlify bot commented Nov 6, 2023

Deploy Preview for ami-storybook canceled.

Name Link
🔨 Latest commit f86611a
🔍 Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/65486a278c7ec300087d2f9c

@mihow mihow changed the title API Backend for Jobs API Backend for Background Jobs Nov 6, 2023
@mihow mihow merged commit f6f044c into main Nov 6, 2023
@mihow mihow deleted the feat/jobs-backend-pre-rebase branch November 17, 2023 21:33
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.

2 participants