-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable users to register Processing Services & Pipelines (#632)
* Create backend model * Create backend status endpoint * Return server status and available pipelines * Use pipeline slug * Fix .gitignore * Update backend status endpoint, test pipeline process images * fix: missing import in ml models * Add Backend to admin, update pipeline/backend model, register_pipelines action * Fix type checking * Add backend id to test pipeline processing * Constant and Random pipeline processing * Add test fixture * Don't use same project id for all tests * Added Backend created_at and updated_at serializer fields * Update models and display backends last checked * Resolve merge conflicts * Remove unused variables * Remove unused file * Register pipelines via frontend * Add missing fields to backend, fix migration error after merging with main * Add backend details dialog * Display backend details * Fix backend details displayed values * Select first backend associated with pipeline * Fix linting errors * Remove backend_id * Remove version/version name, fix adding project, make endpoint required * Use ErrorState component * Add serializer details * API test to check that pipelines are created * Add edit backend default values * Process images using backend with lowest latency * Remove projects from ML schemas * Resolve todos * Raise exception if no backends online * Fail the job if no backends are online * Change MLBackend to ProcessingService * Change all instances of backend to processing service * Fix ui formatting, fix tests, and add migrations * Update comment to processing service * Update process_images error handling * Fix last_checked_live and processing services online * Change Sync to Add Pipelines * Remove updated at column for processing services * Display column of num pipelines added * Change status label of pipelines online to pipelines avaialble * Use slugify to add processing service * fix: clean up some logging, type warnings and extra code * feat: remove slug field, update naming * fix: update phrasing * Remove print statements * Fix log formatting * Squash migrations * Filter processing services by project ID * Button indicates pipeline registration error * Fix processing service error handling --------- Co-authored-by: Michael Bunsen <[email protected]>
- Loading branch information
1 parent
650a305
commit e5b1aed
Showing
51 changed files
with
1,836 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.2.10 on 2024-11-03 23:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("jobs", "0010_job_limit_job_shuffle"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="job", | ||
name="limit", | ||
field=models.IntegerField( | ||
blank=True, | ||
default=None, | ||
help_text="Limit the number of images to process", | ||
null=True, | ||
verbose_name="Limit", | ||
), | ||
), | ||
] |
12 changes: 12 additions & 0 deletions
12
ami/jobs/migrations/0013_merge_0011_alter_job_limit_0012_alter_job_limit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Generated by Django 4.2.10 on 2024-12-17 22:28 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("jobs", "0011_alter_job_limit"), | ||
("jobs", "0012_alter_job_limit"), | ||
] | ||
|
||
operations = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Generated by Django 4.2.10 on 2025-01-17 19:40 | ||
|
||
import ami.base.schemas | ||
from django.db import migrations, models | ||
import django_pydantic_field.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
replaces = [ | ||
("ml", "0007_backend"), | ||
("ml", "0008_remove_pipeline_endpoint_url_pipeline_backend"), | ||
("ml", "0009_remove_pipeline_backend_backend_pipelines"), | ||
("ml", "0010_backend_created_at_backend_updated_at"), | ||
("ml", "0011_alter_pipeline_stages"), | ||
("ml", "0012_backend_last_checked_backend_last_checked_live"), | ||
("ml", "0013_backend_description_backend_name_backend_slug_and_more"), | ||
("ml", "0014_remove_backend_version_remove_backend_version_name_and_more"), | ||
("ml", "0015_processingservice_delete_backend"), | ||
("ml", "0016_alter_processingservice_options"), | ||
("ml", "0017_remove_processingservice_slug_and_more"), | ||
] | ||
|
||
dependencies = [ | ||
("main", "0038_alter_detection_path_alter_sourceimage_event_and_more"), | ||
("ml", "0006_alter_pipeline_endpoint_url_alter_pipeline_projects"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="pipeline", | ||
name="endpoint_url", | ||
), | ||
migrations.AlterField( | ||
model_name="pipeline", | ||
name="stages", | ||
field=django_pydantic_field.fields.PydanticSchemaField( | ||
config=None, | ||
default=ami.base.schemas.default_stages, | ||
help_text="The stages of the pipeline. This is mainly for display. The backend implementation of the pipeline may process data in any way.", | ||
schema="list[PipelineStage]", | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="ProcessingService", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
("name", models.CharField(max_length=255)), | ||
("description", models.TextField(blank=True)), | ||
("endpoint_url", models.CharField(max_length=1024)), | ||
("last_checked", models.DateTimeField(null=True)), | ||
("last_checked_live", models.BooleanField(null=True)), | ||
( | ||
"pipelines", | ||
models.ManyToManyField(blank=True, related_name="processing_services", to="ml.pipeline"), | ||
), | ||
( | ||
"projects", | ||
models.ManyToManyField(blank=True, related_name="processing_services", to="main.project"), | ||
), | ||
("last_checked_latency", models.FloatField(null=True)), | ||
], | ||
options={ | ||
"verbose_name": "Processing Service", | ||
"verbose_name_plural": "Processing Services", | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from .algorithm import Algorithm | ||
from .pipeline import Pipeline | ||
from ami.ml.models.algorithm import Algorithm | ||
from ami.ml.models.pipeline import Pipeline | ||
from ami.ml.models.processing_service import ProcessingService | ||
|
||
__all__ = [ | ||
"Algorithm", | ||
"Pipeline", | ||
"ProcessingService", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.