Skip to content

DigitalOcean Deployment Support and CI/CD Enhancements#25

Draft
surafelfikru wants to merge 25 commits into
Qoba-ai:mainfrom
surafelfikru:chore/digital-ocean
Draft

DigitalOcean Deployment Support and CI/CD Enhancements#25
surafelfikru wants to merge 25 commits into
Qoba-ai:mainfrom
surafelfikru:chore/digital-ocean

Conversation

@surafelfikru

@surafelfikru surafelfikru commented Feb 12, 2026

Copy link
Copy Markdown
Collaborator

Key Changes

  • DigitalOcean Deployment: Added .do/app.yaml template and a detailed README.md for App Platform deployment.

  • CI/CD Optimization: Updated GitHub Actions to dynamically use github.repository_owner, allowing automated image publishing to GHCR from any fork.

  • Backend Enhancements:

  • Added a /health endpoint for service monitoring.

  • Standardized database environment variables (POSTGRES_HOST, POSTGRES_SSLMODE, etc.) to support managed database connections.

  • Dynamic CORS configuration via METTA_KG_FRONTEND_URL.

  • Infrastructure:

  • Simplified docker-compose.yml to use standard ports and hosts.

  • Updated Dockerfile.mork to use Rust nightly and fixed specific dependency branches for better stability.

  • Static Assets: Included the compiled UI distribution (api/ui-dist) within the backend service.

- Pin time crate to version 0.3.36 to resolve MSRV conflict
- Add Cargo.lock for reproducible builds
- Update GitHub Actions to build both API and Mork images
- Configure DigitalOcean to use pre-built images from GHCR
- Remove unnecessary SSH key setup from workflow
- Change IMAGE_NAME back to use github.repository variable
- Update app.yaml to pull from surafelfikru/metta-kg-api and surafelfikru/metta-kg-mork
- Fixes permission denied error when pushing to qoba-ai organization
…ility

- Change base image from rust:1.88 to rust:1.86 (1.88 doesn't exist)
- Pin fast-slice-utils to 0.1.0 which has no rust-version requirement
- Resolves MSRV conflict similar to API time crate issue
- pathmap@0.3.0 requires rust 1.88 (doesn't exist)
- fast-slice-utils@0.1.2 requires rust 1.89 (doesn't exist)
- Solution: Use rustlang/rust:nightly-bookworm which satisfies all requirements
- Simplified Dockerfile by removing failed cargo update attempts
- PathMap master has breaking API changes in graft() method
- Error: graft() expects &Z but MORK passes RZ directly
- Solution: Checkout HEAD~10 to use older compatible API
- Add registry field to specify surafelfikru namespace
- Add registry_credentials using DO environment variable reference
- Simplify repository names to short format (metta-kg-api, metta-kg-mork)
- Securely reference GHCR_TOKEN from DigitalOcean secrets

This resolves the 'image reference is malformed or invalid' error by
providing proper authentication credentials for pulling from GHCR.
DigitalOcean expects credentials in format 'username:${VAR}' not just '${VAR}'.
Updated registry_credentials to include username prefix as required by DO spec validation.
The images are publicly accessible, so authentication is not required.
Removing registry_credentials field resolves the 'invalid token' error.
- Read POSTGRES_PORT from environment variable instead of hardcoding 5432
- Add POSTGRES_SSLMODE support (defaults to 'prefer', set to 'require' for DigitalOcean)
- Update app.yaml to set POSTGRES_SSLMODE=require for managed database

This fixes the connection timeout error by using the correct port (25060)
and enabling SSL for DigitalOcean managed PostgreSQL database.
…ecks

- Add address=0.0.0.0 and port=8000 to Rocket.toml to allow external connections
- Change POSTGRES_USER from metta-kg-api to doadmin for deployment
- Remove unused METTA_KG_ADDRESS and METTA_KG_PORT environment variables

This fixes health check failures by allowing DigitalOcean's health probe
to connect to the API service from outside the container. Previously,
Rocket was listening on 127.0.0.1 (localhost only), which blocked
external health check connections.
…rable

Removed unused environment variables:
- METTA_KG_DATABASE_URL (redundant - constructed from POSTGRES_* vars)
- METTA_KG_SECRET (no JWT auth implementation)
- METTA_KG_ORIGIN_URL (never used in code)
- METTA_KG_ADDRESS (now configured in Rocket.toml)
- METTA_KG_PORT (now configured in Rocket.toml)

Added METTA_KG_FRONTEND_URL for CORS configuration:
- API now reads allowed origins from environment variable
- Defaults to https://metta-kg.vercel.app if not set
- Always allows http://localhost:3000 for local development

Updated all configuration files:
- .do/app.yaml: Removed unused vars, added METTA_KG_FRONTEND_URL
- .env.example: Reorganized with clear sections and comments
- docker-compose.yml: Updated to match new env var structure
- api/src/lib.rs: CORS now configurable via METTA_KG_FRONTEND_URL

This cleanup improves maintainability and reduces confusion about
which environment variables are actually used by the application.
@vercel

vercel Bot commented Feb 12, 2026

Copy link
Copy Markdown

@surafelfikru is attempting to deploy a commit to the timverhaegen's projects Team on Vercel.

A member of the Team first needs to authorize it.

@surafelfikru surafelfikru changed the title Chore/digital ocean DigitalOcean Deployment Support and CI/CD Enhancements Feb 12, 2026
@surafelfikru surafelfikru marked this pull request as ready for review February 12, 2026 13:55
- Add deploy.py script for automated DigitalOcean deployment
  - Uses uv inline dependencies (no extra config files needed)
  - Supports optional password setting via --postgres-password flag
  - Includes dry-run mode with full spec preview in less
  - Template validation command
  - Environment variable support for all arguments
  - Default app ID configured for convenience

- Update .do/app.yaml routing from /api to / (root path)
  - Simplifies URL construction in frontend
  - Removes path prefix complexity

- Update .do/README.md with automated deployment guide
  - Add doctl and uv installation instructions
  - Document deployment script usage with examples
  - Reorganize manual deployment as alternative option

This enables one-command deployment:
  uv run .do/deploy.py deploy --github-owner <username>
- DigitalOcean service discovery requires http_port, not internal_ports
- This fixes 'bad address' error when API tries to connect to mork
- Mork remains internal-only (no routes configured)
@vercel

vercel Bot commented Feb 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
metta-kg Ready Ready Preview, Comment Feb 12, 2026 6:09pm

- Replace service-level routes with top-level ingress configuration
- This matches DigitalOcean's current spec format and prevents deployment conflicts
- Only API service is publicly accessible via ingress rules
- Mork remains internal-only (no ingress rule)
@surafelfikru surafelfikru marked this pull request as draft February 13, 2026 09:14
- Remove stale imports (Mm2Cell, Namespace, StatusRequest, StatusResponse) that don't exist in this branch
- Add missing MorkRequest trait import for .path() method calls
- All 4 fixes intact: CORS config, JSON error catchers, Mork logging, proxy URL import
- 55/55 tests pass
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