diff --git a/examples/aws-agentcore/agents/pipecat/scripts/configure.sh b/examples/aws-agentcore/agents/pipecat/scripts/configure.sh new file mode 100755 index 000000000..cbd70d9da --- /dev/null +++ b/examples/aws-agentcore/agents/pipecat/scripts/configure.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Script to configure the bot and add the extra dependencies +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" + +# 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 +while [ ! -s "$DOCKERFILE" ]; do + sleep 0.2 +done + +# Create backup +cp "$DOCKERFILE" "$DOCKERFILE.bak" + +# Insert the line after the target +awk -v target="$TARGET_LINE" -v insert="$INSERT_LINE" ' +{ + print $0 + if ($0 ~ target) { + print insert + } +} +' "$DOCKERFILE.bak" > "$DOCKERFILE" + +echo "Dockerfile patched successfully!" diff --git a/examples/aws-agentcore/agents/pipecat/scripts/launch.sh b/examples/aws-agentcore/agents/pipecat/scripts/launch.sh index dfef1a66c..f3f676a3a 100755 --- a/examples/aws-agentcore/agents/pipecat/scripts/launch.sh +++ b/examples/aws-agentcore/agents/pipecat/scripts/launch.sh @@ -1,4 +1,3 @@ - #!/bin/bash # Script to dynamically read all variables from .env file and launch agentcore