Testing & Submission¶
Before uploading your Gaia app to the Cohesity Marketplace, complete this testing sequence to catch issues early and ensure a smooth submission.
Testing Sequence¶
Stage 1: Local Unit Testing¶
Run your application in local development mode (no Docker) and verify all functionality:
# Start backend
cd examples/05-marketplace-chat
cp .env.example .env && vim .env # set GAIA_API_KEY
uvicorn main:app --reload --port 8080
# Start frontend dev server (separate terminal)
cd frontend
npm install && npm run dev
Check: - [ ] App loads at http://localhost:5173 - [ ] Dataset list loads from /api/datasets - [ ] Chat messages stream correctly - [ ] Error states display correctly (invalid dataset, network error)
Stage 2: Docker Build and Local Run¶
Build and test the exact image that will run on the Marketplace:
docker build -t my-app:latest .
docker run --rm -p 8080:8080 \
-e GAIA_API_KEY="your-api-key" \
-e GAIA_BASE_URL="https://helios.cohesity.com/v2/mcm/gaia" \
-e GAIA_VERIFY_SSL="true" \
-e REQUEST_TIMEOUT_SECONDS="60" \
my-app:latest
Open http://localhost:8080 (not 5173 — the Docker container serves everything on one port).
Check: - [ ] App loads at http://localhost:8080 - [ ] All API endpoints work - [ ] Static files (CSS, JS, fonts) load correctly - [ ] No browser console errors - [ ] React Router deep links work (e.g., navigate to / directly)
Stage 3: Simulate Marketplace Environment Variables¶
The Marketplace injects several environment variables. Simulate them locally:
docker run --rm -p 8080:8080 \
-e GAIA_API_KEY="your-api-key" \
-e HOST_IP="192.168.1.10" \
-e APP_AUTHENTICATION_TOKEN="simulated-marketplace-token" \
-e APPS_API_ENDPOINT_IP="192.168.1.10" \
-e APPS_API_ENDPOINT_PORT="12345" \
-e POD_UID="test-pod-uid" \
my-app:latest
For MCP servers, also simulate the injected NodePort:
docker run --rm -p 8002:8002 \
-e GAIA_API_KEY="your-api-key" \
-e HOST_IP="192.168.1.10" \
-e MCP_NODE_PORT="31234" \
gaia-mcp:latest
Verify the landing page shows http://192.168.1.10:31234/mcp.
Stage 4: AppSpec Validation¶
All output should be clean — no warnings or errors.
Common issues to check manually: - The image: field in the AppSpec matches the tag used in docker build - min_software_version is set to "7.2" or higher - Port numbers are consistent across Service, ReplicaSet containerPort, and wrapper.sh
Stage 5: Bundle Integrity Check¶
docker save my-app:latest -o my-app.tar
tar -czf my-app-bundle.tar.gz appspec.yaml app.json my-app.tar
# Verify the bundle contents
tar -tzf my-app-bundle.tar.gz
Expected output:
AppSpec Validation Checklist¶
Before running appspecvalidator_exec, review these manually:
# ✓ Only supported kinds: Service, ReplicaSet, StatefulSet, Job
kind: ReplicaSet # NOT Deployment
# ✓ Replicas use the Cohesity format
replicas:
fixed: 1 # NOT replicas: 1
# ✓ cohesityTag values are valid
cohesityTag: ui # Only 'ui' or 'cleanup' are valid
# ✓ Image tag matches docker build
image: my-app:latest # Must exactly match what was saved
# ✓ Resource requests defined
resources:
requests:
cpu: 250m
memory: 128Mi
Common Issues and Fixes¶
App loads but shows blank page¶
The React build is not being served correctly. Check: - The static/ directory exists in the container: docker exec <container_id> ls /app/static/ - StaticFiles(html=True) is set — required for React Router - The COPY --from=frontend-builder /frontend/dist ./static line in the Dockerfile is correct
API calls fail with 500 errors¶
Check that GAIA_API_KEY is set in the container. Verify with:
MCP landing page shows localhost instead of cluster IP¶
HOST_IP is not being injected. In local testing, set it manually. In the Marketplace, it's auto-injected. Verify your settings.py or os.getenv("HOST_IP", "localhost") call.
cohesityEnv variable not available¶
The variable is only injected by the Marketplace platform. In local testing, set it manually with -e MCP_NODE_PORT=8002.
Docker image too large¶
If over 1GB: - Use python:3.11-slim (not python:3.11) - Use node:20-slim (not node:20) - Add a .dockerignore file - Combine RUN commands to reduce layers
Wrong platform architecture¶
If the cluster runs x86-64 but you're on Apple Silicon:
Submitting to DevPortal¶
- Log in to your Cohesity cluster web UI.
- Navigate to Apps → Upload App.
- Click Browse and select your bundle (
.tar.gz). - The platform validates
appspec.yamlandapp.json. - If validation passes, the app appears in the Apps catalog.
- Test by clicking Install and then Launch.
After Upload¶
Once installed: - The Marketplace assigns a NodePort and starts the container. - Check the container logs: cluster UI → Apps → your app → Logs. - For MCP servers: visit http://HOST_IP:NODE_PORT/ to see the landing page with the correct connection URL.
Updating a Deployed App¶
- Make code changes.
- Bump
versioninapp.json. - Rebuild the Docker image with the same tag.
- Re-package the bundle.
- Upload to DevPortal — the platform detects the new version and performs a rolling update.
Next Steps¶
- Marketplace Checklist — Complete pre-submission checklist
- Auth in the Marketplace — Review auth configuration
- AppSpec Reference — Full field reference