dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.83k stars 457 forks source link

Aspire failing in GitHub Codespace #1178

Closed justinyoo closed 2 weeks ago

justinyoo commented 11 months ago

Hi, Team.

When the current AppHost is running in GitHub Codespaces (and possibly in devcontainer), I found a few issues:

  1. The dashboard page is not automatically opening - (Related to #655 ) Either Blazor app or API app automatically opens a new tab when I run it individually. But, the dashboard doesn't automatically open a new page. Instead I have to manually find the page and open it through the port forwarding tab.
timheuer commented 11 months ago

Thanks @justinyoo this was a bit of a compound issue, so I logged them individually.

justinyoo commented 11 months ago

@timheuer Thanks for splitting it to individual issues!

davidfowl commented 9 months ago

@timheuer we need to re-test this now that we've moved everything around

timheuer commented 9 months ago

@timheuer we need to re-test this now that we've moved everything around

I'm sure this will still not work due to port forwarding... I don't know enough of the implementation details when we do the project/debugger change areas if it will auto-map the right ports.

davidfowl commented 9 months ago

I want to make sure we do this for v1.

timheuer commented 9 months ago

We need someone more familiar with what's needed to map the ports we all create. Not sure if @kvenkatrajan's team work will automatically get this but with the nature of our proxy ports even within the apphost, I assume we want to map the traefik ones.

kvenkatrajan commented 9 months ago

Since the dashboard in preview 3 is now a "known" executable resource that dcp runs - this should just work. We will have to retest to confirm.

danmoseley commented 8 months ago

clarified title (because we could also set up a codespace for this repo)

joperezr commented 7 months ago

Pending validation.

davidfowl commented 7 months ago

@kvenkatrajan I assigned this to you.

kvenkatrajan commented 7 months ago

Aspire launch debug in C# dev kit is currently working on linux, as of end of last week - we are unblocked on testing.

kvenkatrajan commented 7 months ago

Summary after testing:

We were able to test the experience of C# dev kit in code spaces with the new version of C# dev kit and here were our early observations :

mitchdenny commented 2 months ago

Moving to backlog. We should decide whether this goes in for 9.0.

mitchdenny commented 1 month ago

I did some experimentation this weekend on how to make the upcoming version of .NET Aspire (9.0) work with GitHub Codespaces. Here is what I did.

The first step is creating a GitHub repo and creating a new .NET Aspire project in it (I used the starter project). Next I opened that container and tweaked the .devcontainer file:

https://github.com/mitchdenny/aspire-withcodespaces/blob/main/.devcontainer/devcontainer.json

Then in the Program.cs of the AppHost I created this extension method class:

https://github.com/mitchdenny/aspire-withcodespaces/blob/448476fce79258e3a927634c7cba72c2c8795982/CustomResources.AppHost/Program.cs#L21-L82

And wired it up to the builder like this:

https://github.com/mitchdenny/aspire-withcodespaces/blob/448476fce79258e3a927634c7cba72c2c8795982/CustomResources.AppHost/Program.cs#L7

Then you should just be able to install the C# extensions and F5 the project and it'll start up. The WithCodespaces(...) extension figures out the right forwarded URLs and replaces them on the dashboard:

image

anfibiacreativa commented 2 weeks ago

@bradygaster this currently blocks the Aspire templates from publication to curated collection, due to invalid devcontainer config. Would love to chat about this.

bradygaster commented 2 weeks ago

@anfibiacreativa get the list of things together to smooth out the experience and let me know. also curious if @claudiaregio has seen this and has any ideas.

webreidi commented 1 week ago

@mitchdenny I see this is marked as completed, but I just tried creating an Aspire app on Codespaces and it does not launch. Is there a specific configuration/version this works on?

davidfowl commented 1 week ago

Completed in main, 9.1.0-*. If you want to give it a try https://github.com/dotnet/aspire/blob/main/docs/using-latest-daily.md