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

Bring "attach config" devcontainer.json subset into spec #20

Open
Chuxel opened this issue Mar 24, 2022 · 1 comment
Open

Bring "attach config" devcontainer.json subset into spec #20

Chuxel opened this issue Mar 24, 2022 · 1 comment
Labels
proposal Still under discussion, collecting feedback

Comments

@Chuxel
Copy link
Member

Chuxel commented Mar 24, 2022

While not as full featured as the full devcontainer.json flow, the attach configuration flow is useful for scenarios where you already have a running container you want to interact with. To recap, this allows is a subset of devcontainer.json properties to be applied to an already running container. The idea is that tools "attach" to a container that were spun up in some way while still taking advantage of some of the capabilities that the metadata in the dev container spec enables. The current list of properties can be found here (tho some would move under customizations per #1).

This subset (customizations aside) could also represent the minimum bar for when something would be said to support the spec. These properties are also very compatible with the idea of using labels to store metadata (#18), particularly if this expanded to also support labels on containers in addition to images, so file-based representation would be only one form.

With this in mind, we could refer to this as a "minimal profile" of dev container properties (verses "full profile"). This subset of properties should also work with any orchestrator (related to #10) since they can all be applied at runtime which further highlights the value of bringing the idea into the spec. That said, despite naming, it likely makes sense to have a separate schema with this subset to aid use.

More complex capabilities like features would not part of this configuration, though should we move forward with label-based metadata (#18), there's no reason you couldn't pre-build an image, reference it, and then use this minimal profile for anything else that is needed.

@Chuxel Chuxel added the proposal Still under discussion, collecting feedback label Mar 24, 2022
@Chuxel Chuxel changed the title Bring "attach config" into spec Bring "attach config" devcontainer.json subset into spec Mar 24, 2022
@Chuxel
Copy link
Member Author

Chuxel commented Sep 12, 2022

This appears to be the current list of properties that could be supported in an attach config subset:

  • name
  • forwardPorts
  • portsAttributes
  • otherPortsAttributes
  • remoteEnv
  • remoteUser
  • userEnvProbe
  • customizations <= Tool/service would need to define which would work.
    • vscode.extensions
    • vscode.settings
  • postAttachCommand

The following could be layered in with a subtle tweak to their triggers. Specifically, we could say these can be triggered at the first point that a dev container service or tool connects, and that waitFor is more of a statement as to when the end-user is able to start making edits. Several of these already use marker files to indicate if they've been triggered already which would continue to function.

  • onCreateCommand
  • updateContentCommand
  • postCreateCommand
  • postStartCommand
  • waitFor

Of these, postStartCommand would be the hardest since it would require inspecting the container to see when it was started and then tracking the last recorded start time as a file in the container.

While most of the properties in #2 would not work in this context since they assume control of container config with one possible exception.

  • entrypoint

This could supported as something that runs as the container's user rather than remoteUser and otherwise ends up being like postStartCommand. However, the challenge is that this would not run as PID 0, so that would have to be a documented limitation.

For Features, if the image used for the container included properties from #18, supported properties above would be applied, but no direct features property would be possible since this can affect the image build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Still under discussion, collecting feedback
Projects
None yet
Development

No branches or pull requests

1 participant