Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ Thumbs.db
.playwright-mcp/
.stories/
.testplans/
.spikes/
.spikes/
65 changes: 65 additions & 0 deletions BACKEND_BUILD_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Fix Backend Exec Format Error

## Problem
`exec container process '/app/./main': Exec format error` - This means the binary architecture doesn't match the cluster.

## Solution: Rebuild with explicit platform

### Option 1: Build with --platform flag (Recommended)

```bash
cd components/backend

# Build explicitly for linux/amd64
podman build --platform linux/amd64 -t quay.io/gkrumbach07/vteam_backend:langgraph-mvp .

# Push
podman push quay.io/gkrumbach07/vteam_backend:langgraph-mvp
```

### Option 2: Update Dockerfile (Already done)

The Dockerfile has been updated to explicitly build for `GOARCH=amd64`. Just rebuild:

```bash
cd components/backend
podman build --platform linux/amd64 -t quay.io/gkrumbach07/vteam_backend:langgraph-mvp .
podman push quay.io/gkrumbach07/vteam_backend:langgraph-mvp
```

### Option 3: Check your VM architecture

```bash
# Check what architecture your VM is
uname -m

# If it's aarch64 (ARM64), you MUST use --platform linux/amd64
# If it's x86_64 (AMD64), the build should work, but still use --platform to be safe
```

## After Rebuilding

```bash
# Update deployment
oc set image deployment/backend-api backend-api=quay.io/gkrumbach07/vteam_backend:langgraph-mvp -n ambient-code

# Wait for rollout
oc rollout status deployment/backend-api -n ambient-code

# Check logs
oc logs -n ambient-code -l app=backend-api --tail=50
```

## Verify the Binary Architecture

You can check the binary architecture inside the image:

```bash
# Create a test container
podman run --rm quay.io/gkrumbach07/vteam_backend:langgraph-mvp file /app/main

# Should show: ELF 64-bit LSB executable, x86-64
# If it shows ARM or other architecture, rebuild with --platform linux/amd64
```


128 changes: 128 additions & 0 deletions BUILD_COMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Build and Push Commands

## Prerequisites

```bash
# Login to Quay.io (do this once)
podman login quay.io
# Enter username: gkrumbach07
# Enter password/token when prompted
```

---

## 1. LangGraph Wrapper Base Image

**Location:** `components/runners/langgraph-wrapper/`

```bash
cd components/runners/langgraph-wrapper

# Build for linux/amd64 (required for OpenShift/K8s)
podman build --platform linux/amd64 -t quay.io/gkrumbach07/langgraph-wrapper:base .

# Push to Quay.io
podman push quay.io/gkrumbach07/langgraph-wrapper:base

# Get digest (save this for reference)
podman inspect quay.io/gkrumbach07/langgraph-wrapper:base | jq -r '.[0].RepoDigests[0]'
```

**Note:** Make sure this image is public in Quay.io settings so workflows can pull it.

---

## 2. Backend Image

**Location:** `components/backend/`

**On your Linux VM:**

```bash
cd components/backend

# Build the backend image
podman build -t quay.io/gkrumbach07/vteam_backend:langgraph-mvp .

# Push to Quay.io
podman push quay.io/gkrumbach07/vteam_backend:langgraph-mvp

# Get digest (save this for reference)
podman inspect quay.io/gkrumbach07/vteam_backend:langgraph-mvp | jq -r '.[0].RepoDigests[0]'
```

**After pushing, update the deployment:**

```bash
# Update deployment to use new image
oc set image deployment/backend-api backend-api=quay.io/gkrumbach07/vteam_backend:langgraph-mvp -n ambient-code

# Or use digest for pinning:
oc set image deployment/backend-api backend-api=quay.io/gkrumbach07/vteam_backend@sha256:YOUR_DIGEST -n ambient-code
```

---

## 3. Example Workflow Image (Optional - for testing)

**Location:** `test-workflow-example/`

```bash
cd test-workflow-example

# Build for linux/amd64
podman build --platform linux/amd64 -t quay.io/gkrumbach07/langgraph-example-workflow:v1.0.0 .

# Push to Quay.io
podman push quay.io/gkrumbach07/langgraph-example-workflow:v1.0.0

# Get digest (required for registration)
podman inspect quay.io/gkrumbach07/langgraph-example-workflow:v1.0.0 | jq -r '.[0].RepoDigests[0]'
```

**After pushing, register in the backend:**

