Skip to content

feat(backend): implement async job flow and real gRPC integration - #27

Merged
sakiphandursun merged 1 commit into
mainfrom
backend/feature
Jul 24, 2026
Merged

sakiphandursun merged 1 commit into
mainfrom
backend/feature

Conversation

@ElifFCebeci

@ElifFCebeci ElifFCebeci commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

July 21-22-23 Updates: API Gateway Async Job Flow, Real gRPC .


Description

Summary

  • /enhance and /enhance/batch now run a real async job flow instead of a fake 202 response: QUEUED → RUNNING → COMPLETED/FAILED in Redis, result is queried via GET /enhance/{job_id}.
  • /health and /models are now wired to real Health / ListModels gRPC calls (static mock removed).
  • gRPC client: 4-connection round-robin pool + retry/backoff only for UNAVAILABLE.
  • CORS, Prometheus /metrics, route-based upload size limit (413), graceful shutdown (Redis/gRPC won't close on SIGINT/SIGTERM until background jobs finish).
  • api/openapi.yaml generated; JobStatus comment in common.proto updated to match the async model.
  • Go 1.25.12 + quic-go v0.59.1 — closes 17 vulnerabilities reported by govulncheck.

Out of Scope

  • services/ml/inference_server (Python gRPC server) is not included in this PR and has not been written yet — since the gateway currently has no counterpart, /health, /models, and jobs will return "unreachable/failed". This is expected.

Test Plan

  • go build ./..., gofmt -l ., go vet ./... — clean
  • Manual smoke test with Redis + real server: /enhance → 202 → job recorded, 404 for non-existent job, 413 for files over 25MB, correct error message when gRPC is absent for /health + /models, CORS with allowed/denied origin
  • Graceful shutdown verified via code review; real SIGTERM signal could not be live-tested on Windows/local sandbox (expected to work correctly on Linux/k8s)

@sakiphandursun
sakiphandursun merged commit 59bca6d into main Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants