feat: make version deployable

This commit is contained in:
nobody 2025-11-29 13:56:55 -08:00
commit 49bd94cda2
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
22 changed files with 7785 additions and 10962 deletions

View file

@ -4,7 +4,7 @@ job "salience-editor-api" {
constraint {
attribute = "${node.unique.name}"
value = "chicago-web01"
value = "mac-mini"
}
group "app" {
@ -28,26 +28,27 @@ job "salience-editor-api" {
canary = 1
}
task "gunicorn-server" {
task "waitress-server" {
driver = "raw_exec"
user = "peoplesgrocers"
#user = "nomad"
config {
work_dir = "$RELEASE_PATH"
command = "/home/peoplesgrocers/.local/bin/uv"
# You can add --log-level debug to gunicorn
args = ["run", "gunicorn", "--preload", "--workers", "3", "--bind", "127.0.0.1:${NOMAD_PORT_http}", "--timeout", "300", "salience:app"]
command = "/Users/nomad/.local/bin/uv"
# Waitress is single-process (no fork), avoiding Metal/MPS issues on macOS
args = ["run", "waitress-serve", "--listen=10.77.0.2:${NOMAD_PORT_http}", "--listen=127.0.0.1:${NOMAD_PORT_http}", "salience:app"]
}
env {
PORT = "${NOMAD_PORT_http}"
ORIGIN = "https://peoplesgrocers.com"
#PATH = "/home/peoplesgrocers/.local/bin:/usr/local/bin:/usr/bin:/bin"
HOME = "/home/peoplesgrocers"
UV_CACHE_DIR = "/home/peoplesgrocers/.cache/uv"
HF_HOME = "/home/peoplesgrocers/cache-huggingface"
NLTK_DATA = "/home/peoplesgrocers/cache-nltk"
#PATH = "/Users/nomad/.local/bin:/usr/local/bin:/usr/bin:/bin"
HOME = "/Users/nomad"
UV_CACHE_DIR = "/Users/nomad/.cache/uv"
HF_HOME = "/Users/nomad/cache-huggingface"
NLTK_DATA = "/Users/nomad/cache-nltk"
#TORCH_DEVICE = "cpu" # Force CPU since chicago-web01 has no GPU
}
# Release path set during deployment via envsubst
@ -65,7 +66,7 @@ EOH
tags = [
"flask",
"gunicorn",
"waitress",
"api",
"ml"
]
@ -91,7 +92,7 @@ EOH
template {
data = <<EOH
#!/bin/sh
host=http://127.0.0.1:{{ env "NOMAD_PORT_http" }}
host=http://10.77.0.2:{{ env "NOMAD_PORT_http" }}
echo "=== /models ==="
curl -s "$host/models"