-
Notifications
You must be signed in to change notification settings - Fork 36
Multi-container setup for agent -> MCP server networking #11
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 5 commits
2234cb6
a5902fe
8f0ce4f
58afb4c
7467d92
85a17c1
f3a11c0
d4a8c62
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,15 @@ | ||
| .azure | ||
| .venv | ||
| .logfire | ||
| .devcontainer | ||
| infra | ||
|
|
||
| # Common Python and development files to exclude | ||
| __pycache__ | ||
| *.pyc | ||
| *.pyo | ||
| *.egg-info | ||
| .pytest_cache | ||
| .ruff_cache | ||
| .env | ||
| .git | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # ------------------- Stage 1: Build Stage ------------------------------ | ||
| # We use Alpine for smaller image size (~329MB vs ~431MB for Debian slim). | ||
| # Trade-off: We must install build tools to compile native extensions (cryptography, etc.) | ||
| # since pre-built musl wheels aren't available. Debian -slim would skip compilation | ||
| # but produces a larger final image due to glibc wheel sizes. | ||
| FROM python:3.13-alpine AS build | ||
|
|
||
| # Install build dependencies for packages with native extensions (cryptography, etc.) | ||
| # https://cryptography.io/en/latest/installation/#building-cryptography-on-linux | ||
| RUN apk add --no-cache gcc g++ musl-dev python3-dev libffi-dev openssl-dev cargo pkgconfig | ||
|
|
||
| COPY --from=ghcr.io/astral-sh/uv:0.9.14 /uv /uvx /bin/ | ||
|
|
||
| WORKDIR /code | ||
|
|
||
| # Copy dependency files and install dependencies (for layer caching) | ||
| # Note: We can't use --mount=type=cache since Azure Container Apps remote build doesn't support BuildKit: | ||
| # https://github.com/Azure/acr/issues/721 | ||
| COPY uv.lock pyproject.toml ./ | ||
| RUN uv sync --locked --no-install-project | ||
|
|
||
| # Copy the project and sync | ||
| COPY . . | ||
| RUN uv sync --locked | ||
|
|
||
| # ------------------- Stage 2: Final Stage ------------------------------ | ||
| FROM python:3.13-alpine AS final | ||
|
|
||
| RUN addgroup -S app && adduser -S app -G app | ||
|
|
||
| COPY --from=build --chown=app:app /code /code | ||
|
|
||
| WORKDIR /code/agents | ||
| USER app | ||
|
|
||
| ENV PATH="/code/.venv/bin:$PATH" | ||
|
|
||
| ENTRYPOINT ["python", "agentframework_http.py"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,15 +3,24 @@ | |
| name: python-mcp-demo | ||
| metadata: | ||
| template: [email protected] | ||
|
|
||
| services: | ||
| # Not using remoteBuild due to private endpoint usage | ||
| aca: | ||
| server: | ||
| project: . | ||
| language: docker | ||
| host: containerapp | ||
| docker: | ||
| remoteBuild: true | ||
| path: ./servers/Dockerfile | ||
| context: . | ||
| agent: | ||
| project: . | ||
| language: docker | ||
| host: containerapp | ||
| docker: | ||
| remoteBuild: true | ||
| path: ./agents/Dockerfile | ||
| context: . | ||
pamelafox marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hooks: | ||
| postprovision: | ||
| posix: | ||
|
|
@@ -21,4 +30,4 @@ hooks: | |
| windows: | ||
| shell: pwsh | ||
| run: ./infra/write_env.ps1 | ||
| continueOnError: true | ||
| continueOnError: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,21 @@ module containerAppsEnvironment 'br/public:avm/res/app/managed-environment:0.11. | |
| location: location | ||
| tags: tags | ||
| zoneRedundant: false | ||
| publicNetworkAccess: 'Enabled' | ||
| publicNetworkAccess: usePrivateIngress ? 'Disabled' : 'Enabled' | ||
| workloadProfiles: usePrivateIngress | ||
| ? [ | ||
| { | ||
| name: 'Consumption' | ||
| workloadProfileType: 'Consumption' | ||
| } | ||
| { | ||
| name: 'Warm' | ||
| workloadProfileType: 'D4' | ||
| minimumCount: 1 | ||
| maximumCount: 3 | ||
| } | ||
| ] | ||
| : [] | ||
|
Comment on lines
+30
to
+43
|
||
| appLogsConfiguration: useLogging | ||
| ? { | ||
| destination: 'log-analytics' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.