```bash
# Replace YOUR_DIGEST with the digest from above
curl -X POST "http://localhost:8080/api/projects/YOUR_PROJECT/workflows/example-workflow/versions" \
-H "Content-Type: application/json" \
-d '{
"version": "v1.0.0",
"imageRef": "quay.io/gkrumbach07/langgraph-example-workflow@sha256:YOUR_DIGEST",
"graphs": [
{
"name": "main",
"entry": "app.workflow:build_app"
}
],
"inputsSchema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Input message to process"
}
},
"required": ["message"]
}
}'
```

---

## Quick Reference

### Image Tags:
- Base wrapper: `quay.io/gkrumbach07/langgraph-wrapper:base`
- Backend: `quay.io/gkrumbach07/vteam_backend:langgraph-mvp`
- Example workflow: `quay.io/gkrumbach07/langgraph-example-workflow:v1.0.0`

### Registry Paths:
- Your personal org: `quay.io/gkrumbach07/*`
- Main org: `quay.io/ambient_code/*`

### Build Order:
1. **First:** Build and push `langgraph-wrapper:base` (workflows depend on it)
2. **Second:** Build and push `vteam_backend:langgraph-mvp` (system component)
3. **Third:** Build and push example workflow (for testing)

114 changes: 114 additions & 0 deletions DEPLOY_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Deployment Checklist for LangGraph MVP

## ✅ Already Done
- ✅ Logged into OpenShift cluster (as `clusteradmin`)
- ✅ Built `langgraph-wrapper:base` image
- ✅ Built example workflow image

## 🔨 What You Need to Do

### 1. Build All Component Images

The LangGraph MVP requires these images to be built and deployed:
- **Backend** (includes Postgres DB code)
- **Frontend**
- **Operator** (handles LangGraph workflow pods)
- **Runner** (legacy Claude runner)

```bash
# Build all images (using podman, targeting linux/amd64)
make build-all CONTAINER_ENGINE=podman PLATFORM=linux/amd64
```

### 2. Push Images to Registry

**Option A: Use Existing Images from quay.io/ambient_code**
- Skip building/pushing if you trust the existing images
- The deploy script uses `quay.io/ambient_code/*:latest` by default

**Option B: Build and Push Your Own**
```bash
# Set your registry
export REGISTRY="quay.io/gkrumbach07"

# Tag and push
make push-all CONTAINER_ENGINE=podman REGISTRY=$REGISTRY
```

### 3. Deploy to Cluster

```bash
# From project root
cd components/manifests

# Copy env file if first time
cp env.example .env

# Edit .env and set at least:
# - ANTHROPIC_API_KEY=your-key
# - (Optional) CONTAINER_REGISTRY if using custom images

# Deploy (from project root)
make deploy
```

The deploy script will:
- ✅ Check you're logged in (already done)
- ✅ Create namespace `ambient-code`
- ✅ Deploy Postgres (new!)
- ✅ Deploy Backend, Frontend, Operator
- ✅ Set up RBAC, CRDs, Routes

### 4. Verify Deployment

```bash
# Check pods
oc get pods -n ambient-code

# Wait for all pods to be Running
oc get pods -n ambient-code -w

# Check Postgres is running (NEW!)
oc get pods -n ambient-code | grep postgres

# Check services
oc get services -n ambient-code

# Get frontend route
oc get route frontend-route -n ambient-code
```

## 📝 Important Notes

1. **LangGraph Wrapper**: Already built and pushed to `quay.io/gkrumbach07/langgraph-wrapper:base` ✅
- This is the base image users extend for their workflows
- Doesn't need to be in Makefile - it's a separate concern

2. **Postgres**: Will be deployed automatically via `make deploy`
- New StatefulSet, Service, Secret, ConfigMap
- Backend connects to it automatically

3. **Cluster Login**: Already done ✅
- `oc whoami` shows `clusteradmin`
- `make deploy` will work

4. **Image Registry**:
- Default: Uses `quay.io/ambient_code/*:latest`
- Custom: Set `CONTAINER_REGISTRY` in `.env` or override in deploy script

## 🚀 Quick Start

```bash
# 1. Build images (if needed)
make build-all CONTAINER_ENGINE=podman PLATFORM=linux/amd64

# 2. Deploy everything
make deploy

# 3. Watch pods start
oc get pods -n ambient-code -w

# 4. Get frontend URL
oc get route frontend-route -n ambient-code
```

Loading
Loading