Repository navigation
Python: configure startup environment for foundry hosted samples - #9643
Shiva S (Shivakishore14) wants to merge 2 commits into
Conversation
Configure user-site loading before Python starts in deployment files, container images, and local sample instructions. Authored-by: GitHub Copilot CLI v1.0.102 Model: GPT-6.1 Sol (gpt-6.1-sol) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The proposed sample-wide default still needs maintainer agreement, and managed-runtime behavior has not been validated through a hosted deployment.
No open issues 🎉
What changed in this PR
This PR makes Python startup configuration explicit in Agent Framework’s Foundry hosting samples, covering deployed agents, direct container launches, and local development without changing runtime-library behavior.
Changes:
- Adds
PYTHONNOUSERSITE=1to 18 Dockerfiles, both sets of 18 deployment definitions, and Telegram’s direct-code service. - Documents shell-before-launch setup, dependency installation requirements, redeployment, and the setting’s limited scope.
- Extends the Telegram infrastructure test to check the exact environment-variable value.
Paths below are relative to python/samples/04-hosting/, except the consumer reference under skills/.
| File | Description |
|---|---|
skills/agent-framework-builder-python/references/hosting-and-deployment.md |
Adds consumer-facing startup guidance. |
foundry-hosted-agents/responses/workflows/README.md |
Configures local workflow launches. |
foundry-hosted-agents/responses/workflows/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/workflows/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/workflows/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/tools/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/tools/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/tools/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/steerable_long_running_agent/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/steerable_long_running_agent/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/steerable_long_running_agent/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/resilient_long_running_workflow/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/resilient_long_running_workflow/agent.yaml |
Adds deployment startup environment. |
foundry-hosted-agents/responses/resilient_long_running_workflow/agent.manifest.yaml |
Adds hosted-template startup environment. |
foundry-hosted-agents/responses/observability/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/observability/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/observability/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/monty_codeact/README.md |
Configures local script launches. |
foundry-hosted-agents/responses/monty_codeact/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/monty_codeact/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/monty_codeact/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/mcp/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/mcp/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/mcp/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/foundry_toolbox/README.md |
Configures local azd launches. |
foundry-hosted-agents/responses/foundry_toolbox/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/foundry_toolbox/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/foundry_toolbox/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/foundry_toolbox_mcp_skills/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/foundry_toolbox_mcp_skills/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/foundry_toolbox_mcp_skills/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/foundry_memory/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/foundry_memory/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/foundry_memory/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/files/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/files/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/files/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/declarative_customer_support/Dockerfile |
Sets startup environment in the final Python stage. |
foundry-hosted-agents/responses/declarative_customer_support/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/declarative_customer_support/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/custom_storage/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/custom_storage/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/custom_storage/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/basic/README.md |
Links shell-before-launch guidance. |
foundry-hosted-agents/responses/basic/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/basic/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/basic/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/responses/azure_search_rag/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/responses/azure_search_rag/agent.yaml |
Sets deployment startup environment. |
foundry-hosted-agents/responses/azure_search_rag/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/README.md |
Explains startup setup, scope, dependencies, and redeployment. |
foundry-hosted-agents/invocations/telegram/tests/test_infrastructure.py |
Asserts the exact startup environment entry. |
foundry-hosted-agents/invocations/telegram/azure.yaml |
Configures direct-code service startup. |
foundry-hosted-agents/invocations/break_glass/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/invocations/break_glass/agent.yaml |
Adds deployment startup environment. |
foundry-hosted-agents/invocations/break_glass/agent.manifest.yaml |
Sets hosted-template startup environment. |
foundry-hosted-agents/invocations/basic/README.md |
Configures local workflow launches. |
foundry-hosted-agents/invocations/basic/Dockerfile |
Sets image startup environment. |
foundry-hosted-agents/invocations/basic/agent.yaml |
Adds deployment startup environment. |
foundry-hosted-agents/invocations/basic/agent.manifest.yaml |
Sets hosted-template startup environment. |
container/hyperlight_codeact/README.md |
Adds startup guidance while preserving the hypervisor caveat. |
container/hyperlight_codeact/Dockerfile |
Sets image startup environment. |
container/hyperlight_codeact/agent.yaml |
Sets deployment startup environment. |
container/hyperlight_codeact/agent.manifest.yaml |
Sets hosted-template startup environment. |
Review effort: Balanced
Remove startup-variable shell exports and local command prerequisites. Preserve Dockerfile and deployment environment configuration. Authored-by: GitHub Copilot CLI v1.0.102 Model: GPT-6.1 Sol (gpt-6.1-sol) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Shiva S (@Shivakishore14) The Hyperlight Dockerfile at |
Motivation & Context
Make Python startup configuration explicit in the Foundry hosted-agent examples before the interpreter starts, through deployment environment configuration and Python Dockerfiles.
Description & Review Guide
PYTHONNOUSERSITEto the string"1"in all 18agent.yamlfiles, all 18 hosted manifest templates, the Telegram direct-code service, and all 18 Python Dockerfiles under the related hosting examples. Update shared deployment-environment guidance and the maintained Python consumer hosting reference. Extend the existing Telegram deployment assertion.pip install --user. Existing deployments need a newly deployed agent version. The Hyperlight example remains unsupported on the default Foundry runtime; its startup configuration does not change its hypervisor requirement. No .NET, runtime-library, dependency-manifest, or CLI minimum-version changes.git diff --check, new documentation links, dependency-installation path checks, and a local Python startup check passed. Verified the final PR adds no Python/uv command prefixes or startup-variable shell exports; deployment configuration remains unchanged by this revision. No cloud deployment was performed.Related Issue
No public issue is linked and no prior maintainer approval is claimed. This is a draft sample-configuration proposal for maintainer review; agreement on the proposed sample startup default is still needed.
AI Assistance
AI assistance details: GitHub Copilot CLI prepared the sample configuration, documentation, small regression assertion, local validation, and this description. This draft remains subject to author and maintainer review.
Contribution Checklist