Skip to content
Open
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
8aad275
Set up customizable local processing service
vanessavmac Mar 23, 2025
61b45a4
Set up separate docker compose stack, rename ml backend services
vanessavmac Apr 3, 2025
4a03c7e
WIP: README.md
vanessavmac Apr 4, 2025
09d7dfb
Improve processing flow
vanessavmac Apr 5, 2025
996674e
fix: tests and postgres connection
vanessavmac Apr 5, 2025
ce973fc
Update READMEs with minimal/example setups
vanessavmac Apr 5, 2025
bf7178d
fix: transformers fixed version
vanessavmac Apr 5, 2025
41efa42
Add tests
vanessavmac Apr 5, 2025
78babeb
Typos, warn --> warnings
vanessavmac Apr 5, 2025
8d28d01
Add support for Darsa flat-bug
vanessavmac Apr 6, 2025
bb22514
chore: Change the Pipeline class name to FlatBugDetectorPipeline to a…
mohamedelabbas1996 Apr 7, 2025
1dbc5f0
Move README
vanessavmac Apr 8, 2025
fe1a9f4
Address comment tasks
vanessavmac Apr 13, 2025
7747f3a
Merge branch 'main' into 747-get-antenna-to-work-locally-on-laptops-f…
vanessavmac Apr 13, 2025
1978cbe
Update README
vanessavmac Apr 13, 2025
82ac82d
Pass in pipeline request config, properly cache models, simplifications
vanessavmac Apr 15, 2025
7d733f9
Pass in pipeline request config, properly cache models, simplifications
vanessavmac Apr 15, 2025
07d61d9
fix: update docker compose instructions & build path
mihow Apr 16, 2025
d129029
feat: use ["insect"] for the default zero-shot class
mihow Apr 16, 2025
76ce2d8
feat: try to use faster version of zero-shot detector
mihow Apr 16, 2025
035b952
feat: use gpu if available
mihow Apr 17, 2025
1230386
fix: update minimal docker compose build path
vanessavmac Apr 17, 2025
45dbacf
Add back crop_image_url
vanessavmac Apr 26, 2025
7361fb2
Support re-processing detections and skipping localizer
vanessavmac Apr 27, 2025
3f722c8
fix: correctly pass candidate labels for zero shot object detector
vanessavmac Apr 27, 2025
075a7ec
Support re-processing detections and skipping localizer
vanessavmac Apr 27, 2025
85c676d
fix: merge conflict
vanessavmac Apr 27, 2025
cbd7ae0
fix: allow empty pipeline request config
vanessavmac Apr 27, 2025
7d15ffb
fix: allow empty pipeline request config
vanessavmac Apr 27, 2025
c2881b4
clean up
vanessavmac Apr 27, 2025
14396ba
fix: ignore detection algorithm during reprocessing
vanessavmac Apr 29, 2025
6613366
remove flat bug
vanessavmac Apr 29, 2025
2cf0c0a
feat: only use zero shot and HF classifier algorithms
vanessavmac Apr 29, 2025
1dbf3b1
clean up
vanessavmac Apr 29, 2025
c82c076
Merge branch '747-get-antenna-to-work-locally-on-laptops-for-panama-t…
vanessavmac Apr 29, 2025
fb874c4
Function for creating detection instances from requests
vanessavmac May 17, 2025
f2ef5ff
Add reprocessing to minimal app
vanessavmac May 17, 2025
b6ce90f
Merge branch 'main' into 706-support-for-reprocessing-detections-and-…
vanessavmac May 17, 2025
8fe8b1d
Merge branch 'main' into 706-support-for-reprocessing-detections-and-…
vanessavmac Jun 28, 2025
d0f4f26
Add re-processing test
vanessavmac Jun 28, 2025
fc8470d
Merge branch 'main' into 706-support-for-reprocessing-detections-and-…
mihow Jul 7, 2025
3d3b820
Fix requirements
vanessavmac Jul 12, 2025
5c7af56
Address review comments
vanessavmac Jul 12, 2025
e7e579e
Only open source image once
vanessavmac Jul 12, 2025
cb74eac
Merge branch 'main' into 706-support-for-reprocessing-detections-and-…
vanessavmac Jul 12, 2025
ffea1aa
Setup processing service celery workers; basic task queueing/processing
vanessavmac Jul 28, 2025
6cb852b
Save results; update job progress
vanessavmac Aug 4, 2025
d0380b9
Improvements to handle large batches
vanessavmac Aug 11, 2025
2594049
Merge branch 'main' of github.com:RolnickLab/antenna into 515-new-asy…
mihow Aug 16, 2025
57e6691
Add batch processing unit test; bulk db updates; fix duplicate logs; …
vanessavmac Aug 30, 2025
f785dda
Fix for "get() returned more than one AlgorithmCategoryMap" error
vanessavmac Aug 30, 2025
0a22d53
Allow synchronous
vanessavmac Aug 31, 2025
d139734
Fix job progress if no images are submitted
vanessavmac Aug 31, 2025
a83dd20
Subscribe antenna celeryworker to all pipeline queues; add more task …
vanessavmac Sep 2, 2025
0707433
Rename celery to antenna queue; only query ml task records created af…
vanessavmac Sep 4, 2025
0103b7e
Merge branch 'main' into 515-new-async-distributed-ml-backend
vanessavmac Sep 4, 2025
3a3b881
Re-subscribe to queues before processing images; fix test issues
vanessavmac Sep 4, 2025
7c86612
Add missing migration; rename antenna celeryworker
vanessavmac Sep 4, 2025
c016d47
Use transaction.on_commit with all async celery tasks
vanessavmac Sep 5, 2025
fa510ed
Test clean up
vanessavmac Sep 5, 2025
6da55a9
feat: isolate the CI / test compose stack from other containers
mihow Sep 8, 2025
652f47f
feat: fix isoloated CI stack (rely on compose project name)
mihow Sep 8, 2025
f3b588a
fix: run migrations from celery start command, other fixes for tests
mihow Sep 9, 2025
5654ed0
fix: rabbitmq credentials for tests & local dev
mihow Sep 9, 2025
875d3cb
draft: methods for inspecting celery tasks during tests
mihow Sep 9, 2025
be351f8
feat: add health check; fix: rabbitmq credentials, minio ci set up
vanessavmac Sep 13, 2025
e550531
draft: unit test changes
vanessavmac Sep 15, 2025
2fa57ef
draft: some more unit test updates (working up to process_pipeline_re…
vanessavmac Sep 15, 2025
5c21be6
test fix: check the job status synchronously additional error logging
vanessavmac Sep 22, 2025
a1e8fa3
test fix: check the job status synchronously, batchify the save_resul…
vanessavmac Oct 17, 2025
57fba22
feat: celerybeat task to prevent dangling ML jobs
vanessavmac Oct 17, 2025
f8e374a
Merge branch 'main' into 515-new-async-distributed-ml-backend
vanessavmac Oct 17, 2025
cd593bc
fix: migration conflicts
vanessavmac Oct 17, 2025
bde423a
Address copilot review
vanessavmac Oct 17, 2025
a1238dc
fix: passing test checks
vanessavmac Oct 17, 2025
03390e2
revoke dangling jobs
vanessavmac Oct 18, 2025
460f27c
feat: move ML celeryworker to separate PR
vanessavmac Oct 18, 2025
6f87ca4
clean up unit test
vanessavmac Oct 18, 2025
bd86042
Admin action to revoke ml tasks; clean up logs; add tests for stale m…
vanessavmac Nov 4, 2025
b552d1e
fix: increase dangling job timeout and timezone bug
vanessavmac Nov 8, 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
4 changes: 4 additions & 0 deletions .envs/.ci/.django
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ MINIO_BROWSER_REDIRECT_URL=http://minio:9001

DEFAULT_PROCESSING_SERVICE_NAME=Test Processing Service
DEFAULT_PROCESSING_SERVICE_ENDPOINT=http://ml_backend:2000

CELERY_BROKER_URL=amqp://rabbituser:rabbitpass@rabbitmq:5672//
RABBITMQ_DEFAULT_USER=rabbituser
RABBITMQ_DEFAULT_PASS=rabbitpass
1 change: 1 addition & 0 deletions .envs/.ci/.postgres
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ POSTGRES_PORT=5432
POSTGRES_DB=ami-ci
POSTGRES_USER=4JXkOnTAeDmDyIapSRrGEE
POSTGRES_PASSWORD=d4xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI
DATABASE_URL=postgres://xekSryPnqczJXkOnTAeDmDyIapSRrGEE:iMRQjJEGflj5xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI@postgres:5432/ami
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: DATABASE_URL credentials and database name don't match the individual environment variables.

The DATABASE_URL contains different credentials and database name than the individual POSTGRES_* variables:

  • User mismatch: URL has xekSryPnqczJXkOnTAeDmDyIapSRrGEE but POSTGRES_USER (line 4) is 4JXkOnTAeDmDyIapSRrGEE
  • Password mismatch: URL password differs from POSTGRES_PASSWORD (line 5)
  • Database mismatch: URL has ami but POSTGRES_DB (line 3) is ami-ci

This will cause CI connection failures when code uses DATABASE_URL instead of individual variables.

Apply this diff to fix the mismatches and use the recommended postgresql:// scheme:

-DATABASE_URL=postgres://xekSryPnqczJXkOnTAeDmDyIapSRrGEE:iMRQjJEGflj5xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI@postgres:5432/ami
+DATABASE_URL=postgresql://4JXkOnTAeDmDyIapSRrGEE:d4xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI@postgres:5432/ami-ci
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DATABASE_URL=postgres://xekSryPnqczJXkOnTAeDmDyIapSRrGEE:iMRQjJEGflj5xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI@postgres:5432/ami
DATABASE_URL=postgresql://4JXkOnTAeDmDyIapSRrGEE:d4xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI@postgres:5432/ami-ci
🤖 Prompt for AI Agents
In .envs/.ci/.postgres around line 6, the DATABASE_URL contains mismatched user,
password, and database name compared to the POSTGRES_* variables and uses the
old scheme; update DATABASE_URL to use the postgresql:// scheme and exact values
from POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB (so the username,
password, host, port and database name match the individual variables), ensuring
the URL credentials and database name are identical to lines 3–5.

4 changes: 4 additions & 0 deletions .envs/.local/.django
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ MINIO_BROWSER_REDIRECT_URL=http://minio:9001
DEFAULT_PROCESSING_SERVICE_NAME=Local Processing Service
DEFAULT_PROCESSING_SERVICE_ENDPOINT=http://ml_backend:2000
# DEFAULT_PIPELINES_ENABLED=random,constant # When set to None, all pipelines will be enabled.

CELERY_BROKER_URL=amqp://rabbituser:rabbitpass@rabbitmq:5672//
RABBITMQ_DEFAULT_USER=rabbituser
RABBITMQ_DEFAULT_PASS=rabbitpass
1 change: 1 addition & 0 deletions .envs/.local/.postgres
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ POSTGRES_PORT=5432
POSTGRES_DB=ami
POSTGRES_USER=xekSryPnqczJXkOnTAeDmDyIapSRrGEE
POSTGRES_PASSWORD=iMRQjJEGflj5xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI
DATABASE_URL=postgres://xekSryPnqczJXkOnTAeDmDyIapSRrGEE:iMRQjJEGflj5xojpnJU3OzPQ0apSCLP1oHR1TYvyMzAlF5KpE9HFL6MPlnbDibwI@postgres:5432/ami
14 changes: 13 additions & 1 deletion ami/jobs/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ami.main.admin import AdminBase

from .models import Job, get_job_type_by_inferred_key
from .models import Job, MLTaskRecord, get_job_type_by_inferred_key


@admin.register(Job)
Expand Down Expand Up @@ -54,3 +54,15 @@ def inferred_job_type(self, obj: Job) -> str:
"progress",
"result",
)


