Skip to content

Add Dockerfile and Datum Cloud deploy pipeline - #12

Merged
zsmithnyc merged 6 commits into
mainfrom
deploy-pipeline
Oct 22, 2026
Merged

zsmithnyc merged 6 commits into
mainfrom
deploy-pipeline

Conversation

@zsmithnyc

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #11 (needs that branch's sqlalchemy[asyncio]/greenlet fix to actually boot in a container).

  • Add a Dockerfile -- verified end-to-end locally (build, run against a real Postgres container, migrations run, /health returns 200)
  • Add .github/workflows/deploy.yml: builds and pushes to ghcr.io/altsmanager/api on push to main, then deploys to Datum Cloud Compute via datumctl compute deploy
  • Add DEPLOY.md with the one-time setup this depends on, and what's still unverified

Context / open items

  • Datum Compute isn't enabled yet for the target project (altsmanager, under the Humans of the Internet org) -- access has been requested from Datum. Nothing here can be applied until it's granted.
  • Postgres and document storage are external services (Supabase, and an S3-compatible bucket), not Datum Compute workloads -- Datum Compute has no persistent disk, so STORAGE_BACKEND=local and a self-hosted Postgres workload would lose all data on restart.
  • The exact datumctl compute deploy behavior on repeat calls (does it preserve Secret references?) is unverified against a real deployment -- flagged inline in the workflow and in DEPLOY.md.

Testing

  • docker build . succeeds
  • Container boots against a real Postgres container, runs alembic upgrade head, and serves /health -> 200
  • actionlint passes on the new workflow

🤖 Generated with Claude Code

- Add a Dockerfile (python:3.12-slim, runs migrations then uvicorn on
  container start) -- verified end-to-end against a real Postgres container
- Add .github/workflows/deploy.yml: build+push to ghcr.io on push to main,
  then datumctl compute deploy to Datum Cloud Compute
- Add DEPLOY.md documenting the one-time setup and what's still unverified
  (Compute access for the project is pending; Postgres and document storage
  are external services since Datum Compute has no persistent disk)

Stacked on security-hardening (#11) -- this Dockerfile depends on the
sqlalchemy[asyncio]/greenlet fix in that branch to actually boot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zsmithnyc
zsmithnyc changed the base branch from security-hardening to main October 21, 2026 21:14
@zsmithnyc

Copy link
Copy Markdown
Collaborator Author

Reopening to trigger CI after retargeting to main.

@zsmithnyc zsmithnyc closed this Oct 21, 2026
@zsmithnyc zsmithnyc reopened this Oct 21, 2026
zsmithnyc and others added 5 commits October 21, 2026 20:56
Two real deploy-blocking bugs found and fixed against a live Datum Cloud
deployment:

- uvicorn was bound to 0.0.0.0 (IPv4), but Datum Compute's network (Galactic
  VPC) is IPv6-only -- instances have no IPv4 address at all. Bind to ::
  instead, matching Datum's own example workloads.
- uvicorn didn't trust the edge's proxy headers, so redirects (e.g. the admin
  panel's post-login redirect) were generated as http:// even though Datum's
  edge terminates TLS and only exposes https:// -- browsers correctly refused
  to follow the downgrade. Added --proxy-headers --forwarded-allow-ips='*'
  (safe here: the container has no other public ingress path).

Also restyle the sqladmin panel (navy/gold theme, polished login page) via
sqladmin's supported templates_dir override -- two small template files
layering on its built-in Tabler theme, no fork needed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The api workload is now actually live (https://grain-noodle-m23qc.datumproxy.net),
so replace the "unverified" placeholders with what a real deployment required:
--runtime-class=general-purpose (immutable, platform default won't run a
plain Docker image), deploying by digest rather than tag, and the Secret/
Supabase/Wasabi setup that's already done.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Excluding hashed_password from the User admin form (correct -- never let an
admin type/view a raw hash) also made it impossible to create a user at all:
the column is NOT NULL, and nothing on the form could ever populate it,
so every create hit a NotNullViolation.

Add a real (not model-backed) "password" field via scaffold_form, hashed
server-side in on_model_change before insert. Required on create, optional
on edit (leave blank to keep the current password). Also strips whitespace
from the email field -- a trailing space on a real create attempt in
production stored an unusable address.

Verified end-to-end: create with no password -> clean 400 with a readable
message (previously a raw SQL traceback); create with password -> user
created with a correctly-hashed password and trimmed email, confirmed able
to log in via POST /api/v1/auth/login.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Prompted by discovering web's Dockerfile was still on an EOL Node.js base
image (see AltsManager/web@0dfe378) -- add the same coverage here so this
repo's python:3.12-slim base doesn't go stale unnoticed either.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zsmithnyc
zsmithnyc merged commit 993eab0 into main Oct 22, 2026
3 of 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.

1 participant