-
Notifications
You must be signed in to change notification settings - Fork 453
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
#3332 add devcontainer #3520
Conversation
There is also the issue, that for the playground things to work, you need to set in the |
@eerhardt you did the codespaces for dotnet/runtime. Does this look reasonable? |
As far as prebuild, I think (?) after this goes in I just go switch it on? |
docs/machine-requirements.md
Outdated
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 Codesapce 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 VSCode / DevContainers instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a setting somewhere that I can use to increase this (billed to the .NET foundation..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how it works for members of the .NET foundation or Microsoft employees. But for people like me you get billed for it or you don't use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember right, we can simply add as dotnet org members folks like you who want to use this. Then the foundation pays.
Overall this looks good. To allow for debugging of playground apps additional considerations would need to be applied :
Rest looks good to me. CC: @baronfel for additional review. |
.devcontainer/devcontainer.json
Outdated
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-dotnettools.vscodeintellicode-csharp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this extension instead of just devkit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it installs the devkit and you get better autocomplete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.devcontainer/devcontainer.json
Outdated
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/powershell:1": {}, | ||
"ghcr.io/dapr/cli/dapr-cli": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the dapr-cli? It should only be needed if someone is actually working on the dapr extension/playground app, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I agree. This is for me a big question mark too. On the other hand, should someone who wants to contribute, think about that stuff, or should it be just there?
I mean that's the nice thing about devcontainers that you can just start developing, because someone else took care of installing all the tools you need.
So I don't know what todo here.
If we install dapr we should maybe install other stuff too. (azure emulators, other CLIs, etc....)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest just the basics in this PR and we can add more as requested/needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danmoseley what are the basics for you? Dapr cli and Azure cli? Just Azure cli? None of both? More?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, good point, this repo explicitly isn't cloud specific. @eerhardt any opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never used the dapr cli and I work in the repo every day.
My opinion would be to not include the dapr cli or the Azure cli initially.
If someone wants these, they can customize their own container right? https://docs.github.com/codespaces/setting-your-user-preferences/personalizing-github-codespaces-for-your-account
@kvenkatrajan for your issue with the HTTPS endpoint then you could run |
The problem there is, that I currently don't see a way to specify the use of prerelease version of extensions in devcontainers. If you take a look into the spec of devcontianers, the extensions property is a list of extension ids without version numbers. |
I think this should be fine but just giving a headsup that debugging might not work for playground apps in codespaces till this version is live. Maybe worth specifying that in the machine-requirements.md |
{ | ||
"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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
TLDR is "performance".
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-dotnettools.vscodeintellicode-csharp", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
seemed we should install ms-dotnettools.csdevkit
to keep it working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
// "5001": { | ||
// "protocol": "https" | ||
// } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-authored-by: Igor Velikorossov <[email protected]>
Co-authored-by: Igor Velikorossov <[email protected]>
@danmoseley @timheuer Is there anything missing from this? It would be great to have this merged. |
ping @danmoseley and @timheuer :) |
Okay I will close this PR because I saw on twitter that someone else added dev container support. :/ A bit sad about the not existing communication at the end... |
mea culpa @paule96, we should have integrated this PR! There were other changes that included making this aspire work in codespaces that were done as well but that's not an excuse. |
@@ -26,3 +30,24 @@ When you install, ensure that both: | |||
* [Windows](https://podman.io/docs/installation#windows) | |||
* [macOS](https://podman.io/docs/installation#macos) | |||
* [Linux](https://podman.io/docs/installation#installing-on-linux) | |||
|
|||
## (Windows / Linux / Mac) DevContainer in VS Code |
There was a problem hiding this comment.
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
@davidfowl yes but probably a new pullrequest would be better, because merging this now is I guess a bit wrong. Let me see if I find the time today to reopen a new PR with just the changes that are left. My quick analysis is:
|
@paule96 sorry I didn't see your PR here when I merged mine. I did the work on improving the codespaces support so that the dashboard would show the port forwarded URLs. If you do put up another PR with these changes feel free to tag me in it so we can do a quick review. |
This PR adds the first try to enable DevContainers for the Aspire project.
Currently, the functionality in the codespaces of GitHub is very limited. It's enough to write tests and debug them. But to run the playground examples it's not enough because something with the dashboard is wrong there.
For DevContainers on a local installation, it works quite well, if you can provide enough memory.
Currently what takes quite long when you first start the DevContainer are two things:
Microsoft Reviewers: Open in CodeFlow