@admin.register(MLTaskRecord)
class MLTaskRecordAdmin(AdminBase):
"""Admin panel example for ``MLTaskRecord`` model."""

list_display = (
"job",
"task_id",
"task_name",
"status",
)
72 changes: 72 additions & 0 deletions ami/jobs/migrations/0019_mltaskrecord.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Generated by Django 4.2.10 on 2025-08-10 22:17

import ami.ml.schemas
from django.db import migrations, models
import django.db.models.deletion
import django_pydantic_field.fields


class Migration(migrations.Migration):
dependencies = [
("main", "0060_alter_sourceimagecollection_method"),
("jobs", "0018_alter_job_job_type_key"),
]

operations = [
migrations.CreateModel(
name="MLTaskRecord",
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)),
("task_id", models.CharField(max_length=255)),
(
"task_name",
models.CharField(
choices=[
("process_pipeline_request", "process_pipeline_request"),
("save_results", "save_results"),
],
default="process_pipeline_request",
max_length=255,
),
),
(
"status",
models.CharField(
choices=[("STARTED", "STARTED"), ("SUCCESS", "SUCCESS"), ("FAIL", "FAIL")],
default="STARTED",
max_length=255,
),
),
("raw_results", models.JSONField(blank=True, default=dict, null=True)),
("raw_traceback", models.TextField(blank=True, null=True)),
(
"pipeline_request",
django_pydantic_field.fields.PydanticSchemaField(
blank=True, config=None, null=True, schema=ami.ml.schemas.PipelineRequest
),
),
(
"pipeline_response",
django_pydantic_field.fields.PydanticSchemaField(
blank=True, config=None, null=True, schema=ami.ml.schemas.PipelineResultsResponse
),
),
("num_captures", models.IntegerField(default=0, help_text="Same as number of source_images")),
("num_detections", models.IntegerField(default=0)),
("num_classifications", models.IntegerField(default=0)),
("subtask_id", models.CharField(blank=True, max_length=255, null=True)),
(
"job",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, related_name="ml_task_records", to="jobs.job"
),
),
("source_images", models.ManyToManyField(related_name="ml_task_records", to="main.sourceimage")),
],
options={
"abstract": False,
},
),
]
28 changes: 28 additions & 0 deletions ami/jobs/migrations/0020_alter_job_logs_alter_job_progress.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.10 on 2025-09-04 10:42

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


