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 jupyter/pytorch-notebook #1936

Merged
merged 43 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6cc5bb1
Add PyTorch image
twalcari Jul 6, 2023
21b9832
Fix linting errors
twalcari Jul 6, 2023
3ed9eb4
Fix link to pytorch website
twalcari Jul 6, 2023
26c5fd0
Address review comments
twalcari Jul 6, 2023
80a7656
Merge branch 'main' into pytorch-image
mathbunnyru Jul 6, 2023
6ab52a1
Fix PytorchVersionTagger
twalcari Jul 6, 2023
71a8a2f
Remove "+cpu" suffix from pytorch version tag
twalcari Jul 6, 2023
4035f20
Merge branch 'main' into pytorch-image
mathbunnyru Jul 9, 2023
6d893b8
Merge branch 'main' into pytorch-image
mathbunnyru Jul 17, 2023
c7de998
Merge branch 'main' into pytorch-image
mathbunnyru Jul 25, 2023
2ec49d3
Merge branch 'main' into pytorch-image
mathbunnyru Aug 4, 2023
8ca006f
Merge branch 'main' into pytorch-image
mathbunnyru Aug 19, 2023
25b4dfb
Merge branch 'main' into pytorch-image
mathbunnyru Aug 19, 2023
72a5a1c
Merge branch 'main' into pytorch-image
mathbunnyru Aug 19, 2023
4fd3143
Update selecting.md
mathbunnyru Aug 19, 2023
ec5e7cb
Rename pytorch-notebook/.dockerignore to images/pytorch-notebook/.doc…
mathbunnyru Aug 19, 2023
fc81933
Rename pytorch-notebook/Dockerfile to images/pytorch-notebook/Dockerfile
mathbunnyru Aug 19, 2023
7728e18
Rename pytorch-notebook/README.md to images/pytorch-notebook/README.md
mathbunnyru Aug 19, 2023
e5c3929
Merge branch 'main' into pytorch-image
mathbunnyru Aug 28, 2023
f92a071
Merge branch 'main' into pytorch-image
mathbunnyru Sep 27, 2023
d9d0739
Merge branch 'main' into pytorch-image
mathbunnyru Oct 8, 2023
b2beef8
Merge branch 'main' into pytorch-image
mathbunnyru Oct 21, 2023
fc4704d
Add pytorch-notebook to registry-overviews
mathbunnyru Oct 21, 2023
684d482
Add registry to pytorch image
mathbunnyru Oct 21, 2023
910ead1
Use Quay.io
mathbunnyru Oct 21, 2023
e54c09d
Remove incorrect link
mathbunnyru Oct 21, 2023
b81bd23
Merge branch 'main' into pytorch-image
mathbunnyru Oct 27, 2023
ddb8bba
Merge branch 'main' into pytorch-image
mathbunnyru Oct 31, 2023
5c77979
Merge branch 'main' into pytorch-image
mathbunnyru Nov 5, 2023
2934046
Merge branch 'main' into pytorch-image
mathbunnyru Nov 6, 2023
547dd6b
Update action.yml
mathbunnyru Nov 6, 2023
3d0b4b4
Update docker.yml
mathbunnyru Nov 6, 2023
d574edb
Merge branch 'main' into pytorch-image
mathbunnyru Nov 6, 2023
fe373ec
Remove information about Docker Hub, because this image won't be uplo…
mathbunnyru Nov 6, 2023
6079d04
Merge branch 'main' into pytorch-image
mathbunnyru Nov 6, 2023
5f77d73
Merge branch 'main' into pytorch-image
mathbunnyru Nov 18, 2023
3e96c9d
Merge branch 'main' into pytorch-image
mathbunnyru Nov 19, 2023
1545a97
Update docker.yml
mathbunnyru Nov 19, 2023
7d9f89b
Merge branch 'main' into pytorch-image
mathbunnyru Nov 19, 2023
17fbc98
Update action.yml
mathbunnyru Nov 19, 2023
003f534
Merge branch 'main' into pytorch-image
mathbunnyru Nov 19, 2023
4a70a4f
Merge branch 'main' into pytorch-image
mathbunnyru Nov 21, 2023
a32ce9b
Add pytorch-notebook to registry-move.yml
twalcari Nov 22, 2023
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/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ body:
- julia-notebook
- minimal-notebook
- pyspark-notebook
- pytorch-notebook
- r-notebook
- scipy-notebook
- tensorflow-notebook
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ body:
- julia-notebook
- minimal-notebook
- pyspark-notebook
- pytorch-notebook
- r-notebook
- scipy-notebook
- tensorflow-notebook
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/download-manifests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ runs:
with:
name: tensorflow-notebook-x86_64-history_line
path: ${{ inputs.histLineDir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
name: pytorch-notebook-x86_64-history_line
path: ${{ inputs.histLineDir }}
mathbunnyru marked this conversation as resolved.
Show resolved Hide resolved
- name: Download artifact 📥
uses: actions/download-artifact@v3
with:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ on:
- "julia-notebook/**"
- "minimal-notebook/**"
- "pyspark-notebook/**"
- "pytorch-notebook/**"
- "r-notebook/**"
- "scipy-notebook/**"
- "tensorflow-notebook/**"
Expand Down Expand Up @@ -55,6 +56,7 @@ on:
- "julia-notebook/**"
- "minimal-notebook/**"
- "pyspark-notebook/**"
- "pytorch-notebook/**"
- "r-notebook/**"
- "scipy-notebook/**"
- "tensorflow-notebook/**"
Expand Down Expand Up @@ -192,6 +194,15 @@ jobs:
runsOn: ARM64
needs: [aarch64-scipy]

aarch64-pytorch:
uses: ./.github/workflows/docker-build-test-upload.yml
with:
parentImage: scipy-notebook
image: pytorch-notebook
platform: aarch64
runsOn: ARM64
needs: [aarch64-scipy]

twalcari marked this conversation as resolved.
Show resolved Hide resolved
x86_64-tensorflow:
uses: ./.github/workflows/docker-build-test-upload.yml
with:
Expand All @@ -201,6 +212,15 @@ jobs:
runsOn: ubuntu-latest
needs: [x86_64-scipy]

x86_64-pytorch:
uses: ./.github/workflows/docker-build-test-upload.yml
with:
parentImage: scipy-notebook
image: pytorch-notebook
platform: x86_64
runsOn: ubuntu-latest
needs: [x86_64-scipy]

aarch64-datascience:
uses: ./.github/workflows/docker-build-test-upload.yml
with:
Expand Down Expand Up @@ -277,6 +297,7 @@ jobs:
r-notebook,
julia-notebook,
tensorflow-notebook,
pytorch-notebook,
datascience-notebook,
pyspark-notebook,
all-spark-notebook,
Expand All @@ -289,6 +310,7 @@ jobs:
aarch64-scipy,
aarch64-r,
aarch64-tensorflow,
aarch64-pytorch,
aarch64-datascience,
aarch64-pyspark,
aarch64-all-spark,
Expand All @@ -314,6 +336,7 @@ jobs:
r-notebook,
julia-notebook,
tensorflow-notebook,
pytorch-notebook,
datascience-notebook,
pyspark-notebook,
all-spark-notebook,
Expand All @@ -326,6 +349,7 @@ jobs:
x86_64-scipy,
x86_64-r,
x86_64-tensorflow,
x86_64-pytorch,
x86_64-datascience,
x86_64-pyspark,
x86_64-all-spark,
Expand All @@ -349,6 +373,7 @@ jobs:
r-notebook,
julia-notebook,
tensorflow-notebook,
pytorch-notebook,
datascience-notebook,
pyspark-notebook,
all-spark-notebook,
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hub-overview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- "r-notebook/README.md"
- "scipy-notebook/README.md"
- "tensorflow-notebook/README.md"
- "pytorch-notebook/README.md"
twalcari marked this conversation as resolved.
Show resolved Hide resolved

jobs:
update-dockerhub-overview:
Expand Down Expand Up @@ -59,6 +60,8 @@ jobs:
description: "Julia Jupyter Notebook Stack from https://github.com/jupyter/docker-stacks"
- image: tensorflow-notebook
description: "Scientific Jupyter Notebook Python Stack w/ TensorFlow from https://github.com/jupyter/docker-stacks"
- image: pytorch-notebook
description: "Scientific Jupyter Notebook Python Stack w/ PyTorch from https://github.com/jupyter/docker-stacks"
- image: datascience-notebook
description: "Data Science Jupyter Notebook Python Stack from https://github.com/jupyter/docker-stacks"
- image: pyspark-notebook
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ALL_IMAGES:= \
julia-notebook \
scipy-notebook \
tensorflow-notebook \
pytorch-notebook \
datascience-notebook \
pyspark-notebook \
all-spark-notebook
Expand Down
31 changes: 19 additions & 12 deletions docs/images/inherit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion docs/using/selecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ It contains:
- Everything in `jupyter/scipy-notebook` and its ancestor images
- [tensorflow](https://www.tensorflow.org/) machine learning library

### jupyter/pytorch-notebook

[Source on GitHub](https://github.com/jupyter/docker-stacks/tree/main/pytorch-notebook) |
[Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/pytorch-notebook/Dockerfile) |
[Docker Hub image tags](https://hub.docker.com/r/jupyter/pytorch-notebook/tags/)

`jupyter/pytorch-notebook` includes popular Python deep learning libraries.

- Everything in `jupyter/scipy-notebook` and its ancestor images
- [pytorch](https://pytorch.org/) machine learning library

### jupyter/datascience-notebook

[Source on GitHub](https://github.com/jupyter/docker-stacks/tree/main/datascience-notebook) |
Expand Down Expand Up @@ -226,7 +237,7 @@ The following diagram depicts the build dependency tree of the core images. (i.e
Any given image inherits the complete content of all ancestor images pointing to it.

[![Image inheritance
diagram](../images/inherit.svg)](http://interactive.blockdiag.com/?compression=deflate&src=eJyFjkFuwkAMRfecwsqKLuYACMEJuqPLSshJHDAZ7GjGIwSIuzPTRaWJWmX7_vP_br12Y894gucKoKcBk7fjoGKRHwQ72Gwz18AkhsYqGU0aLCDbdpWjJrVJLH3L-vPrADe2c85ZDAJ5wkgfDbg99HmFgouG3RjdoEn6n7ZS_l9W7trc4ESNWtWxyBUoxpWFr-grac6KFzue7pVVk-I0RhI1DF5vv7z5W80vYqYkHS1Oh0XjkjzjwnPTPU4Yxsqas-Kh925uvt4imKoO)
diagram](../images/inherit.svg)](http://interactive.blockdiag.com/?compression=deflate&src=eJyFz8FOwzAMgOH7nsLqCQ55ADTBE3CDIxJyU5eZZnaUOJoK2rsv4YCUSlOvv784yRjULxPjF_weACaasQT7nFUs8w_BMzwda9fEJIbGKjVFTZaQ7Xioo6GMRax8yMPr-xtc2E51zmKQKBBmehzAvcBUb6HksqFfspu1yPS3rS2_N2vnxrrBiRqNqkvDXWjizMJnDB3atuay57h2qi_NDEaSNc1BL_99uEPjapr8ac_Vr2CtJJ52n5h2xXcJjDufiGuOmJZObVtzGILbyusNkda3zw)

### Builds

Expand Down
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ ignore_missing_imports = True
[mypy-tensorflow.*]
ignore_missing_imports = True

[mypy-torch.*]
ignore_missing_imports = True

[mypy-urllib3.*]
ignore_missing_imports = True
2 changes: 2 additions & 0 deletions pytorch-notebook/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Documentation
README.md
20 changes: 20 additions & 0 deletions pytorch-notebook/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
ARG OWNER=jupyter
ARG BASE_CONTAINER=$OWNER/scipy-notebook
FROM $BASE_CONTAINER

LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"

# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install PyTorch with pip
# hadolint ignore=DL3013
RUN pip install --no-cache-dir --index-url 'https://download.pytorch.org/whl/cpu' \
mathbunnyru marked this conversation as resolved.
Show resolved Hide resolved
'torch' \
'torchvision' \
'torchaudio' && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
13 changes: 13 additions & 0 deletions pytorch-notebook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Jupyter Notebook Deep Learning Stack

[![docker pulls](https://img.shields.io/docker/pulls/jupyter/pytorch-notebook.svg)](https://hub.docker.com/r/jupyter/pytorch-notebook/)
[![docker stars](https://img.shields.io/docker/stars/jupyter/pytorch-notebook.svg)](https://hub.docker.com/r/jupyter/pytorch-notebook/)
[![image size](https://img.shields.io/docker/image-size/jupyter/pytorch-notebook/latest)](https://hub.docker.com/r/jupyter/pytorch-notebook/ "jupyter/pytorch-notebook image size")

GitHub Actions in the <https://github.com/jupyter/docker-stacks> project builds and pushes this image to Docker Hub.

Please visit the project documentation site for help to use and contribute to this image and others.

- [Jupyter Docker Stacks on ReadTheDocs](https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html)
- [Selecting an Image :: Core Stacks :: jupyter/pytorch-notebook](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-pytorch-notebook)
- [Image Specifics :: PyTorch](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/specifics.html#pytorch)
4 changes: 4 additions & 0 deletions tagging/images_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
JupyterNotebookVersionTagger,
PythonMajorMinorVersionTagger,
PythonVersionTagger,
PytorchVersionTagger,
RVersionTagger,
SHATagger,
SparkVersionTagger,
Expand Down Expand Up @@ -72,6 +73,9 @@ class ImageDescription:
"tensorflow-notebook": ImageDescription(
parent_image="scipy-notebook", taggers=[TensorflowVersionTagger()]
),
"pytorch-notebook": ImageDescription(
parent_image="scipy-notebook", taggers=[PytorchVersionTagger()]
),
"datascience-notebook": ImageDescription(
parent_image="scipy-notebook",
taggers=[RVersionTagger(), JuliaVersionTagger()],
Expand Down
6 changes: 6 additions & 0 deletions tagging/taggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ def tag_value(container: Container) -> str:
return "tensorflow-" + _get_pip_package_version(container, "tensorflow")


class PytorchVersionTagger(TaggerInterface):
@staticmethod
def tag_value(container: Container) -> str:
return "pytorch-" + _get_pip_package_version(container, "pytorch")


class JuliaVersionTagger(TaggerInterface):
@staticmethod
def tag_value(container: Container) -> str:
Expand Down
1 change: 1 addition & 0 deletions tests/images_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"r-notebook": "minimal-notebook",
"julia-notebook": "minimal-notebook",
"tensorflow-notebook": "scipy-notebook",
"pytorch-notebook": "scipy-notebook",
"datascience-notebook": "scipy-notebook",
"pyspark-notebook": "scipy-notebook",
"all-spark-notebook": "pyspark-notebook",
Expand Down
5 changes: 5 additions & 0 deletions tests/pytorch-notebook/units/unit_pytorch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import torch

print(torch.tensor([[1.0, 4.0, 7.0], [4.0, 9.0, 11.0]]))