Skip to content

Commit cf7be84

Browse files
kabirclaude
andcommitted
feat: Add SKIP_AGENT_DEPLOY env var for CI image loading
Added SKIP_AGENT_DEPLOY environment variable to deploy.sh to allow skipping agent deployment. This enables the GitHub Actions workflow to: 1. Run deploy.sh with SKIP_AGENT_DEPLOY=true to deploy infrastructure only 2. Load the image into minikube's cache (avoiding registry networking issues) 3. Deploy the agent separately after image is loaded This approach: - Avoids the 120s timeout waiting for pods that can't pull images - Keeps deploy.sh unchanged for local development - Provides clean separation between infrastructure and agent deployment in CI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a515ff2 commit cf7be84

File tree

2 files changed

+27
-36
lines changed

2 files changed

+27
-36
lines changed

.github/workflows/cloud-deployment-example.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,34 @@ jobs:
3838
- name: Build project
3939
run: mvn -B clean install -DskipTests -f pom.xml
4040

41-
- name: Deploy stack
41+
- name: Deploy infrastructure (skip agent)
4242
working-directory: examples/cloud-deployment/scripts
43+
env:
44+
SKIP_AGENT_DEPLOY: "true"
4345
run: |
4446
chmod +x deploy.sh
4547
./deploy.sh
4648
47-
- name: Load image into minikube
49+
- name: Load image into minikube and deploy agent
50+
working-directory: examples/cloud-deployment
4851
run: |
4952
# Pull from local registry and load into minikube
53+
echo "Loading image into minikube..."
5054
docker pull localhost:5001/a2a-cloud-deployment:latest
5155
minikube image load localhost:5001/a2a-cloud-deployment:latest
5256
53-
# Also tag with the registry path K8s is trying to pull
57+
# Tag with the registry path K8s is trying to pull
5458
minikube ssh -- docker tag localhost:5001/a2a-cloud-deployment:latest 192.168.49.1:5001/a2a-cloud-deployment:latest
5559
5660
# Verify image is in minikube
57-
echo "Images in minikube:"
58-
minikube image ls | grep a2a-cloud-deployment || echo "Image not found in list"
61+
echo "Verifying image in minikube:"
62+
minikube ssh -- docker images | grep a2a-cloud-deployment
5963
60-
# Restart the deployment to pick up the loaded image
61-
kubectl rollout restart deployment/a2a-agent -n a2a-demo
64+
# Now deploy the agent
65+
echo "Deploying agent..."
66+
kubectl apply -f k8s/04-agent-deployment.yaml
67+
68+
echo "Waiting for agent pods to be ready..."
6269
kubectl wait --for=condition=Ready pod -l app=a2a-agent -n a2a-demo --timeout=120s
6370
6471
- name: Verify deployment

examples/cloud-deployment/scripts/deploy.sh

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -218,36 +218,20 @@ kubectl apply -f ../k8s/03-agent-configmap.yaml
218218
echo -e "${GREEN}✓ ConfigMap deployed${NC}"
219219

220220
# Deploy Agent
221-
echo ""
222-
echo "Deploying A2A Agent..."
223-
kubectl apply -f ../k8s/04-agent-deployment.yaml
224-
225-
# --- DIAGNOSTIC START ---
226-
echo ""
227-
echo "--- DIAGNOSTIC INFORMATION FOR AGENT DEPLOYMENT ---"
228-
echo "Checking Docker images in Minikube's daemon..."
229-
minikube ssh -- docker images | grep a2a-cloud-deployment || true
230-
231-
echo ""
232-
echo "Describing agent pods (if any created)..."
233-
kubectl get pods -n a2a-demo -l app=a2a-agent -o wide || true
234-
for pod in $(kubectl get pods -n a2a-demo -l app=a2a-agent -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
235-
echo "--- Describing pod: $pod ---"
236-
kubectl describe pod $pod -n a2a-demo || true
237-
echo "--- Logs for pod: $pod ---"
238-
kubectl logs $pod -n a2a-demo --tail=50 || true
239-
done
240-
241-
echo ""
242-
echo "Checking Kubernetes events in a2a-demo namespace..."
243-
kubectl get events -n a2a-demo --sort-by='.lastTimestamp' || true
244-
echo "--- END DIAGNOSTIC INFORMATION ---"
245-
echo ""
246-
# --- DIAGNOSTIC END ---
221+
if [ "${SKIP_AGENT_DEPLOY}" != "true" ]; then
222+
echo ""
223+
echo "Deploying A2A Agent..."
224+
kubectl apply -f ../k8s/04-agent-deployment.yaml
247225

248-
echo "Waiting for Agent pods to be ready..."
249-
kubectl wait --for=condition=Ready pod -l app=a2a-agent -n a2a-demo --timeout=120s
250-
echo -e "${GREEN}✓ Agent deployed${NC}"
226+
echo "Waiting for Agent pods to be ready..."
227+
kubectl wait --for=condition=Ready pod -l app=a2a-agent -n a2a-demo --timeout=120s
228+
echo -e "${GREEN}✓ Agent deployed${NC}"
229+
else
230+
echo ""
231+
echo -e "${YELLOW}⚠ Skipping agent deployment (SKIP_AGENT_DEPLOY=true)${NC}"
232+
echo " ConfigMap has been deployed, you can manually deploy the agent with:"
233+
echo " kubectl apply -f ../k8s/04-agent-deployment.yaml"
234+
fi
251235

252236
echo ""
253237
echo -e "${GREEN}=========================================${NC}"

0 commit comments

Comments
 (0)