-
Notifications
You must be signed in to change notification settings - Fork 72
feat(project): implement resolve() + container template on FsTreeNode #1946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| FROM public.ecr.aws/docker/library/python:3.12-slim-trixie | ||
|
|
||
| RUN pip install --no-cache-dir uv | ||
|
|
||
| ARG UV_DEFAULT_INDEX | ||
| ARG UV_INDEX | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| ENV UV_SYSTEM_PYTHON=1 \ | ||
| UV_COMPILE_BYTECODE=1 \ | ||
| UV_NO_PROGRESS=1 \ | ||
| PYTHONUNBUFFERED=1 \ | ||
| DOCKER_CONTAINER=1 \ | ||
| UV_DEFAULT_INDEX=${UV_DEFAULT_INDEX} \ | ||
| UV_INDEX=${UV_INDEX} \ | ||
| PATH="/app/.venv/bin:$PATH" | ||
|
|
||
| RUN useradd -m -u 1000 bedrock_agentcore | ||
|
|
||
| # Install dependencies first so code changes don't invalidate the layer. | ||
| COPY pyproject.toml uv.lock ./ | ||
| RUN uv sync --frozen --no-dev --no-install-project | ||
|
|
||
| COPY --chown=bedrock_agentcore:bedrock_agentcore . . | ||
| RUN uv sync --frozen --no-dev | ||
|
|
||
| USER bedrock_agentcore | ||
|
|
||
| # AgentCore Runtime service contract ports | ||
| # https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-service-contract.html | ||
| # 8080: HTTP Mode | ||
| # 8000: MCP Mode | ||
| # 9000: A2A Mode | ||
| EXPOSE 8080 8000 9000 | ||
|
|
||
| CMD ["python", "-m", "main"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # hello-world | ||
|
|
||
| An AgentCore Runtime agent built with the [Strands](https://strandsagents.com) | ||
| SDK. Scaffolded by `agentcore project create`. | ||
|
|
||
| ## Layout | ||
|
|
||
| - `main.py` — the agent: a `BedrockAgentCoreApp` entrypoint that streams | ||
| responses from a Strands `Agent`. | ||
| - `pyproject.toml` — dependencies, installed with [uv](https://docs.astral.sh/uv/). | ||
|
|
||
| ## Develop | ||
|
|
||
| Run the agent locally from the project root: | ||
|
|
||
| ```bash | ||
| agentcore project dev | ||
| ``` | ||
|
|
||
| Environment variables for local development go in `agentcore/.env.local` | ||
| (gitignored). | ||
|
|
||
| ## Deploy | ||
|
|
||
| ```bash | ||
| agentcore project deploy | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *.egg-info/ | ||
| .venv/ | ||
| dist/ | ||
| build/ | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
| # Testing | ||
| .pytest_cache/ | ||
| .coverage | ||
| htmlcov/ | ||
|
|
||
| # Secrets and environment files | ||
| .env | ||
| .env.* | ||
|
|
||
| # Version control | ||
| .git/ | ||
|
|
||
| # AgentCore build artifacts | ||
| .agentcore/artifacts/ | ||
| *.zip |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from bedrock_agentcore.runtime import BedrockAgentCoreApp | ||
| from strands import Agent | ||
|
|
||
| app = BedrockAgentCoreApp() | ||
| agent = Agent(system_prompt="You are a helpful assistant.") | ||
|
|
||
|
|
||
| @app.entrypoint | ||
| async def invoke(payload, context): | ||
| """Stream the agent's response to the caller's prompt.""" | ||
| prompt = payload.get("prompt", "Hello!") | ||
| async for event in agent.stream_async(prompt): | ||
| yield event | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| app.run() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [project] | ||
| name = "hello-world" | ||
| version = "0.1.0" | ||
| description = "AgentCore Runtime application using the Strands SDK" | ||
| readme = "README.md" | ||
| requires-python = ">=3.10" | ||
| dependencies = [ | ||
| "aws-opentelemetry-distro", | ||
| "bedrock-agentcore >= 1.9.1", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we set this version a little higher? |
||
| "botocore[crt] >= 1.35.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we set this version a little higher? |
||
| "strands-agents >= 1.15.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we set this version a little higher? |
||
| ] | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["."] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Environment variables for local development. | ||
| # `agentcore dev` loads this file into your agent's process. Values here | ||
| # override anything the CLI injects. This file is gitignored — keep secrets | ||
| # out of version control, but they are safe here. | ||
| # | ||
| # Example: | ||
| # MY_API_KEY=... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Local environment (loaded by `agentcore dev`; never commit secrets) | ||
| .env.local | ||
| .env*.local | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| .venv/ | ||
|
|
||
| # Node | ||
| node_modules/ | ||
|
|
||
| # AgentCore CLI state | ||
| agentcore/.cli/ | ||
|
|
||
| # CDK | ||
| agentcore/cdk/cdk.out/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you apply stripping_tool_use function to the request? We had a sev2 about this issue. https://github.com/aws/agentcore-cli/pull/1898/changes