Add GitHub Codespaces support with pre-configured starting solution#211
Add GitHub Codespaces support with pre-configured starting solution#211
Conversation
Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com>
Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com>
Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com>
Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive GitHub Codespaces support to the .NET AI Workshop, enabling users to run the entire lab in the cloud without local Docker or .NET SDK installation. The changes include moving devcontainer configurations to .devcontainer/ for Codespaces compatibility, creating a pre-configured starting solution in src/start/, updating documentation to highlight the Codespaces option, and integrating the starting solution into the CI/CD pipeline.
Key Changes:
- Relocated devcontainer configurations from
.github/.devcontainer/to.devcontainer/for GitHub Codespaces support - Added a complete starting solution (
src/start/GenAiLab/) that mirrors the Part 2 project structure - Updated all workshop documentation to reference Codespaces as a quick-start option
- Integrated starting solution into GitHub Actions CI workflow
Reviewed Changes
Copilot reviewed 64 out of 75 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.devcontainer/devcontainer.json |
Standard Codespaces configuration with .NET 9.0, Docker-in-Docker, and Azure CLI |
.devcontainer/Ollama/devcontainer.json |
Alternative Codespaces configuration with local Ollama AI models |
.devcontainer/README.md |
Comprehensive Codespaces setup and usage documentation |
src/start/README.md |
Documentation for the pre-configured starting solution |
src/start/GenAiLab/ |
Complete starting solution mirroring Part 2 project structure |
CODESPACES.md |
Quick start guide for Codespaces users |
README.md |
Updated main README with Codespaces quick start section |
Part 1 - Setup/README.md |
Added Codespaces as primary setup option |
Part 2 - Project Creation/README.md |
Updated to allow skipping project creation when using Codespaces |
.github/workflows/dotnet-build.yml |
Added CI validation for starting solution |
.github/.devcontainer/README.md |
Added location notice pointing to new devcontainer path |
| https://github.com/markedjs/marked | ||
| License: MIT | ||
|
|
||
| To update, replace the `dist/marked.esm.js` file with with an updated version from https://www.npmjs.com/package/marked. |
There was a problem hiding this comment.
Corrected spelling of 'with' (duplicate word removed).
| To update, replace the `dist/marked.esm.js` file with with an updated version from https://www.npmjs.com/package/marked. | |
| To update, replace the `dist/marked.esm.js` file with an updated version from https://www.npmjs.com/package/marked. |
| "postCreateCommand": "sudo dotnet workload update && dotnet new install Microsoft.Extensions.AI.Templates && cd src/start/GenAiLab && dotnet restore", | ||
| "postStartCommand": "", |
There was a problem hiding this comment.
The postCreateCommand chains multiple operations with &&. If any intermediate command fails, subsequent commands won't execute, but the container will still be created. Consider using postCreateCommand for critical setup only and moving optional operations to postStartCommand or using ; instead of && to ensure container creation succeeds even if non-critical commands fail.
| "postCreateCommand": "sudo dotnet workload update && dotnet new install Microsoft.Extensions.AI.Templates && cd src/start/GenAiLab && dotnet restore", | |
| "postStartCommand": "", | |
| "postCreateCommand": "sudo dotnet workload update && dotnet new install Microsoft.Extensions.AI.Templates", | |
| "postStartCommand": "cd src/start/GenAiLab && dotnet restore", |
| "postCreateCommand": "sudo dotnet workload update && dotnet new install Microsoft.Extensions.AI.Templates && ollama pull all-minilm && ollama pull llama3.2 && ollama pull phi4-mini && cd src/start/GenAiLab && dotnet restore", | ||
| "postStartCommand": "", |
There was a problem hiding this comment.
The postCreateCommand chains multiple operations with &&. If any intermediate command fails (e.g., ollama pull due to network issues), subsequent commands won't execute, but the container will still be created. Consider using postCreateCommand for critical setup only and moving optional operations to postStartCommand or using ; instead of && to ensure container creation succeeds even if non-critical commands fail.
| "postCreateCommand": "sudo dotnet workload update && dotnet new install Microsoft.Extensions.AI.Templates && ollama pull all-minilm && ollama pull llama3.2 && ollama pull phi4-mini && cd src/start/GenAiLab && dotnet restore", | |
| "postStartCommand": "", | |
| "postCreateCommand": "sudo dotnet workload update && dotnet new install Microsoft.Extensions.AI.Templates && cd src/start/GenAiLab && dotnet restore", | |
| "postStartCommand": "ollama pull all-minilm; ollama pull llama3.2; ollama pull phi4-mini", |
Co-authored-by: jongalloway <68539+jongalloway@users.noreply.github.com>
Overview
This PR adds full GitHub Codespaces support to the .NET AI Workshop, enabling users to run the entire lab without any local installation. This addresses users who can't install Docker, face corporate firewall restrictions, or simply want to get started immediately.
What's New
🚀 GitHub Codespaces Integration
Users can now click the "Open in GitHub Codespaces" badge and have a fully configured development environment ready in 3-5 minutes. No need to install:
📦 Pre-Configured Starting Solution
A ready-to-run starting solution is available in
src/start/GenAiLab/that mirrors the Part 2 project. Users can:This is especially valuable for workshop attendees who encounter setup issues or time constraints.
🎨 Two Configuration Options
Standard Configuration (
.devcontainer/devcontainer.json)Ollama Configuration (
.devcontainer/Ollama/devcontainer.json)Key Features
Documentation Updates
Implementation Details
The implementation follows Microsoft Learn's .NET Aspire Dev Containers guidance, placing devcontainer configurations in the repository root (
.devcontainer/) as required by GitHub Codespaces.Build Verification
All solutions build successfully:
Files Changed
.devcontainer/,src/start/Benefits
Testing
Manual testing in an actual GitHub Codespaces environment is recommended to validate:
This enhancement makes the workshop significantly more accessible while maintaining full compatibility with local development workflows.
Original prompt
Fixes #209
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.