Last active
January 7, 2026 20:04
-
-
Save exinmusic/d6630e6c8c9629f0e496f84d33ba1247 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # AgentCore Deployment Script | |
| set -e | |
| # Configuration | |
| REGION="us-west-2" | |
| AGENT_NAME="AudioBookVisualizer" | |
| echo "Starting AgentCore deployment..." | |
| echo "Installing deployment dependencies..." | |
| pip3 install bedrock-agentcore-starter-toolkit boto3 --quiet | |
| echo "Configuring AgentCore Runtime..." | |
| agentcore configure \ | |
| --entrypoint entrypoint.py \ | |
| --name audio_book_visualizer \ | |
| --ecr < auto HERE WILL CREATE ECR OR ARN OF CREATED ECR HERE> \ | |
| --execution-role <EXECUTION ROLE GOES HERE> \ | |
| --disable-otel \ | |
| --disable-memory \ | |
| --requirements-file requirements.txt \ | |
| --non-interactive \ | |
| --region $REGION | |
| echo "Launching AgentCore Runtime..." | |
| agentcore launch | |
| echo "Waiting for deployment to complete..." | |
| # Poll status until deployment is complete | |
| ATTEMPTS=0 | |
| MAX_ATTEMPTS=30 | |
| while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do | |
| # Get the full status output and parse it more robustly | |
| STATUS_OUTPUT=$(agentcore status --agent audio_book_visualizer 2>/dev/null || echo "") | |
| if echo "$STATUS_OUTPUT" | grep -q "READY"; then | |
| echo "✅ AgentCore deployed successfully!" | |
| agentcore status --agent audio_book_visualizer | |
| break | |
| elif echo "$STATUS_OUTPUT" | grep -qE "(CREATE_FAILED|DELETE_FAILED|UPDATE_FAILED)"; then | |
| echo "❌ Deployment failed!" | |
| echo "$STATUS_OUTPUT" | |
| exit 1 | |
| elif echo "$STATUS_OUTPUT" | grep -qE "(CREATING|UPDATING|IN_PROGRESS)"; then | |
| echo "Status: Deployment in progress..." | |
| else | |
| echo "Status: Checking deployment status..." | |
| fi | |
| ATTEMPTS=$((ATTEMPTS + 1)) | |
| sleep 10 | |
| done | |
| if [ $ATTEMPTS -eq $MAX_ATTEMPTS ]; then | |
| echo "⚠️ Deployment status check timed out after 5 minutes" | |
| echo "Check deployment status manually with: agentcore status --agent audio_book_visualizer" | |
| fi | |
| echo "🎉 Deployment completed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment