Getting started on Agentcore without the starter toolkit using Finch on macOS Apple Silicon
Overview
Finch is an open source tool for local container development.
The instructions on getting started on Bederock Agentcore without the Bedrock Agentcore Starter Toolkit uses docker commands and buildx for building cross platform images: Getting started without the starter toolkit. The recommended method of running buildx on MacOS is using Docker Desktop.
Currently Agentcore runtime requires ARM64 container builds these containers can be built natively on macOS Apple silicon without buildx.
This article will walkthrough how to use Finch on MacOS Apple silicon to configure, locally test, and deploy an agent to Bedrock Agentcore Runtime.
Instructions
Follow Getting Started without the Starter Toolkit Agentcore documentation as far as Build and deploy ARM64 image
Alternative Build for ARM64 and test locally instructions.
- build the image locally for testing instead of executing:
docker buildx build --platform linux/arm64 -t my-agent:arm64 --load .
use
finch build -t my-agent:arm64 .
- Test locally with credentials using finch
finch run --platform linux/arm64 -p 8080:8080 \
-e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
-e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
-e AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \
-e AWS_REGION="$AWS_REGION" \
my-agent:arm64
Create ECR repository and deploy
Deploying on ECR
The same instructions can be followed in creating the ECR
- Create an ECR repository:
aws ecr create-repository --repository-name my-strands-agent --region us-west-2
- Log in to ECR:
aws ecr get-login-password --region us-west-2 | finch login --username AWS --password-stdin account-id.dkr.ecr.us-west-2.amazonaws.com
- Build and push to ECR:
Rather than use the following docker and buildx instructions
docker buildx build --platform linux/arm64 -t account-id.dkr.ecr.region.amazonaws.com/my-strands-agent:latest --push .
This can be achieved using Finch:
finch build -t account-id.dkr.ecr.us-west-2.amazonaws.com/my-strands-agent:latest .
finch push account-id.dkr.ecr.us-west-2.amazonaws.com/my-strands-agent:latest
Deploy agent runtime and Invoke Agent
The instructions are the same from the section Deploy agent runtime