Repository navigation
Add Dockerfile and Datum Cloud deploy pipeline - #12
Merged
Merged
Conversation
- 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>
4 tasks done
Collaborator
Author
|
Reopening to trigger CI after retargeting to main. |
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>
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #11 (needs that branch's
sqlalchemy[asyncio]/greenlet fix to actually boot in a container).Dockerfile-- verified end-to-end locally (build, run against a real Postgres container, migrations run,/healthreturns 200).github/workflows/deploy.yml: builds and pushes toghcr.io/altsmanager/apion push tomain, then deploys to Datum Cloud Compute viadatumctl compute deployDEPLOY.mdwith the one-time setup this depends on, and what's still unverifiedContext / open items
altsmanager, under the Humans of the Internet org) -- access has been requested from Datum. Nothing here can be applied until it's granted.STORAGE_BACKEND=localand a self-hosted Postgres workload would lose all data on restart.datumctl compute deploybehavior on repeat calls (does it preserve Secret references?) is unverified against a real deployment -- flagged inline in the workflow and inDEPLOY.md.Testing
docker build .succeedsalembic upgrade head, and serves/health-> 200actionlintpasses on the new workflow🤖 Generated with Claude Code