Skip to content

create workbench-jupyter-docker devcontainer to support docker workflows #171

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

Merged
merged 3 commits into from
Apr 22, 2025

Conversation

npc-g
Copy link
Contributor

@npc-g npc-g commented Apr 17, 2025

Supports Docker out of Docker (DooD) by exposing the docker socket and running jupyter under the docker group.

Mostly #149 with some small changes from #163

@npc-g npc-g requested a review from rogerwangcs April 17, 2025 22:45
@npc-g npc-g marked this pull request as ready for review April 17, 2025 22:51
@npc-g npc-g requested review from a team as code owners April 17, 2025 22:51
"service": "app",
"shutdownAction": "none",
"workspaceFolder": "/workspace",
"initializeCommand": "DOCKER_GID=`getent group docker | cut -d: -f3` && echo \"DOCKER_GID=${DOCKER_GID}\" > .env",
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: comment explaining this init command?

chown -R jupyter /home/jupyter/.docker

# Login to docker with gcloud credentials (needs to be re-run every 30 min if needed)
sudo -u jupyter /bin/bash -c "docker login -u oauth2accesstoken -p $(gcloud auth print-access-token) https://us-central1-docker.pkg.dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't remember why I chose the access token route. Gcp supports a number of other auth methods. If rerunning every 30 min is not desirable, we could experiment with gcloud credential helper https://cloud.google.com/artifact-registry/docs/docker/authentication

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC we tried gcloud auth configure-docker but it was making changes to the docker config file within the container rather than in the host, so went with this approach instead

@npc-g npc-g merged commit 459c7c3 into master Apr 22, 2025
8 checks passed
@npc-g npc-g deleted the npc/dood branch April 22, 2025 17:26
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.

2 participants