-
Notifications
You must be signed in to change notification settings - Fork 0
feat(pmoves-ai): Add PMOVES.AI integration patterns #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c66dd80
5cfb5bd
51e5e74
c62040a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # CodeRabbit Configuration for PMOVES Submodule | ||
| reviews: | ||
| review_status: true | ||
| branches: | ||
| - "main" | ||
| - "feat/*" | ||
| - "fix/*" | ||
| excluded_branches: | ||
| - "origin/main" | ||
| language: "en-US" | ||
| doc_target_coverage: 80 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,93 @@ | ||||||||||||||||||||||||||
| # PMOVES.AI Integration Guide for Archon Agent Service | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Integration Complete | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| The PMOVES.AI integration template has been applied to Archon Agent Service. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Next Steps | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### 1. Customize Environment Variables | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Edit the following files with your service-specific values: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - `env.shared` - Base environment configuration | ||||||||||||||||||||||||||
| - `env.tier-agent` - AGENT tier specific configuration | ||||||||||||||||||||||||||
| - `chit/secrets_manifest_v2.yaml` - Add your service's required secrets | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### 2. Update Docker Compose | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Add the PMOVES.AI environment anchor to your `docker-compose.yml`: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||
| archon: | ||||||||||||||||||||||||||
| <<: [*env-tier-agent, *pmoves-healthcheck] | ||||||||||||||||||||||||||
| # Your existing service configuration... | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### 3. Integrate Health Check | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Add the health check endpoint to your service: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ```python | ||||||||||||||||||||||||||
| from pmoves_health import add_custom_check, get_health_status | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| @app.get("/healthz") | ||||||||||||||||||||||||||
| async def health_check(): | ||||||||||||||||||||||||||
| return await get_health_status() | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### 4. Add Service Announcement | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Add NATS service announcement to your startup: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ```python | ||||||||||||||||||||||||||
| from pmoves_announcer import announce_service | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| @app.on_event("startup") | ||||||||||||||||||||||||||
| async def startup(): | ||||||||||||||||||||||||||
| await announce_service( | ||||||||||||||||||||||||||
| slug="archon", | ||||||||||||||||||||||||||
| name="Archon Agent Service", | ||||||||||||||||||||||||||
| url=f"http://archon:8091", | ||||||||||||||||||||||||||
| port=8091, | ||||||||||||||||||||||||||
| tier="agent" | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### 5. Test Integration | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||
| # Test health check | ||||||||||||||||||||||||||
| curl http://localhost:8091/healthz | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Verify environment variables loaded | ||||||||||||||||||||||||||
| docker compose exec archon env | grep PMOVES | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Verify NATS announcement | ||||||||||||||||||||||||||
| nats sub "services.announce.v1" | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Service Details | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - **Name:** Archon Agent Service | ||||||||||||||||||||||||||
| - **Slug:** archon | ||||||||||||||||||||||||||
| - **Tier:** agent | ||||||||||||||||||||||||||
| - **Port:** 8091 | ||||||||||||||||||||||||||
| - **Health Check:** http://localhost:8091/healthz | ||||||||||||||||||||||||||
| - **NATS Enabled:** False | ||||||||||||||||||||||||||
|
Comment on lines
+73
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid bare URLs in Markdown lists. ✏️ Proposed fix-- **Health Check:** http://localhost:8091/healthz
+- **Health Check:** <http://localhost:8091/healthz>📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)77-77: Bare URL used (MD034, no-bare-urls) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| - **GPU Enabled:** False | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Files Created | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - `env.shared` - Base PMOVES.AI environment | ||||||||||||||||||||||||||
| - `env.tier-agent` - Tier-specific environment | ||||||||||||||||||||||||||
| - `chit/secrets_manifest_v2.yaml` - CHIT secrets configuration | ||||||||||||||||||||||||||
| - `pmoves_health/` - Health check module | ||||||||||||||||||||||||||
| - `pmoves_announcer/` - NATS service announcer | ||||||||||||||||||||||||||
| - `pmoves_registry/` - Service registry client | ||||||||||||||||||||||||||
| - `docker-compose.pmoves.yml` - PMOVES.AI YAML anchors | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Support | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| For questions or issues, see the PMOVES.AI documentation. | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # PMOVES.AI CHIT Secrets Manifest Template | ||
| # Place at: chit/secrets_manifest_v2.yaml or .chit/secrets_manifest_v2.yaml | ||
|
|
||
| api_version: "2.0" | ||
| environment: ${CHIT_ENVIRONMENT:-production} | ||
|
|
||
| # Secrets sources in order of precedence (higher number = higher precedence) | ||
| sources: | ||
| # 1. Environment variables (base precedence) | ||
| - type: env | ||
| precedence: 50 | ||
|
|
||
| # 2. CHIT Vault (highest precedence - overrides env vars) | ||
| - type: chit_vault | ||
| precedence: 100 | ||
| endpoint: ${CHIT_VAULT_ENDPOINT:-http://chit-vault:8050} | ||
|
|
||
| # Secrets required by this service | ||
| # Replace the example variables below with your service's actual secrets | ||
| variables: | ||
| # === Service Identity === | ||
| - SERVICE_NAME | ||
| - SERVICE_SLUG | ||
|
|
||
| # === PMOVES.AI Core Services === | ||
| - NATS_URL | ||
|
|
||
| # === LLM Gateway (if using TensorZero) === | ||
| # Uncomment if your service uses TensorZero | ||
| # - TENSORZERO_URL | ||
| # - TENSORZERO_API_KEY | ||
|
|
||
| # === GPU Orchestrator (if applicable) === | ||
| # Uncomment for GPU services | ||
| # - GPU_ORCHESTRATOR_URL | ||
|
|
||
| # === Data Services (as applicable) === | ||
| # - QDRANT_URL | ||
| # - QDRANT_API_KEY | ||
| # - NEO4J_URL | ||
| # - NEO4J_USERNAME | ||
| # - NEO4J_PASSWORD | ||
| # - MEILISEARCH_URL | ||
| # - MEILISEARCH_API_KEY | ||
| # - MINIO_ENDPOINT | ||
| # - MINIO_ACCESS_KEY | ||
| # - MINIO_SECRET_KEY | ||
|
|
||
| # === Supabase (if applicable) === | ||
| # - SUPABASE_URL | ||
| # - SUPABASE_ANON_KEY | ||
| # - SUPABASE_SERVICE_KEY | ||
|
|
||
| # === Service-Specific Secrets === | ||
| # Add your service's required secrets below | ||
| # - EXAMPLE_API_KEY | ||
| # - EXAMPLE_DATABASE_URL | ||
|
|
||
| # Optional: define secret groups for different environments | ||
| groups: | ||
| development: | ||
| required: | ||
| - SERVICE_NAME | ||
| - NATS_URL | ||
| optional: | ||
| - LOG_LEVEL | ||
|
|
||
| production: | ||
| required: | ||
| - SERVICE_NAME | ||
| - SERVICE_SLUG | ||
| - NATS_URL | ||
| optional: | ||
| - LOG_LEVEL | ||
|
|
||
| # Validation rules | ||
| validation: | ||
| strict: false # Set to true to fail on missing optional secrets | ||
| fail_on_missing_required: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| # PMOVES.AI Docker Compose YAML Anchors Template | ||
| # | ||
| # These YAML anchors provide standardized environment loading for PMOVES services. | ||
| # Include this file or copy the anchors into your docker-compose.yml. | ||
| # | ||
| # Usage: | ||
| # services: | ||
| # my-service: | ||
| # <<: *env-tier-api | ||
| # environment: | ||
| # SERVICE_NAME: my-service | ||
| # SERVICE_SPECIFIC_VAR: value | ||
|
|
||
| version: "3.8" | ||
|
|
||
| # PMOVES.AI Environment Loading Anchors | ||
| # These anchors provide tier-based environment file loading | ||
| # NOTE: Use map-based environment vars (not list-based) for proper YAML merging | ||
| x-pmoves-env: &pmoves-env-base | ||
| env_file: | ||
| - env.shared # Base PMOVES.AI configuration | ||
| environment: | ||
| PMOVES_ENV: ${PMOVES_ENV:-production} | ||
| TIER: ${TIER} | ||
| NATS_URL: ${NATS_URL:-nats://nats:4222} | ||
| TENSORZERO_URL: ${TENSORZERO_URL:-http://tensorzero-gateway:3030} | ||
|
|
||
| # API Tier Environment | ||
| x-env-tier-api: &env-tier-api | ||
| <<: *pmoves-env-base | ||
| env_file: | ||
| - env.shared | ||
| - env.tier-api # API tier specific configuration | ||
| environment: | ||
| TIER: api | ||
| MAX_CONCURRENT_REQUESTS: ${MAX_CONCURRENT_REQUESTS:-100} | ||
| RATE_LIMIT_ENABLED: ${RATE_LIMIT_ENABLED:-true} | ||
|
|
||
| # Agent Tier Environment | ||
| x-env-tier-agent: &env-tier-agent | ||
| <<: *pmoves-env-base | ||
| env_file: | ||
| - env.shared | ||
| - env.tier-agent # Agent tier specific configuration | ||
|
Comment on lines
+39
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The compose anchors point at Useful? React with 👍 / 👎. |
||
| environment: | ||
| TIER: agent | ||
| MAX_CONCURRENT_AGENTS: ${MAX_CONCURRENT_AGENTS:-50} | ||
| MCP_ENABLED: ${MCP_ENABLED:-true} | ||
|
|
||
| # Worker Tier Environment | ||
| x-env-tier-worker: &env-tier-worker | ||
| <<: *pmoves-env-base | ||
| env_file: | ||
| - env.shared | ||
| - env.tier-worker # Worker tier specific configuration | ||
| environment: | ||
| TIER: worker | ||
| MAX_CONCURRENT_JOBS: ${MAX_CONCURRENT_JOBS:-10} | ||
| WORKER_POOL_SIZE: ${WORKER_POOL_SIZE:-4} | ||
|
|
||
| # Data Tier Environment | ||
| x-env-tier-data: &env-tier-data | ||
| <<: *pmoves-env-base | ||
| env_file: | ||
| - env.shared | ||
| - env.tier-data # Data tier specific configuration | ||
| environment: | ||
| TIER: data | ||
| MAX_CONNECTIONS: ${MAX_CONNECTIONS:-100} | ||
|
|
||
| # LLM Tier Environment | ||
| x-env-tier-llm: &env-tier-llm | ||
| <<: *pmoves-env-base | ||
| env_file: | ||
| - env.shared | ||
| - env.tier-llm # LLM tier specific configuration | ||
| environment: | ||
| TIER: llm | ||
| MAX_CONCURRENT_REQUESTS: ${MAX_CONCURRENT_REQUESTS:-50} | ||
|
|
||
| # Media Tier Environment | ||
| x-env-tier-media: &env-tier-media | ||
| <<: *pmoves-env-base | ||
| env_file: | ||
| - env.shared | ||
| - env.tier-media # Media tier specific configuration | ||
| environment: | ||
| TIER: media | ||
| GPU_ENABLED: ${GPU_ENABLED:-true} | ||
| MAX_CONCURRENT_JOBS: ${MAX_CONCURRENT_JOBS:-4} | ||
|
|
||
| # Health check template | ||
| x-pmoves-healthcheck: &pmoves-healthcheck | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"] | ||
| interval: 30s | ||
| timeout: 5s | ||
| retries: 3 | ||
| start_period: 10s | ||
|
|
||
| # GPU resource template | ||
| x-pmoves-gpu: &pmoves-gpu-resource | ||
| deploy: | ||
| resources: | ||
| reservations: | ||
| devices: | ||
| - driver: nvidia | ||
| count: 1 | ||
| capabilities: [gpu] | ||
|
|
||
| # Service labels for Prometheus discovery | ||
| x-pmoves-labels: &pmoves-labels | ||
| labels: | ||
| - "pmoves.service=true" | ||
| - "prometheus.io/scrape=true" | ||
| - "prometheus.io/port=9090" | ||
| - "prometheus.io/path=/metrics" | ||
|
|
||
| # Example service definition using the templates: | ||
| # | ||
| # services: | ||
| # my-api-service: | ||
| # <<: [*env-tier-api, *pmoves-healthcheck, *pmoves-labels] | ||
| # image: ghcr.io/powerfulmoves/my-service:latest | ||
| # ports: | ||
| # - "8080:8080" | ||
| # environment: | ||
| # SERVICE_NAME: my-api-service | ||
| # SERVICE_PORT: 8080 | ||
| # | ||
| # my-gpu-worker: | ||
| # <<: [*env-tier-worker, *pmoves-gpu-resource, *pmoves-healthcheck] | ||
| # image: ghcr.io/powerfulmoves/my-gpu-worker:latest | ||
| # environment: | ||
| # SERVICE_NAME: my-gpu-worker | ||
| # CUDA_VISIBLE_DEVICES: 0 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the env file name and hyphenate “tier-specific”.
The PR adds
env.tier-agent.sh, but the guide listsenv.tier-agent, and “tier-specific” should be hyphenated.✏️ Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[grammar] ~14-~14: Use a hyphen to join words.
Context: ...guration -
env.tier-agent- AGENT tier specific configuration - `chit/secrets_m...(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents