Skip to content

Commit 460565d

Browse files
authored
Merge pull request #1219 from NASA-IMPACT/1182-ml-classification-queue
1182 ml classification queue
2 parents bfa1aa3 + f6647ff commit 460565d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3522
-128
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For each PR made, an entry should be added to this changelog. It should contain
1212
- etc.
1313

1414
## Changelog
15+
1516
- 1209-bug-fix-document-type-creator-form
1617
- Description: The dropdown on the pattern creation form needs to be set as multi as the default option since this is why the doc type creator form is used for the majority of multi-URL pattern creations. This should be applied to doc types, division types, and titles as well.
1718
- Changes:

compose/local/django/start

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#compose/local/django/start
12
#!/bin/bash
23

34
set -o errexit

compose/production/django/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# compose/production/django/Dockerfile
12
# define an alias for the specfic python version used in this file.
23
FROM python:3.10.14-slim-bullseye AS python
34

compose/production/django/start

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# compose/production/django/start
12
#!/bin/bash
23

34
set -o errexit

compose/production/traefik/traefik.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# compose/production/traefik/traefik.yml
12
log:
23
level: INFO
34

config/celery.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# config/celery.py
2+
import os
3+
4+
from celery import Celery
5+
from celery.schedules import crontab
6+
7+
# Set the default Django settings module
8+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
9+
10+
app = Celery("cosmos")
11+
12+
# Configure Celery using Django settings
13+
app.config_from_object("django.conf:settings", namespace="CELERY")
14+
15+
# Load task modules from all registered Django app configs
16+
app.autodiscover_tasks()
17+
18+
app.conf.beat_schedule = {
19+
"process-inference-queue": {
20+
"task": "inference.tasks.process_inference_job_queue",
21+
# Only run between 6pm and 7am
22+
"schedule": crontab(minute="*/5", hour="18-23,0-6"),
23+
},
24+
}

config/settings/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"feedback",
8585
"sde_collections",
8686
"sde_indexing_helper.users",
87+
"inference",
8788
]
8889

8990
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
@@ -289,11 +290,9 @@
289290
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_serializer
290291
CELERY_RESULT_SERIALIZER = "json"
291292
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-time-limit
292-
# TODO: set to whatever value is adequate in your circumstances
293-
CELERY_TASK_TIME_LIMIT = 5 * 60
293+
CELERY_TASK_TIME_LIMIT = 30 * 60
294294
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-soft-time-limit
295-
# TODO: set to whatever value is adequate in your circumstances
296-
CELERY_TASK_SOFT_TIME_LIMIT = 60
295+
CELERY_TASK_SOFT_TIME_LIMIT = 25 * 60
297296
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#beat-scheduler
298297
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
299298
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#worker-send-task-events
@@ -350,3 +349,5 @@
350349
LRM_QA_PASSWORD = env("LRM_QA_PASSWORD")
351350
LRM_DEV_TOKEN = env("LRM_DEV_TOKEN")
352351
XLI_TOKEN = env("XLI_TOKEN")
352+
INFERENCE_API_URL = env("INFERENCE_API_URL", default="http://host.docker.internal:8000")
353+
TDAMM_CLASSIFICATION_THRESHOLD = env("TDAMM_CLASSIFICATION_THRESHOLD", default="0.5")

inference/__init__.py

Whitespace-only changes.

inference/admin.py

Whitespace-only changes.

inference/apps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.apps import AppConfig
2+
3+
4+
class InferenceConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "inference"
7+
verbose_name = "Inference"

0 commit comments

Comments
 (0)