-
Notifications
You must be signed in to change notification settings - Fork 0
feat(jupyter-datascience-notebooks): add a new template jupyter-datascience-notebooks #5
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
jcbhmr
merged 15 commits into
devcontainers-community:main
from
eitsupi:add-jupyter-datascience-notebooks
Apr 15, 2023
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e1c6f13
feat(jupyter-datascience-notebooks): add devcontainer-template.json
eitsupi 3720a6f
feat(jupyter-datascience-notebooks): add devcontainer.json
eitsupi 3a31a22
test(jupyter-datasciense-notebooks): add template tests
eitsupi c1556fa
fix: shoud add a user group named jovyan
eitsupi 04c4580
docs: add NOTES.md
eitsupi 295098d
feat: copy settings from original devcontainer.sjon
eitsupi a9b5fb1
Merge remote-tracking branch 'upstream/main' into add-jupyter-datasci…
eitsupi 0867f73
docs: update notes from suggestion
eitsupi 94a08b7
format: auto formatting
eitsupi b127507
docs: fix link
eitsupi 4f32836
Merge remote-tracking branch 'upstream/main' into add-jupyter-datasci…
eitsupi da0b3ea
format: spacing and line breaking
eitsupi d478d32
ci: exclude template Dockerfile and devcontainer jsonc files from meg…
eitsupi 72639ec
docs: add note about default command override
eitsupi 4d4dfa0
fix: make the sh file as executable
eitsupi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| DISABLE_LINTERS: | ||
| - SPELL_CSPELL | ||
| - REPOSITORY_TRIVY | ||
| DOCKERFILE_HADOLINT_FILTER_REGEX_EXCLUDE: "src/.*" | ||
| JSON_JSONLINT_FILTER_REGEX_EXCLUDE: ".*devcontainer.*json$" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| FROM docker.io/jupyter/${templateOption:baseVariant}:${templateOption:imageVariant} | ||
|
|
||
| USER root | ||
| # Generally, Dev Container Features assume that the non-root user (in this case jovyan) | ||
| # is in a group with the same name (in this case jovyan). So we must first make that so. | ||
| RUN groupadd jovyan \ | ||
| && usermod -g jovyan -a -G users jovyan | ||
|
|
||
| USER jovyan |
49 changes: 49 additions & 0 deletions
49
src/jupyter-datascience-notebooks/.devcontainer/devcontainer.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
| // README at: https://github.com/devcontainers-community/templates/tree/main/src/jupyter-datascience-notebooks | ||
| { | ||
| "name": "Jupyter Data Science Notebooks", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| // Features to add to the dev container. More info: https://containers.dev/features. | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "installZsh": "true", | ||
| "username": "jovyan", | ||
| "userUid": "1000", | ||
| "userGid": "1000", | ||
| "upgradePackages": "true" | ||
| } | ||
| }, | ||
| // Use base images default CMD. | ||
| "overrideCommand": false, | ||
| // Forward Jupyter port locally, mark required. | ||
| "forwardPorts": [8888], | ||
| "portsAttributes": { | ||
| "8888": { | ||
| "label": "Jupyter", | ||
| "requireLocalPort": true, | ||
| "onAutoForward": "ignore" | ||
| } | ||
| }, | ||
| // Configure tool-specific properties. | ||
| "customizations": { | ||
| // Configure properties specific to VS Code. | ||
| "vscode": { | ||
| // Set *default* container specific settings.json values on container create. | ||
| "settings": { | ||
| "python.defaultInterpreterPath": "/opt/conda/bin/python" | ||
| }, | ||
| // Add the IDs of extensions you want installed when the container is created. | ||
| "extensions": ["ms-python.python", "ms-toolsai.jupyter"] | ||
| } | ||
| } | ||
| // Use 'postCreateCommand' to run commands after the container is created. | ||
| // "postCreateCommand": "pip3 install --user -r requirements.txt", | ||
|
|
||
| // Configure tool-specific properties. | ||
| // "customizations": {}, | ||
|
|
||
| // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
| // "remoteUser": "root" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <!-- markdownlint-disable MD041 --> | ||
|
|
||
| ## Configurations | ||
|
|
||
| ### Choosing a base image | ||
|
|
||
| You can choose from many base images to tailor the container to your project's needs. | ||
| If you don't know what this means, that's OK! Just choose the `datascience-notebook` option. | ||
| It has many packages for data science from the Julia, Python, and R communities. 🚀 | ||
|
|
||
| 📚 You can learn more about what each of these base images is and what features each of them | ||
| in [the Jupyter Docker Stacks reference page](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html). | ||
|
|
||
| ### Default command | ||
|
|
||
| The default command of the base image is set to start the Jupyter server. | ||
| If you do not use the Jupyter server, comment out `"overrideCommand": false` of the devcontainer.json. | ||
|
|
||
| ## Credits | ||
|
|
||
| This template was originally created by [@nathancarter](https://github.com/nathancarter) | ||
| and other contributors in the [microsoft/vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository. | ||
| It has since been landed here. 🌠 |
41 changes: 41 additions & 0 deletions
41
src/jupyter-datascience-notebooks/devcontainer-template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "id": "jupyter-datascience-notebooks", | ||
| "version": "1.0.0", | ||
| "name": "Jupyter Data Science Notebooks", | ||
| "description": "Use Jupyter Data Science Notebooks with Python, R, Julia, and more.", | ||
| "documentationURL": "https://github.com/devcontainers-community/templates/tree/main/src/jupyter-datascience-notebooks", | ||
| "publisher": "Community", | ||
| "licenseURL": "https://github.com/devcontainers-community/templates/blob/main/LICENSE", | ||
| "options": { | ||
| "baseVariant": { | ||
| "type": "string", | ||
| "description": "Base image. Check the documentation for details.", | ||
| "default": "datascience-notebook", | ||
| "proposals": [ | ||
| "base-notebook", | ||
| "minimal-notebook", | ||
| "r-notebook", | ||
| "scipy-notebook", | ||
| "tensorflow-notebook", | ||
| "datascience-notebook", | ||
| "pyspark-notebook", | ||
| "all-spark-notebook" | ||
| ] | ||
| }, | ||
| "imageVariant": { | ||
| "type": "string", | ||
| "description": "Image version (tag).", | ||
| "default": "latest", | ||
| "proposals": ["latest"] | ||
| } | ||
| }, | ||
| "platforms": [ | ||
| "Python", | ||
| "R", | ||
| "Julia", | ||
| "numpy", | ||
| "pandas", | ||
| "tidyverse", | ||
| "much more" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
| cd "$(dirname "$0")" || exit | ||
|
jcbhmr marked this conversation as resolved.
|
||
|
|
||
| # shellcheck source=/dev/null | ||
| source test-utils.sh | ||
|
|
||
| # Template specific tests | ||
| check "usergroups" bash -c 'groups jovyan | sed "s/jovyan ://" | grep jovyan' | ||
|
|
||
| # Report result | ||
| reportResults | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling they are not platforms, but are copied straight from the original template.......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened devcontainers/templates#145 because I remembered you saying something like "the devcontainers official people get paid to do this" so I figured might as well ask, right? cant hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening that!
I too don't think this field is currently being used for anything.
So we can keep this as it is for now.