Skip to content

Commit 07aaf98

Browse files
author
Yuriy Bezsonov
committed
fix(java-spring-ai-agents): pass PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD to deployed runtime
The skip flag was only set in the local .envrc for spring-boot:run and was never propagated to the AgentCore Runtime, so the deployed container tried to download Playwright browsers and failed to start. Add the environment variable to every create/update-agent-runtime call that deploys the aiagent (which uses AgentCore Browser remotely).
1 parent 03f0245 commit 07aaf98

4 files changed

Lines changed: 6 additions & 0 deletions

File tree

apps/java-spring-ai-agents/demo-scripts/10-deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ aws bedrock-agentcore-control update-agent-runtime \
190190
--network-configuration "{\"networkMode\":\"VPC\",\"networkModeConfig\":{\"subnets\":[\"${SUBNET_ID}\"],\"securityGroups\":[\"${SG_ID}\"]}}" \
191191
--authorizer-configuration "{\"customJWTAuthorizer\":{\"discoveryUrl\":\"${AIAGENT_DISCOVERY_URL}\",\"allowedClients\":[\"${AIAGENT_CLIENT_ID}\"]}}" \
192192
--request-header-configuration '{"requestHeaderAllowlist":["Authorization"]}' \
193+
--environment-variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
193194
--region ${AWS_REGION} \
194195
--no-cli-pager
195196

apps/java-spring-ai-agents/scripts/08-aiagent-runtime.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ if [ "${EXISTING_RUNTIME_ID}" != "None" ] && [ -n "${EXISTING_RUNTIME_ID}" ]; th
186186
--network-configuration "{\"networkMode\":\"VPC\",\"networkModeConfig\":{\"subnets\":[\"${SUBNET_ID}\"],\"securityGroups\":[\"${SG_ID}\"]}}" \
187187
--authorizer-configuration "{\"customJWTAuthorizer\":{\"discoveryUrl\":\"${AIAGENT_DISCOVERY_URL}\",\"allowedClients\":[\"${AIAGENT_CLIENT_ID}\"]}}" \
188188
--request-header-configuration '{"requestHeaderAllowlist":["Authorization"]}' \
189+
--environment-variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
189190
--region ${AWS_REGION} \
190191
--no-cli-pager
191192

@@ -205,6 +206,7 @@ else
205206
--network-configuration "{\"networkMode\":\"VPC\",\"networkModeConfig\":{\"subnets\":[\"${SUBNET_ID}\"],\"securityGroups\":[\"${SG_ID}\"]}}" \
206207
--authorizer-configuration "{\"customJWTAuthorizer\":{\"discoveryUrl\":\"${AIAGENT_DISCOVERY_URL}\",\"allowedClients\":[\"${AIAGENT_CLIENT_ID}\"]}}" \
207208
--request-header-configuration '{"requestHeaderAllowlist":["Authorization"]}' \
209+
--environment-variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
208210
--region ${AWS_REGION} \
209211
--no-cli-pager \
210212
--query 'agentRuntimeId' --output text)

apps/java-spring-ai-agents/scripts/12-aiagent-redeploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ aws bedrock-agentcore-control update-agent-runtime \
6363
--network-configuration "{\"networkMode\":\"VPC\",\"networkModeConfig\":{\"subnets\":[\"${SUBNET_ID}\"],\"securityGroups\":[\"${SG_ID}\"]}}" \
6464
--authorizer-configuration "{\"customJWTAuthorizer\":{\"discoveryUrl\":\"${AIAGENT_DISCOVERY_URL}\",\"allowedClients\":[\"${AIAGENT_CLIENT_ID}\"]}}" \
6565
--request-header-configuration '{"requestHeaderAllowlist":["Authorization"]}' \
66+
--environment-variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
6667
--region ${AWS_REGION} \
6768
--no-cli-pager
6869

apps/java-spring-ai-agents/scripts/aiagent-runtime.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ if [ "${EXISTING_RUNTIME_ID}" != "None" ] && [ -n "${EXISTING_RUNTIME_ID}" ]; th
201201
--agent-runtime-artifact "{\"containerConfiguration\":{\"containerUri\":\"${ECR_URI}:latest\"}}" \
202202
--network-configuration "{\"networkMode\":\"VPC\",\"networkModeConfig\":{\"subnets\":[\"${SUBNET_ID}\"],\"securityGroups\":[\"${SG_ID}\"]}}" \
203203
${AUTH_ARGS} \
204+
--environment-variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
204205
--region ${AWS_REGION} \
205206
--no-cli-pager
206207

@@ -219,6 +220,7 @@ else
219220
--agent-runtime-artifact "{\"containerConfiguration\":{\"containerUri\":\"${ECR_URI}:latest\"}}" \
220221
--network-configuration "{\"networkMode\":\"VPC\",\"networkModeConfig\":{\"subnets\":[\"${SUBNET_ID}\"],\"securityGroups\":[\"${SG_ID}\"]}}" \
221222
${AUTH_ARGS} \
223+
--environment-variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 \
222224
--region ${AWS_REGION} \
223225
--no-cli-pager \
224226
--query 'agentRuntimeId' --output text)

0 commit comments

Comments
 (0)