Skip to content

feat: cleanup caipe scripts and better error handling#77

Merged
sriaradhyula merged 1 commit intocnoe-io:mainfrom
sriaradhyula:caipe-script-fix
Oct 24, 2025
Merged

feat: cleanup caipe scripts and better error handling#77
sriaradhyula merged 1 commit intocnoe-io:mainfrom
sriaradhyula:caipe-script-fix

Conversation

@suwhang-cisco
Copy link
Copy Markdown
Contributor

Much neater logs and indentations. Also better error handling for fetching vault secrets.

Example output when running setup-all.sh:

outshift> $HOME/work/stacks/caipe/scripts/setup-all.sh --envFile $HOME/.env_vars
[2025-10-24 16:44:18] [1/4] Running setup-llm-credentials.sh...
[2025-10-24 16:44:18] 🔧 Setting up LLM credentials for AI Platform Engineering
[2025-10-24 16:44:18] [Step 1/4] Starting Vault port forward...
[2025-10-24 16:44:21]   - Loading environment variables from: /home/ubuntu/.env_vars
[2025-10-24 16:44:21] [Step 2/4] Setting up LLM credentials...
[2025-10-24 16:44:21]   - Using provider from env file: azure-openai
[2025-10-24 16:44:21]   - Note: Sensitive credentials will not be displayed on screen
[2025-10-24 16:44:21]   - Loading environment variables from: /home/ubuntu/.env_vars
[2025-10-24 16:44:21]   ✓ Using existing value detected for Azure OpenAI API Key in env file. Auto-populating...
[2025-10-24 16:44:21]   ✓ Using existing value detected for Azure OpenAI Endpoint in env file. Auto-populating...
[2025-10-24 16:44:21]   ✓ Using existing value detected for Azure OpenAI API Version in env file. Auto-populating...
[2025-10-24 16:44:21]   ✓ Using existing value detected for Azure OpenAI Deployment Name in env file. Auto-populating...
[2025-10-24 16:44:21] [Step 3/4] Storing credentials in Vault...
[2025-10-24 16:44:21]   - ✅ LLM credentials successfully stored in Vault
[2025-10-24 16:44:21]   - 🔗 You can verify at: https://vault.cnoe.localtest.me:8443/ui/vault/secrets/secret/kv/ai-platform-engineering%2Fglobal
[2025-10-24 16:44:21] [Step 4/4] Cleanup completed
[2025-10-24 16:44:21] [2/4] Running setup-agent-secrets.sh...
[2025-10-24 16:44:21] 🔧 Setting up agent secrets based on active agents
[2025-10-24 16:44:22] [Step 1/5] Starting Vault port forward...
[2025-10-24 16:44:25] [Step 2/5] Checking for active agents using kubectl command...
[2025-10-24 16:44:26]   List of detected active agents: github argocd backstage
[2025-10-24 16:44:26] [Step 3/5] Configuring secrets for active agents found in Step 2
[2025-10-24 16:44:26]   - Note: Sensitive credentials will not be displayed on screen
[2025-10-24 16:44:26]   - 📄 Loading environment variables from: /home/ubuntu/.env_vars
[2025-10-24 16:44:26]   - Configuring GitHub agent secrets...
[2025-10-24 16:44:26]   - Configuring ArgoCD agent secrets...
[2025-10-24 16:44:26]     └─> Using existing ArgoCD Token from Vault
[2025-10-24 16:44:26]     └─> Using existing ArgoCD API URL from Vault
[2025-10-24 16:44:26]     └─> Using existing ArgoCD Verify SSL setting from Vault
[2025-10-24 16:44:26]   - Configuring Backstage agent secrets...
[2025-10-24 16:44:26]     └─> Using existing Backstage API Token from Vault
[2025-10-24 16:44:26]     └─> Using existing Backstage URL from Vault
[2025-10-24 16:44:26] [Step 4/5] Storing agent secrets in Vault...
[2025-10-24 16:44:26]   - ✅ GitHub secrets stored
[2025-10-24 16:44:26]   - ✅ ArgoCD secrets stored
[2025-10-24 16:44:26]   - ✅ Backstage secrets stored
[2025-10-24 16:44:26]   - Configured agents: github,argocd,backstage
[2025-10-24 16:44:26]   - 🔗 You can verify individual agent secrets at the Vault UI: https://vault.cnoe.localtest.me:8443/ui/vault/secrets/secret/kv/list/ai-platform-engineering/
[2025-10-24 16:44:26] [Step 5/5] Cleanup completed
[2025-10-24 16:44:26] [3/4] Waiting 2 seconds before refreshing secrets...
[2025-10-24 16:44:28] [4/4] Running refresh-secrets.sh...
[2025-10-24 16:44:28] [Step 1/5] Starting AI Platform Engineering cleanup process...
[2025-10-24 16:44:28] [Step 2/5] Deleting all secrets in ai-platform-engineering namespace...
[2025-10-24 16:44:28] [Step 3/5] Waiting 1 second for cleanup to complete...
[2025-10-24 16:44:29] [Step 4/5] Deleting all pods in ai-platform-engineering namespace...
[2025-10-24 16:44:32] [Step 5/5] Sleep for 5s to wait for the new pods to get ready
[2025-10-24 16:44:37] All pods are running 🎉
[2025-10-24 16:44:37] ✅ All scripts completed successfully

Signed-off-by: suwhang-cisco <suwhang@cisco.com>
@suwhang-cisco suwhang-cisco marked this pull request as ready for review October 24, 2025 16:45
@sriaradhyula sriaradhyula merged commit 4571105 into cnoe-io:main Oct 24, 2025
2 checks passed
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.

2 participants