Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ML Pipeline v2 #684

Merged
merged 152 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
caedaaa
Create backend model
vanessavmac Nov 6, 2024
49bea0b
Create backend status endpoint
vanessavmac Nov 7, 2024
a7116d5
Return server status and available pipelines
vanessavmac Nov 7, 2024
27d4792
Use pipeline slug
vanessavmac Nov 7, 2024
a8bb218
Fix .gitignore
vanessavmac Nov 7, 2024
a1dfcc0
Update backend status endpoint, test pipeline process images
vanessavmac Nov 11, 2024
a66ab33
fix: missing import in ml models
mihow Nov 20, 2024
c0ca4a3
Add Backend to admin, update pipeline/backend model, register_pipelin…
vanessavmac Nov 24, 2024
d5f43f5
Fix type checking
vanessavmac Nov 25, 2024
74825fe
Add backend id to test pipeline processing
vanessavmac Nov 25, 2024
fa6579a
Constant and Random pipeline processing
vanessavmac Nov 25, 2024
8ad8b57
Add test fixture
vanessavmac Nov 25, 2024
18f9b9e
Don't use same project id for all tests
vanessavmac Nov 26, 2024
d2a9acd
Added Backend created_at and updated_at serializer fields
vanessavmac Dec 16, 2024
6fe4267
Update models and display backends last checked
vanessavmac Dec 16, 2024
81c415d
Resolve merge conflicts
vanessavmac Dec 16, 2024
149f4cf
Merge branches 'feat/ml-pipeline-registry' and 'main' of https://gith…
vanessavmac Dec 16, 2024
a70a325
Remove unused variables
vanessavmac Dec 17, 2024
81d92fe
Remove unused file
vanessavmac Dec 17, 2024
20ca912
Register pipelines via frontend
vanessavmac Dec 17, 2024
6909f33
Add missing fields to backend, fix migration error after merging with…
vanessavmac Dec 18, 2024
53d08f0
Add backend details dialog
vanessavmac Dec 18, 2024
6fbdc3e
Display backend details
vanessavmac Dec 18, 2024
780c6df
Fix backend details displayed values
vanessavmac Dec 18, 2024
08eb418
Select first backend associated with pipeline
vanessavmac Dec 18, 2024
565e107
Fix linting errors
vanessavmac Dec 18, 2024
8f44493
Remove backend_id
vanessavmac Dec 18, 2024
b54e91f
Remove version/version name, fix adding project, make endpoint required
vanessavmac Dec 19, 2024
3a3cb74
Merge branch 'main' of https://github.com/RolnickLab/ami-platform int…
vanessavmac Dec 19, 2024
f09c04a
Use ErrorState component
vanessavmac Dec 19, 2024
bbc8b53
Add serializer details
vanessavmac Dec 19, 2024
661d6b1
API test to check that pipelines are created
vanessavmac Dec 19, 2024
7375e3a
Add edit backend default values
vanessavmac Dec 19, 2024
c759104
Process images using backend with lowest latency
vanessavmac Dec 19, 2024
5c2d90d
Remove projects from ML schemas
vanessavmac Dec 19, 2024
662fb1c
Resolve todos
vanessavmac Dec 19, 2024
6813219
Raise exception if no backends online
vanessavmac Dec 19, 2024
8f72fd3
Fail the job if no backends are online
vanessavmac Dec 19, 2024
ca5a920
feat: begin storing category maps with algorithms in the DB
mihow Nov 26, 2024
22851e6
feat: begin saving all logits and scores from all predictions
mihow Nov 26, 2024
c635f26
fix: complete rename of softmax_scores field (now any calibrated score)
mihow Nov 27, 2024
6e86709
feat: admin sections for Classifications and Category Maps
mihow Nov 28, 2024
a665c45
fix: save simple labels along with category map data
mihow Nov 28, 2024
0eec366
feat: use function to generate fake classifications
mihow Nov 28, 2024
5d047c6
feat: update schema in example ML backend. comments
mihow Nov 28, 2024
836880f
fix: formatting
mihow Nov 28, 2024
6c8b550
fix: remove bad admin filter
mihow Nov 28, 2024
85dec99
fix: update formatting (line-lengths)
mihow Dec 5, 2024
7da5159
fix: reset line-length to existing project value
mihow Dec 5, 2024
2b0f039
feat: API views for algorithm category maps
mihow Dec 5, 2024
8598d77
feat: define schema for Algorithm & AlgorithmCategoryMap in the ML ba…
mihow Dec 5, 2024
c94ecd1
feat: continue writing schema for algorithms
mihow Dec 5, 2024
885ca0d
feat: update image fetching utils based on latest AMI data companion
mihow Dec 5, 2024
0c6115e
feat: bring schemas related to the ML backend responses in sync
mihow Dec 5, 2024
4f813b4
fix: fix import
mihow Dec 5, 2024
4c18630
feat: update schema for algorithms
mihow Dec 5, 2024
9bc9072
feat: update tests for processing pipeline responses
mihow Dec 5, 2024
e1c2d8a
chore: update formatting (line-lengths)
mihow Dec 5, 2024
11225df
fix: use only the key field for keeping algorithms unique
mihow Dec 5, 2024
18ec522
feat: update logging when saving pipeline results
mihow Dec 7, 2024
a78f88d
feat: features from live ml backend schema
mihow Dec 7, 2024
10689c1
feat: improve matching existing algorithms & labels to incoming data
mihow Dec 7, 2024
ac0ec0b
chore: reduce number of test images
mihow Dec 12, 2024
92813e0
fix: attempt to fix reprocessing when there is a new algorithm
mihow Dec 12, 2024
ce96845
chore: refactor pipeline results into multiple functions
mihow Dec 17, 2024
cb9bb7e
feat: support to add logits & scores to existing classifications
mihow Dec 17, 2024
305b338
fix: logging and comments
mihow Dec 17, 2024
2648eb5
fix: improve job status updates and failure handling
mihow Dec 17, 2024
1f9c07d
fix: allow specifying job type on create, update tests
mihow Dec 18, 2024
981bfd8
feat: move job logs to their own field to not mess with progress updates
mihow Dec 18, 2024
32a7c68
feat: basic tests for category maps
mihow Dec 19, 2024
288e529
feat: improve bulk saving & logging for pipeline results
mihow Dec 19, 2024
1de3d93
feat: update occurrence determinations when saving results
mihow Dec 19, 2024
5c04c8f
feat: ensure determination is not considering intermediate classifica…
mihow Dec 19, 2024
a0a5c14
feat: allow agreeing with any prediction/identification
mihow Dec 19, 2024
bd019c7
fix: updates to detection occurrences
mihow Dec 19, 2024
eb03238
fix: update detections with occurrences
mihow Dec 19, 2024
b7a2e4d
fix: fallback to non-terminal classifications if need be (non-moth)
mihow Dec 19, 2024
6215038
fix: creating occurrences in bulk
mihow Dec 19, 2024
24f33f0
feat: kill long queries during development
mihow Dec 20, 2024
f037778
feat: add test for mapping taxa from category maps
mihow Dec 20, 2024
49f6771
feat: add more classification and detection details to API responses
mihow Dec 20, 2024
36f6134
feat: optionally return pipeline results
mihow Dec 20, 2024
12dbcc4
fix: associate category map with each classification in addition to algo
mihow Dec 20, 2024
35d6b7a
chore: more logging when saving results
mihow Dec 20, 2024
fb5af5c
feat: allow filtering captures by project
mihow Dec 20, 2024
0f83a19
fix: update formatting
mihow Dec 20, 2024
a79f177
feat: make the classification list view more lightweight
mihow Dec 20, 2024
eac3210
feat: use redis for primary cache locally
mihow Dec 20, 2024
e8eb341
feat: support for retying failed requests
mihow Dec 20, 2024
ecccb79
Merge branch 'main' of https://github.com/RolnickLab/ami-platform int…
vanessavmac Jan 11, 2025
e65d210
Change MLBackend to ProcessingService
vanessavmac Jan 12, 2025
325a7c7
Change all instances of backend to processing service
vanessavmac Jan 12, 2025
78c9dec
Fix ui formatting, fix tests, and add migrations
vanessavmac Jan 12, 2025
abe6ea7
Update comment to processing service
vanessavmac Jan 12, 2025
f130bee
Update process_images error handling
vanessavmac Jan 14, 2025
f9ec5b8
Fix last_checked_live and processing services online
vanessavmac Jan 15, 2025
56a2773
Change Sync to Add Pipelines
vanessavmac Jan 15, 2025
3da4ac5
Remove updated at column for processing services
vanessavmac Jan 15, 2025
e292afa
Display column of num pipelines added
vanessavmac Jan 15, 2025
dc2e4be
Change status label of pipelines online to pipelines avaialble
vanessavmac Jan 15, 2025
6a98913
Use slugify to add processing service
vanessavmac Jan 15, 2025
fcf2f30
Merge branch 'main' of github.com:RolnickLab/antenna into feat/more-p…
mihow Jan 16, 2025
7a313a8
Merge branch 'main' into feat/more-predictions-data
mihow Jan 17, 2025
c8183a3
Merge branch 'main' of github.com:RolnickLab/antenna into feat/ml-pip…
mihow Jan 17, 2025
f2a0484
fix: clean up some logging, type warnings and extra code
mihow Jan 17, 2025
dc0ac42
feat: remove slug field, update naming
mihow Jan 17, 2025
d1740b7
fix: update phrasing
mihow Jan 17, 2025
2522063
Merge branch 'main' into feat/more-predictions-data
mihow Jan 18, 2025
5a26508
Merge branch 'main' into feat/ml-pipeline-registry
vanessavmac Jan 18, 2025
7dc58ef
Remove print statements
vanessavmac Jan 18, 2025
4436299
Fix log formatting
vanessavmac Jan 18, 2025
4c092d1
Squash migrations
vanessavmac Jan 18, 2025
5cda9a0
task: rename directory and container name to relieve upcoming conflicts
mihow Jan 18, 2025
c85c34c
Merge branch 'feat/more-predictions-data' of github.com:RolnickLab/an…
mihow Jan 18, 2025
3285ff9
fix: missing check for no-project
mihow Jan 18, 2025
fff35d2
fix: field name
mihow Jan 18, 2025
114718e
Filter processing services by project ID
vanessavmac Jan 19, 2025
fb0539a
Button indicates pipeline registration error
vanessavmac Jan 19, 2025
f3b473d
Merge branch 'feat/ml-pipeline-registry' of github.com:RolnickLab/ant…
mihow Jan 19, 2025
165568e
fix: cleanup naming of Random vs Dummy pipelines
mihow Jan 20, 2025
0d0cf50
feat: new schema for service info response
mihow Jan 20, 2025
5c879f4
feat: new schema for the processing service info response
mihow Jan 20, 2025
b1722a3
feat: change the main "process" endpoint path
mihow Jan 20, 2025
bf7a0e5
fix: fixes to pipeline status / get_info response
mihow Jan 20, 2025
217f04a
fix: job should fail if sub-tasks fail (saving results)
mihow Jan 21, 2025
7a69487
fix: ensure pipeline slugs are unique
mihow Jan 21, 2025
c7836b1
feat: improve error handling for results saved in subtasks
mihow Jan 21, 2025
2dd06b4
feat: improve usage of pipeline configs and schema names
mihow Jan 21, 2025
a8b9ba4
fix: show blank date instead of undefined in the UI
mihow Jan 21, 2025
5ec302d
feat: slightly improve robustness of status check responses
mihow Jan 21, 2025
33c45c5
fix: slightly improve handling of unique pipeline identifiers
mihow Jan 21, 2025
2c3fee8
feat: save category maps for algorithms when registering pipelines
mihow Jan 21, 2025
10c14ad
fix: skip slow counting in occurrences_per_day chart
mihow Jan 21, 2025
bfe0310
chore: shorten column name
mihow Jan 21, 2025
3718088
fix: selection of existing pipelines & algorithms
mihow Jan 21, 2025
c4b6835
fix: undefined variable
mihow Jan 21, 2025
1418787
feat: increase batch size per request
mihow Jan 21, 2025
94510b1
chore: use old name for processing_service for now
mihow Jan 21, 2025
a5193e8
Merge branch 'main' of github.com:RolnickLab/antenna into feat/ml-pip…
mihow Jan 22, 2025
71e4e46
fix: update tests
mihow Jan 25, 2025
2a6ac07
fix: use old endpoint name for now
mihow Jan 25, 2025
bd24ee7
Merge branch 'main' of github.com:RolnickLab/antenna into feat/ml-pip…
mihow Jan 25, 2025
aca567f
fix: conflicting migrations
mihow Jan 25, 2025
75911d9
Fix processing service error handling
vanessavmac Jan 25, 2025
738979f
Merge branch 'feat/ml-pipeline-registry' of github.com:RolnickLab/ant…
mihow Jan 26, 2025
674ef91
feat: show algorithm key/slug in UI
mihow Jan 26, 2025
54d2df5
fix: don't rename existing algorithms if not necessary
mihow Jan 26, 2025
9e76b4d
feat: update existing matching algorithms
mihow Jan 26, 2025
a345436
fix: ensure scores and labels align
mihow Jan 26, 2025
a72aa0c
Merge branch 'main' of github.com:RolnickLab/antenna into feat/ml-pip…
mihow Jan 26, 2025
59b4867
fix: missing env var during build time
mihow Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions ami/jobs/migrations/0013_add_job_logs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 4.2.10 on 2024-12-17 20:01

import django_pydantic_field.fields
from django.db import migrations

import ami.jobs.models


def migrate_logs_forward(apps, schema_editor):
"""Move logs from Job.progress to Job.logs"""
Job = apps.get_model("jobs", "Job")
jobs_to_update = []
for job in Job.objects.filter(progress__isnull=False):
if job.progress.logs or job.progress.errors:
# Move logs from progress to the new logs field
job.logs.stdout = job.progress.logs
job.logs.stderr = job.progress.errors
jobs_to_update.append(job)
# Update all jobs in a single query
Job.objects.bulk_update(jobs_to_update, ["logs"])


def migrate_logs_backward(apps, schema_editor):
"""Move logs from Job.logs back to Job.progress"""
Job = apps.get_model("jobs", "Job")
jobs_to_update = []
for job in Job.objects.filter(logs__isnull=False):
# Move logs back to progress
job.progress.logs = job.logs.stdout
job.progress.errors = job.logs.stderr
jobs_to_update.append(job)
# Update all jobs in a single query
Job.objects.bulk_update(jobs_to_update, ["progress"])


class Migration(migrations.Migration):
dependencies = [
("jobs", "0012_alter_job_limit"),
]

operations = [
migrations.AddField(
model_name="job",
name="logs",
field=django_pydantic_field.fields.PydanticSchemaField(
config=None, default={"stderr": [], "stdout": []}, schema=ami.jobs.models.JobLogs
),
),
migrations.RunPython(
migrate_logs_forward,
migrate_logs_backward,
),
]
23 changes: 23 additions & 0 deletions ami/jobs/migrations/0014_alter_job_progress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.10 on 2024-12-17 20:13

import ami.jobs.models
from django.db import migrations
import django_pydantic_field.fields


class Migration(migrations.Migration):
dependencies = [
("jobs", "0013_add_job_logs"),
]

operations = [
migrations.AlterField(
model_name="job",
name="progress",
field=django_pydantic_field.fields.PydanticSchemaField(
config=None,
default={"errors": [], "logs": [], "stages": [], "summary": {"progress": 0.0, "status": "CREATED"}},
schema=ami.jobs.models.JobProgress,
),
),
]
12 changes: 12 additions & 0 deletions ami/jobs/migrations/0015_merge_20250117_2100.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Generated by Django 4.2.10 on 2025-01-17 21:00

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("jobs", "0013_merge_0011_alter_job_limit_0012_alter_job_limit"),
("jobs", "0014_alter_job_progress"),
]

operations = []
Loading
Loading