Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
filters: |
color: ./**/color/**
hello: ./**/hello/**
jupyter-datascience-notebooks: ./**/jupyter-datascience-notebooks/**

test:
needs: [detect-changes]
Expand Down
2 changes: 2 additions & 0 deletions .mega-linter.yaml
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$"
9 changes: 9 additions & 0 deletions src/jupyter-datascience-notebooks/.devcontainer/Dockerfile
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 src/jupyter-datascience-notebooks/.devcontainer/devcontainer.json
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"
}
23 changes: 23 additions & 0 deletions src/jupyter-datascience-notebooks/NOTES.md
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 src/jupyter-datascience-notebooks/devcontainer-template.json
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"
Comment on lines +36 to +39

@eitsupi eitsupi Apr 15, 2023

Copy link
Copy Markdown
Contributor Author

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.......

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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.

]
}
11 changes: 11 additions & 0 deletions test/jupyter-datascience-notebooks/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
cd "$(dirname "$0")" || exit
Comment thread
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