class Migration(migrations.Migration):
dependencies = [
("jobs", "0019_mltaskrecord"),
]

operations = [
migrations.AlterField(
model_name="job",
name="logs",
field=django_pydantic_field.fields.PydanticSchemaField(
config=None, default=ami.jobs.models.JobLogs, schema=ami.jobs.models.JobLogs
),
),
migrations.AlterField(
model_name="job",
name="progress",
field=django_pydantic_field.fields.PydanticSchemaField(
config=None, default=ami.jobs.models.default_job_progress, schema=ami.jobs.models.JobProgress
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 4.2.10 on 2025-10-16 19:31

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("jobs", "0020_alter_job_logs_alter_job_progress"),
]

operations = [
migrations.RemoveField(
model_name="mltaskrecord",
name="subtask_id",
),
migrations.AlterField(
model_name="mltaskrecord",
name="status",
field=models.CharField(
choices=[("PENDING", "PENDING"), ("STARTED", "STARTED"), ("SUCCESS", "SUCCESS"), ("FAIL", "FAIL")],
default="STARTED",
max_length=255,
),
),
migrations.AlterField(
model_name="mltaskrecord",
name="task_id",
field=models.CharField(blank=True, max_length=255, null=True),
),
]
17 changes: 17 additions & 0 deletions ami/jobs/migrations/0022_job_last_checked.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.10 on 2025-10-17 01:27

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("jobs", "0021_remove_mltaskrecord_subtask_id_and_more"),
]

operations = [
migrations.AddField(
model_name="job",
name="last_checked",
field=models.DateTimeField(blank=True, null=True),
),
]
Loading