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

Development Containers (Hollistic Issue) #540

Open
josephaw1022 opened this issue Mar 22, 2024 · 7 comments
Open

Development Containers (Hollistic Issue) #540

josephaw1022 opened this issue Mar 22, 2024 · 7 comments
Assignees

Comments

@josephaw1022
Copy link
Contributor

Describe the issue or suggestion

So, I noticed in the documentation and playground directory in the source code that there seems to be no mention or little mention of how to use aspire in dev container based workflow.

here is one that I have been using very frequently to spin up apps

{
  "name": "Aspire & Dapr",
  "image": "mcr.microsoft.com/devcontainers/dotnet:8.0-jammy",
  "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:2": {
      "version": "latest",
      "enableNonRootDocker": true,
      "moby": true
    },
    "ghcr.io/prom3theu5/aspirational-manifests/aspirate:latest": {},
    "ghcr.io/devcontainers/features/github-cli:1": {},
    "ghcr.io/azure/azure-dev/azd:0": {
      "version": "latest"
    },
    "ghcr.io/devcontainers/features/common-utils:2": {},
    "ghcr.io/dapr/cli/dapr-cli:0": {}
  },
  "runArgs": [
    "--sysctl",
    "net.ipv6.conf.all.disable_ipv6=0",
    "--sysctl",
    "net.ipv6.conf.default.forwarding=1",
    "--sysctl",
    "net.ipv6.conf.all.forwarding=1"
  ],
  "customizations": {
    "vscode": {
      "extensions": [
        "ms-dotnettools.csdevkit",
        "ms-azuretools.vscode-dapr",
        "ms-azuretools.vscode-docker",
        "redhat.vscode-yaml",
        "streetsidesoftware.code-spell-checker",
        "ms-azuretools.vscode-bicep",
        "eamodio.gitlens"
      ]
    }
  },
  "postCreateCommand": "dotnet workload update && dotnet workload install aspire && dotnet tool install -g aspirate --prerelease &&  docker compose up -d && dapr init",
  "remoteUser": "root"
}

while there are definitely better ways that something like this could be done, I do want to see if some mention and examples of dev containers could be added to the documentation.

New Section To Getting Started

For example, I think that a "dev container based" getting started guide would be really useful for those who are hesitant to download anything new or in preview to their laptop.

image

  • I think a local devcontainers walkthrough would be beneficial
  • I also think instructions on how to get going with aspire in github codespaces would also be beneficial

Adding Example Dev Containers Files To Project

There are many ways to work with Dotnet aspire and there's no one way to setup your dev container. For example, if your local workflow is just using aspire to spin up a .net api that is using a local sql server, then your dev container file is going to look very different to someone that is using dcp to orchestrate containers or integrate dapr. So I think a page with some example code block examples with example scenarios would be beneficial.

  • stateless .net apps only (just .net project resources)

  • having a node js based resource (adding node feature)

  • container resources in app host (with notes about dind, ipv6 args, implications of dind and how that working, not being able to have a dind workflow in rancher desktop but able to with docker desktop at the moment (seems unrelated, but it has some implications on how someone might use or decide on whether or not to use aspire and it's orchestration abilities)

  • Dapr Examples

    • Using the built in in-memory components from aspire dapr (built in addstatestore and addpubsub)
    • DinD based workflow that uses docker or docker compose to build up backends for dapr
    • external cloud usage, like using azure cloud provisioned resources
  • Aspirate Example

    • DinD Example
      • minikube?
      • kind?
    • DofD Example
    • How you can have a DinD devcontainer for inner loop development and have a dofd dev container for aspirate usage and deployment to kubernetes usage
  • an example that uses bicep files (so having the appropriate extensions and features would be noted)

@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Mar 22, 2024
@IEvangelist
Copy link
Member

I'm curious what @timheuer thinks about this?

@timheuer
Copy link
Member

timheuer commented Mar 27, 2024

I think this would be great, but one thing we need to feel good about first is the 'simple' devcontainer scenario (e.g., Codespaces). We're working on validating some of that and until we feel good about that before we can be affirmitive about the other scenarios. Codespaces is on our path to validate some of the aspects of port forwarding, etc. and ensuring works with VS Code.

This is currently our tracking validation issue we are using: dotnet/aspire#1178

@CamSoper
Copy link
Contributor

@IEvangelist when we get the go-ahead, I want this one

@IEvangelist
Copy link
Member

@IEvangelist when we get the go-ahead, I want this one

All yours!

@CamSoper CamSoper removed the ⌚ Not Triaged Not triaged label Apr 30, 2024
@IEvangelist
Copy link
Member

@CamSoper are you able to work on this for the GA timeline, by next week? 😬

@CamSoper
Copy link
Contributor

@IEvangelist Yep, top priority

@CamSoper
Copy link
Contributor

CamSoper commented May 13, 2024

@timheuer I see dotnet/aspire#1178 is still open. Do you want me to write up a "how to" with the caveat that Codespaces has certain limitations? Or are we still holding off on documenting this?

cc: @IEvangelist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Slipped
Development

No branches or pull requests

5 participants