ILL335 开发容器配置
ill335-devcontainer
准备并验证 ILL335 BYOD 开发容器。适用于开发容器、GitHub Codespaces、Docker 工作区设置、预构建、缓存构建、重建、容器启动、虚拟环境冲突或工作区依赖安装失败等场景。
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 23
- Forks
- 11
01 前言 Front Matter
- name
- ill335-devcontainer
- license
- MIT
- description
- Prepares and validates the ILL335 BYOD development container. Use for dev containers, GitHub Codespaces, Docker workspace setup, prebuilds, cached builds, rebuilds, container startup, virtual-environment conflicts, or workspace dependency installation failures.
02 资源文件 3
- 参考文档references/architecture.md11.4 KB
- 参考文档references/data.md10.9 KB
- 参考文档references/training.md13.2 KB
03 SKILL.md 正文
Prepare and Validate the ILL335 Development Container
Prepare the development workspace without authenticating to Azure or provisioning cloud resources. The development container does not change the hosted agent's direct-code deployment architecture.
Establish Scope
- Identify the delivery mode before giving setup commands. Managed Skillable learners use their provisioned VM and the Skillable guide, not this BYOD workflow.
- For BYOD, distinguish local VS Code with Docker from GitHub Codespaces. Docker is required locally, not on a learner's device when using Codespaces.
- Read the setup guide, container configuration, workspace hook, and test instructions.
- Inspect only relevant configuration. Never display
.env, credentials, connection strings, or authentication caches.
Preserve the Workspace Contract
- Use Python 3.13, the configured stable Azure CLI/azd toolchain, and explicit
installation of
microsoft.foundry,azure.ai.agents, andazure.ai.projects. Check published image and Feature tags before changing them; a Feature's version is not the installed CLI version. - Respect azure.yaml compatibility floors and the selected extensions' own CLI requirements. Do not change shared floors solely to match a local test machine.
- Keep installation in
updateContentCommandand retainwaitFor: updateContentCommand. Codespaces runs that hook during prebuilds;postCreateCommandis too late to cache its work in the prebuild snapshot. - Keep hooks non-interactive and fail on installation errors. Do not authenticate,
provision, deploy, register resource providers, copy host credentials, or
create/read
.envin a hook. - Install only the root requirements. Install the different agent requirements when the learner reaches Lab 6. Rerunning the workspace hook restores the main-lab pins.
- Reuse compatible virtual environments. If
.venvcomes from Windows/macOS or has an incompatible Python version, explain how to rename it before rebuilding; never delete it automatically. - Preserve LF endings for container shell scripts. Do not add an agent Dockerfile, container registry, or deployment infrastructure for this workspace feature.
Validate Locally
Run from the repository root using an available Python interpreter and Bash:
python -m unittest discover -s src/tests -p test_devcontainer.py -v
bash -n .devcontainer/post-create.sh
On Windows, use Git for Windows Bash if WSL is unavailable and set
BASH_EXECUTABLE for the hook tests. Use host-appropriate path separators.
For real container validation:
-
Check
docker infoand confirm the engine supports Linux containers. If it is unavailable, report build/startup validation as blocked, not passed. -
Use the Dev Containers extension or its available CLI. For an agent-run test, prefer an isolated copy of tracked and relevant non-ignored files, excluding
.env,.azure, host credentials, and existing virtual environments. -
Build and run the actual configuration. With the Dev Containers CLI:
devcontainer up --workspace-folder "<validation-workspace>" --prebuildThis exercises the lifecycle through
updateContentCommand; it is not a GitHub-hosted prebuild. -
Confirm the container is running and commands execute as the configured non-root user. Inside its workspace, activate
.venvand run:source .venv/bin/activate python --version az version azd version azd ext list python -m pip check python src/tests/validate_lab.py python -m unittest discover -s src/tests -p test_devcontainer.py -v -
Require all three Foundry extensions to be installed, no broken Python requirements, and passing offline checks. A missing
.envis an expected skip before Azure setup. Mocked hook tests do not replace this real build. -
Rebuild the image and inspect actual Docker
CACHEDsteps. Rerun the prebuild hook to verify environment reuse. Stop and restart only the test container; confirm normal startup does not rerun dependency installation. -
Report exact results and distinguish baseline failures from container regressions. Reproduce suspected pre-existing failures outside the container before attributing them. Do not make unrelated lab-code changes.
-
Remove only temporary containers/files created for validation. Retain useful image caches; never prune shared Docker resources.
Enable Codespaces Prebuilds
Follow the administrator instructions. Committing the container configuration does not enable hosted prebuilds. An administrator selects the branch, configuration, regions, and update trigger under repository Settings > Codespaces.
Explain GitHub Actions/storage costs before changing hosted prebuild settings. Do not add workflows without approval or put Azure credentials into prebuilds. Verify a successful GitHub-managed prebuild and a new codespace marked Prebuild ready before claiming hosted caching works. Docker cache hits alone prove only local image caching; local restart timings are not Codespaces startup benchmarks.
Diagnose the Smallest Failing Layer
| Failure | Next check |
|---|---|
| Image or Feature cannot be resolved | Verify the published tag, registry access, and target architecture. |
| Extension download returns HTTP 5xx | Record the failing public artifact/version, check reachability from inside the container, then retry the exact command once reachability recovers. Persistent failures remain blockers; do not hide them or downgrade arbitrarily. |
Existing .venv is incompatible |
Preserve it and explain renaming/rebuilding; do not reuse a host interpreter inside Linux. |
| Dependency resolution fails | Confirm the hook installs only root requirements; use the separate Lab 6 dependency step for agent work. |
| Installation is slow on a Windows bind mount | Check process progress before declaring a hang; distinguish host filesystem overhead from Codespaces performance. |
| No Prebuild ready option | Check administrator configuration, branch/configuration, region, and GitHub-managed workflow outcome. |
For Azure authentication, inference, or hosted-agent failures after workspace preparation, use ill335-troubleshooting. Never provision or make billable model calls merely to test the container.
04 同仓库更多 Skills
ILL335 故障排查
ill335-troubleshooting
诊断 ILL335 的设置、认证、依赖、Responses API、验证及托管智能体(hosted-agent)故障。当学习者报告错误、实验检查点失败、环境配置损坏、dev container 或 Codespaces 预构建失败、部署问题、速率限制、内容过滤或意外模型输出时使用。
ILL335 Responses API 实验支持
ill335-responses-api
支持 ILL335 模型推理以及使用 OpenAI Responses API 与 Microsoft Foundry 的情感分析实验。适用于实验 3-5、responses.create、output_text、previous_response_id、结构化 JSON、模型比较或 Responses API 错误。
ILL335 实验学习导航
ill335-lab-navigator
引导学习者完成 Frontier Tour ILL335:使用 Microsoft Foundry 构建和部署 AI 智能体。当学习者询问从哪里开始、接下来应完成哪个实验、各实验之间如何关联,或如何恢复研讨会时使用。
ILL335 托管智能体实验
ill335-hosted-agent
支持 ILL335 Microsoft Foundry 托管智能体(hosted-agent)实验。用于实验 6、Agent Framework、FoundryChatClient、ResponsesHostServer、直接代码部署、统一 azure.yaml、microsoft.foundry、本地就绪检查、azd up、azd deploy、智能体调用、评估生成或部署故障排查。