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

Add a devcontainer configuration #7583

Merged
merged 6 commits into from
Jan 11, 2022
Merged

Add a devcontainer configuration #7583

merged 6 commits into from
Jan 11, 2022

Conversation

olix0r
Copy link
Member

@olix0r olix0r commented Jan 10, 2022

VS Code devcontainers provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

This change also bumps the rust toolchain version to v1.56.1, as some
tools cannot be installed with v1.56.0.

Signed-off-by: Oliver Gould ver@buoyant.io

VS Code [devcontainers][dc] provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

[dc]: https://code.visualstudio.com/docs/remote/containers

Signed-off-by: Oliver Gould <ver@buoyant.io>
@olix0r olix0r requested a review from a team as a code owner January 10, 2022 16:38
Signed-off-by: Oliver Gould <ver@buoyant.io>
Signed-off-by: Oliver Gould <ver@buoyant.io>
Copy link
Member

@adleong adleong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sweet.

Worth noting that simply opening the workspace in a devcontainer didn't work for me because my docker daemon runs on a remote host and my local filesystem paths and remote filesystem paths don't line up. However, doing "clone a PR in a devcontainer" worked like a charm and I imagine that "close a repo in a devcontainer" will work as well once this is merged.

One small thing I noticed is that the markdownlint script requires npm, so we may want to add that to the container as well:

$ bin/markdownlint
Error: npm required to install markdownlint command

@olix0r
Copy link
Member Author

olix0r commented Jan 11, 2022

a little cray that npm pulls in ~300MB just to run that script, but that's for another day. i'll try to get markdownlint-cli preinstalled in the image.

Comment on lines +10 to +12
export PATH="$rootdir/node_modules/.bin:$PATH"

if ! command -v markdownlint >/dev/null || [ "$(markdownlint -V)" != "$version" ]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this script to be able to use a globally installed markdownlint

@olix0r
Copy link
Member Author

olix0r commented Jan 11, 2022

Worth noting that simply opening the workspace in a devcontainer didn't work for me because my docker daemon runs on a remote host and my local filesystem paths and remote filesystem paths don't line up.

You'll probably have better luck using VSCode's Remote - SSH to open a session on the remote host (where you'll need to check out the repo) and then opening in the container should work more smoothly. Some additional context at https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host

Signed-off-by: Oliver Gould <ver@buoyant.io>
Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@olix0r olix0r merged commit f33bb7b into main Jan 11, 2022
@olix0r olix0r deleted the ver/devcontainer branch January 11, 2022 22:38
olix0r added a commit that referenced this pull request Mar 31, 2022
VS Code [devcontainers][dc] provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

[dc]: https://code.visualstudio.com/docs/remote/containers

Signed-off-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit f33bb7b)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit that referenced this pull request Mar 31, 2022
VS Code [devcontainers][dc] provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

[dc]: https://code.visualstudio.com/docs/remote/containers

Signed-off-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit f33bb7b)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit that referenced this pull request Apr 2, 2022
VS Code [devcontainers][dc] provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

[dc]: https://code.visualstudio.com/docs/remote/containers

Signed-off-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit f33bb7b)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit that referenced this pull request Apr 7, 2022
VS Code [devcontainers][dc] provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

[dc]: https://code.visualstudio.com/docs/remote/containers

Signed-off-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit f33bb7b)
Signed-off-by: Oliver Gould <ver@buoyant.io>
olix0r added a commit that referenced this pull request Apr 8, 2022
VS Code [devcontainers][dc] provide a way to define a reproducible,
customizable developer environment. This should lower the barrier to
entry for contributors and reduce the maintenance burden for existing
developers, as a docker daemon is now basically all that's needed to get
up and running.

This change adds a devcontainer for the Linkerd2 project. Its container
starts in the host's network so that it can easily access k3d clusters
running on the host's docker daemon.

[dc]: https://code.visualstudio.com/docs/remote/containers

Signed-off-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit f33bb7b)
Signed-off-by: Oliver Gould <ver@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants