Skip to content
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

#3332 add devcontainer #3520

Closed
wants to merge 13 commits into from
40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
paule96 marked this conversation as resolved.
Show resolved Hide resolved
{
"name": "C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just use the 8.0 SDK image here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main differences currently between the devcontainers image and the official dotnet SDK image is that

  • NuGet packages will get xmldocs in the devcontainers image (which we want), and
  • The devcontainers image includes Powershell Core

I think those are enough of a value-add (especially the XMLDocs) to justify using this base image.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Educate me -- why doesn't the SDK image get the xmldocs?

RE: Powershell -- easy add-on as a feature (which is in this as well)

No objections really either, just felt like the actual SDK image felt like a better base -- it's what I use exclusively and just add features.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Educate me -- why doesn't the SDK image get the xmldocs?

dotnet/dotnet-docker#2790

TLDR is "performance".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funnily enough, I was just going to the source and noticed that powershell core is already on the SDK images - so that removes one of the benefits of the devcontainers image. Kinda feels like we're all over the place with these images, thematically :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, noticed that too -- this devcontainer image looks to take a patch to the powershell also though, which i would expect the powershell feature latest to have also. Anyhow, thanks for the edu on the xmldocs -- seems odd our sdk image doesn't really match the sdk, but at least now I know!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems odd our sdk image doesn't really match the sdk

It was super surprising to me too when I learned this too. I understand the constraints and get it adds a lot of value to the "non-human-interactive" use cases. So it seems when a human is involved, its best to start with the dev container image.

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/dapr/cli/dapr-cli": {
"version": "1.12.0"
}
paule96 marked this conversation as resolved.
Show resolved Hide resolved
},
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.vscodeintellicode-csharp",
Copy link
Member

@timheuer timheuer Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend changing this to ms-dotnettools.csdevkit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there reasons to it? had the same recommendation from @baronfel.
Isn't the intellicode extension just the more advanced one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscodeintellicode-csharp
image
seemed we should install ms-dotnettools.csdevkit to keep it working

Copy link
Contributor Author

@paule96 paule96 May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you open the extension page in visual studio code you see it will install the C# extension by itself:

Image showing the dependencies of the IntelliCode extension including C# and C# DevKit extension

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WeihanLi It's the same like for the C# extension. That extension will install .NET Install Tool Extension.

"EditorConfig.EditorConfig"
]
}
},
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/home/vscode/.dapr/bin"
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// "portsAttributes": {
// "5001": {
// "protocol": "https"
// }
Comment on lines +28 to +30
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] please change tabs to spaces

Copy link
Contributor Author

@paule96 paule96 Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RussKie I had the same discussion earlier with @danmoseley here. And we agreed on doing it the same as the runtime team is doing. Is there any new information that was discussed internally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the file uses spaces, and this part uses tabs. It just looks inconsistent. That's all.

// }
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "dapr init"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,6 @@ node_modules/
/playground/**/.gitignore
/playground/**/azure.yaml
/playground/**/next-steps.md

# Ignore mono files on linux
.mono/
danmoseley marked this conversation as resolved.
Show resolved Hide resolved
37 changes: 34 additions & 3 deletions docs/machine-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,51 @@

Whether you want to contribute to Aspire, or just use the latest build of Aspire, these are the common pieces you need to install.

## (Windows) Install Visual Studio
## (Windows) Visual Studio

On Windows, Visual Studio contains special tooling support for .NET Aspire that you will want to have.

### Install Visual Studio

[Visual Studio 2022 version 17.9 Preview](https://visualstudio.microsoft.com/vs/preview/)

When you install, ensure that both:
* `ASP.NET and web development` Workload is checked.
* `.NET Aspire SDK` component in `Individual components` is checked.

## Install the latest .NET 8 SDK
### Install the latest .NET 8 SDK

[.NET 8 SDK](https://github.com/dotnet/installer#installers-and-binaries)

## Install Docker Desktop
### Install Docker Desktop

* [Windows](https://docs.docker.com/desktop/install/windows-install/)
* [MacOS X](https://docs.docker.com/desktop/install/mac-install/)
* [Linux](https://docs.docker.com/desktop/install/linux-install/)

## (Windows / Linux / Mac) DevContainer in VS Code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paule96 This would still be very useful to merge

cc @mitchdenny


On Windows you could also use VS Code with the DevContainers extension. This requieres that you have installed a container engine installed.
Currently it's only tested with Docker Desktop.

> Warning: This will use around 16GB of RAM, after you loaded the solution.
paule96 marked this conversation as resolved.
Show resolved Hide resolved

### Install VS Code with DevContainers Extension

* [VS Code](https://code.visualstudio.com/Download)
* [DevContainers Extension](https://marketplace.visualstudio.com/items?itemName=ms-VS Code-remote.remote-containers)

### Install Docker Desktop

* [Windows](https://docs.docker.com/desktop/install/windows-install/)
* [MacOS X](https://docs.docker.com/desktop/install/mac-install/)
* [Linux](https://docs.docker.com/desktop/install/linux-install/)

## (Browser) Codespaces

Just start the Codespaces in your fork. The initialisation of the code space takes around 5 mins. After that you can open the solution.
This will take on the free version of Codespace around 10 mins.

> Warning: With the free version of Codespaces the development experience is not nice. We recommend using at least a Codespace with 16GB of RAM or use your local VS Code / DevContainers instance.

Check failure on line 51 in docs/machine-requirements.md

View workflow job for this annotation

GitHub Actions / lint

Blank line inside blockquote
> Information: Currently the codespaces can not be used to try / debug the aspire dashboard. This is a known issue. If you want to debug it, use Visual Studio or your local VS Code and the DevContainers.
paule96 marked this conversation as resolved.
Show resolved Hide resolved
paule96 marked this conversation as resolved.
Show resolved Hide resolved
Loading