Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
43788bf
feat: make filter test endpoints public for babamul-web filter tester
KeshavMajithia Apr 30, 2026
15c211b
ci: add fork build workflow for NRP image
KeshavMajithia Apr 30, 2026
935bb43
ci: retry build (Apache CDN 503)
KeshavMajithia Apr 30, 2026
3dbc5aa
fix: use archive.apache.org for Kafka download (CDN 503)
KeshavMajithia Apr 30, 2026
aee7f15
fix: skip async topic deletion to prevent 0-partition race condition
KeshavMajithia May 1, 2026
604d70e
feat: add schema endpoint to public routes and invalidate docker cache
KeshavMajithia May 2, 2026
6164c8b
fix: remove hardcoded auth checks from public filter endpoints
KeshavMajithia May 2, 2026
946dccc
feat: add /filters/schemas/{ZTF,LSST} to public routes for filter bui…
KeshavMajithia May 5, 2026
7a3be6b
Add RTF and mTAN ONNX encoder middleware
KeshavMajithia Jun 1, 2026
4301846
Trigger GitHub action for this branch
KeshavMajithia Jun 1, 2026
c7b0454
feat: add RTF + mTAN feature preparation and embedding inference
KeshavMajithia Jun 3, 2026
d8d1695
ci: retrigger build
KeshavMajithia Jun 3, 2026
0e06df4
fix: use public re-export path for Candidate, suppress unused var war…
KeshavMajithia Jun 3, 2026
225a9a5
feat: add initContainer to download RTF + mTAN models from HuggingFace
KeshavMajithia Jun 3, 2026
c7971ab
feat: download all ONNX models (ACAI, BTSBot, RTF, mTAN) in initConta…
KeshavMajithia Jun 3, 2026
d6c12e3
Merge remote-tracking branch 'origin/main' into feat/rtf-mtan-encoders
KeshavMajithia Jun 3, 2026
282ff73
fix: address Copilot review — handle poisoned mutex, skip empty embed…
KeshavMajithia Jun 3, 2026
ee898da
Merge remote-tracking branch 'origin/main' into feat/rtf-mtan-encoders
KeshavMajithia Jun 10, 2026
2428402
fix: update AlertCutout import path after upstream refactor
KeshavMajithia Jun 10, 2026
621b2db
Merge remote-tracking branch 'origin' into encoder-testing
smaharjan-web Jun 16, 2026
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
41 changes: 41 additions & 0 deletions .github/workflows/build-fork.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and push BOOM image

on:
push:
branches: [feat/public-filter-endpoints, feat/rtf-mtan-encoders]
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: keshavmajithia/boom

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
platforms: linux/amd64
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cache,mode=max
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update && \
ca-certificates curl bash tar xz-utils gcc g++ python3 python3-venv libhdf5-dev \
perl make libsasl2-dev libsasl2-2 default-jre-headless pkg-config clang libclang-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
curl -fsSL https://dlcdn.apache.org/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -o /tmp/kafka.tgz && \
curl -fsSL https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -o /tmp/kafka.tgz && \
tar -xzf /tmp/kafka.tgz -C /opt && \
ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} /opt/kafka && \
rm -f /tmp/kafka.tgz
Expand Down
105 changes: 105 additions & 0 deletions k8s/08-boom-scheduler-ztf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
##############################################
# BOOM Scheduler ZTF — Deployment
##############################################
apiVersion: apps/v1
kind: Deployment
metadata:
name: boom-scheduler-ztf
namespace: umn-babamul
spec:
replicas: 1
selector:
matchLabels:
app: boom-scheduler-ztf
template:
metadata:
labels:
app: boom-scheduler-ztf
spec:
initContainers:
# Downloads all ONNX model files from HuggingFace into a shared
# emptyDir volume before the main scheduler container starts.
# Models are loaded from /app/data/models/ at runtime.
- name: download-models
image: curlimages/curl:8.7.1
command:
- sh
- -c
- |
set -e
HF_BASE="https://huggingface.co/boom-astro/boomEncoders/resolve/main"

# ACAI classifiers (~35 KB each)
for variant in acai_h acai_n acai_v acai_o acai_b; do
echo "Downloading ${variant}.d1_dnn_20201130.onnx ..."
curl -fsSL "${HF_BASE}/${variant}.d1_dnn_20201130.onnx" -o "/models/${variant}.d1_dnn_20201130.onnx"
done

# BTSBot classifier (~900 KB)
echo "Downloading btsbot-v1.0.1.onnx ..."
curl -fsSL "${HF_BASE}/btsbot-v1.0.1.onnx" -o /models/btsbot-v1.0.1.onnx

# RTF encoder (8.7 MB)
echo "Downloading rtf_embed.onnx ..."
curl -fsSL "${HF_BASE}/rtf_embed.onnx" -o /models/rtf_embed.onnx

# mTAN encoder (383 KB)
echo "Downloading mtan_embed.onnx ..."
curl -fsSL "${HF_BASE}/mtan_embed.onnx" -o /models/mtan_embed.onnx

