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

Aspire failing in GitHub Codespace #1178

Open
3 tasks done
justinyoo opened this issue Dec 3, 2023 · 14 comments · May be fixed by #6183
Open
3 tasks done

Aspire failing in GitHub Codespace #1178

justinyoo opened this issue Dec 3, 2023 · 14 comments · May be fixed by #6183
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-tooling needs-design
Milestone

Comments

@justinyoo
Copy link

justinyoo commented Dec 3, 2023

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 [WebToolsE2E][Aspire] The web page cannot be opened automatically after debugging the aspire project in VS Code. #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
Copy link
Member

timheuer commented Dec 8, 2023

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

@justinyoo
Copy link
Author

@timheuer Thanks for splitting it to individual issues!

@davidfowl davidfowl added this to the preview TBD (but in 8.0) milestone Jan 27, 2024
@davidfowl
Copy link
Member

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

@timheuer
Copy link
Member

@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
Copy link
Member

I want to make sure we do this for v1.

@timheuer
Copy link
Member

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
Copy link
Member

kvenkatrajan commented Jan 29, 2024

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 danmoseley changed the title GitHub Codespaces Support Aspire failing in GitHub Codespace Mar 11, 2024
@danmoseley
Copy link
Member

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

@joperezr
Copy link
Member

Pending validation.

@davidfowl davidfowl added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 26, 2024
@davidfowl
Copy link
Member

@kvenkatrajan I assigned this to you.

@kvenkatrajan
Copy link
Member

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

@kvenkatrajan
Copy link
Member

kvenkatrajan commented Apr 5, 2024

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 :

@davidfowl davidfowl modified the milestones: preview 6 (Apr), 8.1 Apr 15, 2024
@kvenkatrajan kvenkatrajan modified the milestones: 8.1, 8.3 Jun 10, 2024
@mitchdenny mitchdenny modified the milestones: 8.3, Backlog Aug 21, 2024
@mitchdenny
Copy link
Member

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

@mitchdenny
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-tooling needs-design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants