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 devcontainer #3637

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Default image contents: https://hub.docker.com/r/mlpack/jenkins-amd64-debian
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the mlpack/mlpack image would be the better one to use?
https://hub.docker.com/r/mlpack/mlpack

I guess one question is, is the goal to have a container with mlpack already built and available, so that the user can develop applications that use mlpack? Or is the goal to have a container that has mlpack's dependencies, so that a user can develop mlpack itself and submit PRs to the project?

In either case, it's trivial to add a new Dockerfile to here that we can just use directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal is for a container that could be used for immediate development onmlpack itself with a low storage cost. That is, we could say to the wave of GSOC students, here's how you can quickly jump in and work on a PR.

Using mlpack/mlpack is probably even better for hitting both use cases.

Though, if you're okay with adding in a new Docker image, we may want to create a custom docker image that is based on the default devcontainer image to lower storage (the base image is free for storage on GitHub and includes a lot of languages)

Copy link
Member

Choose a reason for hiding this comment

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

Absolutely, piece of cake to add another image. Here's the existing Dockerfile for mlpack/mlpack; do you want to adapt that? Or I can take a shot at it if you like. Once we have something ready I can push it to Dockerhub.

I think it might be a good idea to not install mlpack in whatever container we use; I'm imagining a situation where the user modifies some core mlpack code (in wherever the mlpack source code is checked out), but now that code differs from what's in /usr/include/ (the installed version) and strange linking or behavior issues happen when trying to use mlpack.

Copy link
Member

Choose a reason for hiding this comment

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

@coatless let me know what you think on this point, I'm happy to help with a new Dockerfile. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rcurtin I'll take care of it later today in a PR over in the mlpack/jenkins-conf repository.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's take the discussion on the Universal base over to: mlpack/jenkins-conf#30

Short gist: I need to lobotomize the container to build it.

# Choose different variants available at: https://hub.docker.com/u/mlpack
ARG VARIANT=jenkins-amd64-debian
FROM mlpack/${VARIANT}

# Additional options here...
# RUN apt update && apt upgrade -y

# and so on...
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "mlpack C++ Dev Container",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a new mlpack base image from
// https://hub.docker.com/u/mlpack
"args": { "VARIANT": "jenkins-amd64-debian" }
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {},
"extensions": [
"twxs.cmake",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"llvm-vs-code-extensions.vscode-clangd"
]
}
}

// Switch to using root as a remote user
// details: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
Copy link
Member

Choose a reason for hiding this comment

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

What is the preference here? I don't know about devcontainers, but should we be using the root user in the container? (Easy enough to adapt the relevant dockerfiles if so.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For simplicity and to avoid folks wondering where user mlpack or jenkins was created, we probably want root.

}