Skip to content

Deploy VAKRA to IBM Code Engine, data-backed by COS (additive, admin-… - #26

Open
anupamamurthi wants to merge 3 commits into
mainfrom
ce
Open

Deploy VAKRA to IBM Code Engine, data-backed by COS (additive, admin-…#26
anupamamurthi wants to merge 3 commits into
mainfrom
ce

Conversation

@anupamamurthi

@anupamamurthi anupamamurthi commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What & why

Adds an optional path to run the VAKRA benchmark environment on IBM Code Engine,
with the ~35 GB dataset in IBM COS instead of on every machine. Purely additive — the
local make/docker-compose flow, the MCP servers, and existing CE/COS deployments are
untouched. All resources are prefixed vakra-*; every mutating script is gated behind
VAKRA_CE_ADMIN=1.

Two seams bridged (CE-only)

  • Transport: locally MCP is reached via docker exec (stdio); CE has none, so a new
    docker/mcp_http_bridge.py serves MCP over HTTP at /mcp/<domain> when SERVE_MODE=http.
    It spawns a fresh, domain-pinned mcp_dispatch.py subprocess per request — same
    MCP_DOMAIN scoping as docker exec -e, so list_tools() stays scoped and
    verify_checksum still passes. Default (local) path unchanged.
  • Data: DATA_SOURCE=mount (default) mounts the COS bucket via a CE persistent data
    store at the exact paths the servers expect; DATA_SOURCE=sync is a download-to-disk
    fallback (docker/cos_sync.py).

Contents

  • deploy/ce/config.sh, 0_push_data_to_cos.py, 1_create_bucket_and_pds.sh,
    2_build_push_image.sh, 3_deploy_apps.sh, 4_deploy_explorer.sh, 5_test_ce.py,
    teardown.sh, Dockerfile.explorer, and docs (README/RUNBOOK/USING/CHEATSHEET).
  • Additive edits: mcp_client.py (+http transport), benchmark_runner.py (log server URL),
    tools_explorer/app.py (MCP_CONFIG env), docker/{Dockerfile.unified,entrypoint-unified.sh}
    (opt-in bridge + mcp==1.27.0 pin), .dockerignore (anchor top-level /data/),
    benchmark/mcp_connection_config.ce.yaml.

Benchmarking against CE

Unchanged runner — only --mcp-config benchmark/mcp_connection_config.ce.yaml differs;
per-domain scoping is automatic.

Testing

  • 5_test_ce.py: 4/4 capabilities green on CE (cap1=9, cap2=139, cap3/bpo=32, cap4=144 tools).
  • Runner --list-tools against CE verified. Full LLM run is provider-key-gated (openai/watsonx).
  • Bridge concurrency fix validated locally against a dummy MCP server before deploy.

Usage

Deploy it (admins)

From the repo root, one-time: ibmcloud login --sso, then create a venv
(python3.12 -m venv .venv && pip install -e ".[agents,mcp,init]" boto3 openai). Then:

  1. python deploy/ce/0_push_data_to_cos.py --stream # data → COS (~35 GB, resumable)
  2. VAKRA_CE_ADMIN=1 YES=1 deploy/ce/1_create_bucket_and_pds.sh
  3. VAKRA_CE_ADMIN=1 YES=1 deploy/ce/2_build_push_image.sh # cloud build → ICR (~15 min)
  4. VAKRA_CE_ADMIN=1 YES=1 deploy/ce/3_deploy_apps.sh # writes deploy/ce/.ce_urls.env
    Verify: source deploy/ce/.ce_urls.env && python deploy/ce/5_test_ce.py → expect 4/4.
    Full detail + gotchas: deploy/ce/RUNBOOK.md. One-pager: deploy/ce/CHEATSHEET.md.

Use the deployed env (everyone else)

Get deploy/ce/.ce_urls.env (the 4 URLs) from an admin, then pick one:
• Any MCP client → connect to <base>/mcp/<domain> (streamable HTTP; health at <base>/healthz).
• Benchmark runner → source .ce_urls.env then
python benchmark_runner.py --capability_id 2 --domain california_schools \ --mcp-config benchmark/mcp_connection_config.ce.yaml (add a provider + key for a real run).
• Hosted explorer → open the vakra-explorer URL and browse/invoke tools in the browser.
Endpoints are public (no auth) — treat URLs as internal. Guide: deploy/ce/USING.md.

SUMMARY: https://ibm-netlify-drop.1gxwxi8kos9y.us-east.codeengine.appdomain.cloud/s/6229b0be/

@anupamamurthi

Copy link
Copy Markdown
Collaborator Author

Tool Explorer (+ all the 4 services are up and running in CE)

image

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