Improving the script to configure the bot

This commit is contained in:
Filipi Fuchter
2025-12-01 07:23:51 -03:00
parent 9c8192b505
commit 6b0194daf1

View File

@@ -1,23 +1,30 @@
#!/bin/bash
# Script to configure the bot and add the extra dependencies
# Script to configure the bot, patch Dockerfile and sync AGENT_RUNTIME_ARN
DOCKERFILE=".bedrock_agentcore/pipecat_agent/Dockerfile"
TARGET_LINE="RUN uv pip install -r requirements.txt"
# Extra dependencies needed by SmallWebRTC
INSERT_LINE="RUN apt update && apt install -y libgl1 libglib2.0-0 && apt clean"
###############################################
# STEP 1 — Configure agentcore
# Already configuring to use Docker as it is required by Pipecat
###############################################
agentcore configure -e pipecat-agent.py --deployment-type container --container-runtime docker
# Wait until the Dockerfile exists and is non-empty
###############################################
# STEP 2 — Wait until Dockerfile exists
###############################################
while [ ! -s "$DOCKERFILE" ]; do
sleep 0.2
done
# Create backup
###############################################
# STEP 3 — Patch Dockerfile
###############################################
cp "$DOCKERFILE" "$DOCKERFILE.bak"
# Insert the line after the target
awk -v target="$TARGET_LINE" -v insert="$INSERT_LINE" '
{
print $0