echo "All models downloaded."
ls -lh /models/
volumeMounts:
- name: models
mountPath: /models
containers:
- name: scheduler-ztf
image: ghcr.io/keshavmajithia/boom:latest
command: ["/app/scheduler", "ztf"]
env:
- name: BOOM_DATABASE__PASSWORD
valueFrom:
secretKeyRef:
name: boom-secrets
key: BOOM_DATABASE__PASSWORD
- name: BOOM_API__AUTH__SECRET_KEY
valueFrom:
secretKeyRef:
name: boom-secrets
key: BOOM_API__AUTH__SECRET_KEY
- name: BOOM_API__AUTH__ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: boom-secrets
key: BOOM_API__AUTH__ADMIN_PASSWORD
- name: BOOM_DATABASE__HOST
value: "mongo"
- name: BOOM_DATABASE__USERNAME
value: "mongoadmin"
- name: BOOM_REDIS__HOST
value: "valkey"
- name: BOOM_BABAMUL__ENABLED
value: "false"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://otel-collector:4317"
volumeMounts:
- name: boom-config
mountPath: /app/config.yaml
subPath: config.yaml
readOnly: true
- name: models
mountPath: /app/data/models
readOnly: true
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2"
memory: "4Gi"
volumes:
- name: boom-config
configMap:
name: boom-config
- name: models
emptyDir: {}
2 changes: 1 addition & 1 deletion src/api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub async fn get_test_auth(db: &Database) -> Result<AuthProvider, std::io::Error
AuthProvider::new(&app_config, &db).await
}

pub const PUBLIC_ROUTES: &[&str] = &["/docs", "/auth", "/"];
pub const PUBLIC_ROUTES: &[&str] = &["/docs", "/auth", "/", "/filters/test", "/filters/test/count", "/surveys/ZTF/schemas", "/filters/schemas/ZTF", "/filters/schemas/LSST"];

pub async fn auth_middleware(
req: ServiceRequest,
Expand Down
14 changes: 0 additions & 14 deletions src/api/routes/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,14 +853,7 @@ impl FilterTestResponse {
pub async fn post_filter_test(
db: web::Data<Database>,
body: web::Json<FilterTestRequest>,
current_user: Option<web::ReqData<User>>,
) -> HttpResponse {
let _current_user = match current_user {
Some(user) => user,
None => {
return HttpResponse::Unauthorized().body("Unauthorized");
}
};
let body = body.clone();
let survey = body.survey;
let permissions = body.permissions;
Expand Down Expand Up @@ -987,14 +980,7 @@ impl FilterTestCountResponse {
pub async fn post_filter_test_count(
db: web::Data<Database>,
body: web::Json<FilterTestCountRequest>,
current_user: Option<web::ReqData<User>>,
) -> HttpResponse {
let _current_user = match current_user {
Some(user) => user,
None => {
return HttpResponse::Unauthorized().body("Unauthorized");
}
};
let body = body.clone();
let survey = body.survey;
let permissions = body.permissions;
Expand Down
16 changes: 16 additions & 0 deletions src/enrichment/models/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
mod acai;
mod base;
mod btsbot;
mod mtan;
mod rtf;

pub use acai::AcaiModel;
pub use base::{load_model, load_model_on_device, Model, ModelError};
pub use btsbot::BtsBotModel;
pub use mtan::MtanModel;
pub use rtf::RtfModel;

use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
Expand All @@ -24,6 +28,8 @@ pub struct SharedModels {
pub acai_o: Mutex<AcaiModel>,
pub acai_b: Mutex<AcaiModel>,
pub btsbot: Mutex<BtsBotModel>,
pub rtf_embed: Mutex<RtfModel>,
pub mtan_embed: Mutex<MtanModel>,
}

impl std::fmt::Debug for SharedModels {
Expand Down Expand Up @@ -63,6 +69,14 @@ impl SharedModels {
"data/models/btsbot-v1.0.1.onnx",
id,
)?),
rtf_embed: Mutex::new(RtfModel::new_on_device(
"data/models/rtf_embed.onnx",
id,
)?),
mtan_embed: Mutex::new(MtanModel::new_on_device(
"data/models/mtan_embed.onnx",
id,
)?),
},
None => Self {
acai_h: Mutex::new(AcaiModel::new("data/models/acai_h.d1_dnn_20201130.onnx")?),
Expand All @@ -71,6 +85,8 @@ impl SharedModels {
acai_o: Mutex::new(AcaiModel::new("data/models/acai_o.d1_dnn_20201130.onnx")?),
acai_b: Mutex::new(AcaiModel::new("data/models/acai_b.d1_dnn_20201130.onnx")?),
btsbot: Mutex::new(BtsBotModel::new("data/models/btsbot-v1.0.1.onnx")?),
rtf_embed: Mutex::new(RtfModel::new("data/models/rtf_embed.onnx")?),
mtan_embed: Mutex::new(MtanModel::new("data/models/mtan_embed.onnx")?),
},
};
info!("all ONNX models loaded successfully");
Expand Down
Loading
Loading