Script for configuring the agent.
This commit is contained in:
30
examples/aws-agentcore/agents/pipecat/scripts/configure.sh
Executable file
30
examples/aws-agentcore/agents/pipecat/scripts/configure.sh
Executable file
@@ -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!"
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
# Script to dynamically read all variables from .env file and launch agentcore
|
||||
|
||||
Reference in New Issue
Block a user