Add jupyter/pytorch-notebook (#1936)

* Add PyTorch image

* Fix linting errors

* Fix link to pytorch website

* Address review comments

* Fix PytorchVersionTagger

* Remove "+cpu" suffix from pytorch version tag

* Update selecting.md

* Rename pytorch-notebook/.dockerignore to images/pytorch-notebook/.dockerignore

* Rename pytorch-notebook/Dockerfile to images/pytorch-notebook/Dockerfile

* Rename pytorch-notebook/README.md to images/pytorch-notebook/README.md

* Add pytorch-notebook to registry-overviews

* Add registry to pytorch image

* Use Quay.io

* Remove incorrect link

* Update action.yml

* Update docker.yml

* Remove information about Docker Hub, because this image won't be uploaded to Docker Hub

* Update docker.yml

* Update action.yml

* Add pytorch-notebook to registry-move.yml

---------

Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@gmail.com>
This commit is contained in:
Thijs Walcarius
2023-11-22 11:56:45 +01:00
committed by GitHub
parent 0a75e3d3a6
commit 278dd76837
17 changed files with 135 additions and 13 deletions

View File

@@ -26,6 +26,7 @@ body:
- julia-notebook - julia-notebook
- minimal-notebook - minimal-notebook
- pyspark-notebook - pyspark-notebook
- pytorch-notebook
- r-notebook - r-notebook
- scipy-notebook - scipy-notebook
- tensorflow-notebook - tensorflow-notebook

View File

@@ -24,6 +24,7 @@ body:
- julia-notebook - julia-notebook
- minimal-notebook - minimal-notebook
- pyspark-notebook - pyspark-notebook
- pytorch-notebook
- r-notebook - r-notebook
- scipy-notebook - scipy-notebook
- tensorflow-notebook - tensorflow-notebook

View File

@@ -99,6 +99,18 @@ runs:
with: with:
name: tensorflow-notebook-x86_64-history_line name: tensorflow-notebook-x86_64-history_line
path: ${{ inputs.hist-lines-dir }} path: ${{ inputs.hist-lines-dir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
if: inputs.fast-build == 'false'
with:
name: pytorch-notebook-aarch64-history_line
path: ${{ inputs.hist-lines-dir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
if: inputs.fast-build == 'false'
with:
name: pytorch-notebook-x86_64-history_line
path: ${{ inputs.hist-lines-dir }}
- name: Download artifact 📥 - name: Download artifact 📥
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
if: inputs.fast-build == 'false' if: inputs.fast-build == 'false'
@@ -216,6 +228,18 @@ runs:
with: with:
name: tensorflow-notebook-x86_64-manifest name: tensorflow-notebook-x86_64-manifest
path: ${{ inputs.manifests-dir }} path: ${{ inputs.manifests-dir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
if: inputs.fast-build == 'false'
with:
name: pytorch-notebook-aarch64-manifest
path: ${{ inputs.manifests-dir }}
- name: Download artifact 📥
uses: actions/download-artifact@v3
if: inputs.fast-build == 'false'
with:
name: pytorch-notebook-x86_64-manifest
path: ${{ inputs.manifests-dir }}
- name: Download artifact 📥 - name: Download artifact 📥
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
if: inputs.fast-build == 'false' if: inputs.fast-build == 'false'

View File

@@ -198,6 +198,26 @@ jobs:
needs: [x86_64-scipy] needs: [x86_64-scipy]
if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }} if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }}
aarch64-pytorch:
uses: ./.github/workflows/docker-build-test-upload.yml
with:
parent-image: scipy-notebook
image: pytorch-notebook
platform: aarch64
runs-on: ARM64
needs: [aarch64-scipy]
if: github.repository_owner == 'jupyter' && !contains(github.event.pull_request.title, '[FAST_BUILD]')
x86_64-pytorch:
uses: ./.github/workflows/docker-build-test-upload.yml
with:
parent-image: scipy-notebook
image: pytorch-notebook
platform: x86_64
runs-on: ubuntu-latest
needs: [x86_64-scipy]
if: ${{ !contains(github.event.pull_request.title, '[FAST_BUILD]') }}
aarch64-datascience: aarch64-datascience:
uses: ./.github/workflows/docker-build-test-upload.yml uses: ./.github/workflows/docker-build-test-upload.yml
with: with:
@@ -277,6 +297,7 @@ jobs:
r-notebook, r-notebook,
julia-notebook, julia-notebook,
tensorflow-notebook, tensorflow-notebook,
pytorch-notebook,
datascience-notebook, datascience-notebook,
pyspark-notebook, pyspark-notebook,
all-spark-notebook, all-spark-notebook,
@@ -290,6 +311,7 @@ jobs:
aarch64-r, aarch64-r,
aarch64-julia, aarch64-julia,
aarch64-tensorflow, aarch64-tensorflow,
aarch64-pytorch,
aarch64-datascience, aarch64-datascience,
aarch64-pyspark, aarch64-pyspark,
aarch64-all-spark, aarch64-all-spark,
@@ -329,6 +351,7 @@ jobs:
r-notebook, r-notebook,
julia-notebook, julia-notebook,
tensorflow-notebook, tensorflow-notebook,
pytorch-notebook,
datascience-notebook, datascience-notebook,
pyspark-notebook, pyspark-notebook,
all-spark-notebook, all-spark-notebook,
@@ -342,6 +365,7 @@ jobs:
x86_64-r, x86_64-r,
x86_64-julia, x86_64-julia,
x86_64-tensorflow, x86_64-tensorflow,
x86_64-pytorch,
x86_64-datascience, x86_64-datascience,
x86_64-pyspark, x86_64-pyspark,
x86_64-all-spark, x86_64-all-spark,
@@ -380,6 +404,7 @@ jobs:
r-notebook, r-notebook,
julia-notebook, julia-notebook,
tensorflow-notebook, tensorflow-notebook,
pytorch-notebook,
datascience-notebook, datascience-notebook,
pyspark-notebook, pyspark-notebook,
all-spark-notebook, all-spark-notebook,

View File

@@ -51,6 +51,7 @@ jobs:
r-notebook, r-notebook,
julia-notebook, julia-notebook,
tensorflow-notebook, tensorflow-notebook,
pytorch-notebook,
datascience-notebook, datascience-notebook,
pyspark-notebook, pyspark-notebook,
all-spark-notebook, all-spark-notebook,

View File

@@ -42,6 +42,7 @@ jobs:
r-notebook, r-notebook,
julia-notebook, julia-notebook,
tensorflow-notebook, tensorflow-notebook,
pytorch-notebook,
datascience-notebook, datascience-notebook,
pyspark-notebook, pyspark-notebook,
all-spark-notebook, all-spark-notebook,

View File

@@ -17,6 +17,7 @@ ALL_IMAGES:= \
julia-notebook \ julia-notebook \
scipy-notebook \ scipy-notebook \
tensorflow-notebook \ tensorflow-notebook \
pytorch-notebook \
datascience-notebook \ datascience-notebook \
pyspark-notebook \ pyspark-notebook \
all-spark-notebook all-spark-notebook

View File

@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg viewBox="0 0 640 600" xmlns="http://www.w3.org/2000/svg" xmlns:inkspace="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg viewBox="0 0 832 600" xmlns="http://www.w3.org/2000/svg" xmlns:inkspace="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs_block"> <defs id="defs_block">
<filter height="1.504" id="filter_blur" inkspace:collect="always" width="1.1575" x="-0.07875" y="-0.252"> <filter height="1.504" id="filter_blur" inkspace:collect="always" width="1.1575" x="-0.07875" y="-0.252">
<feGaussianBlur id="feGaussianBlur3780" inkspace:collect="always" stdDeviation="4.2" /> <feGaussianBlur id="feGaussianBlur3780" inkspace:collect="always" stdDeviation="4.2" />
@@ -18,7 +18,8 @@
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="67" y="446" /> <rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="67" y="446" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="259" y="446" /> <rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="259" y="446" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="451" y="446" /> <rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="451" y="446" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="451" y="526" /> <rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="643" y="446" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="128" x="643" y="526" />
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="64" y="40" /> <rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="64" y="40" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="30" x="128" y="59">ubuntu</text> <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="30" x="128" y="59">ubuntu</text>
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="119" x="128" y="70">(LTS with point release)</text> <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="119" x="128" y="70">(LTS with point release)</text>
@@ -37,37 +38,43 @@
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="64" y="440" /> <rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="64" y="440" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="95" x="128" y="465">tensorflow-notebook</text> <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="95" x="128" y="465">tensorflow-notebook</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="256" y="440" /> <rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="256" y="440" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="100" x="320" y="465">datascience-notebook</text> <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="80" x="320" y="465">pytorch-notebook</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="448" y="440" /> <rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="448" y="440" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="80" x="512" y="465">pyspark-notebook</text> <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="100" x="512" y="465">datascience-notebook</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="448" y="520" /> <rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="640" y="440" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="90" x="512" y="545">all-spark-notebook</text> <text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="80" x="704" y="465">pyspark-notebook</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="128" x="640" y="520" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="9" font-style="normal" font-weight="normal" text-anchor="middle" textLength="90" x="704" y="545">all-spark-notebook</text>
<path d="M 128 80 L 128 112" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 80 L 128 112" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,119 124,112 132,112 128,119" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="128,119 124,112 132,112 128,119" stroke="rgb(0,0,0)" />
<path d="M 128 160 L 128 192" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 160 L 128 192" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,199 124,192 132,192 128,199" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="128,199 124,192 132,192 128,199" stroke="rgb(0,0,0)" />
<path d="M 128 240 L 128 272" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 240 L 128 272" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,279 124,272 132,272 128,279" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="128,279 124,272 132,272 128,279" stroke="rgb(0,0,0)" />
<path d="M 128 320 L 128 352" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,359 124,352 132,352 128,359" stroke="rgb(0,0,0)" />
<path d="M 128 320 L 128 340" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 320 L 128 340" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 340 L 320 340" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 340 L 320 340" fill="none" stroke="rgb(0,0,0)" />
<path d="M 320 340 L 320 352" fill="none" stroke="rgb(0,0,0)" /> <path d="M 320 340 L 320 352" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="320,359 316,352 324,352 320,359" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="320,359 316,352 324,352 320,359" stroke="rgb(0,0,0)" />
<path d="M 128 320 L 128 352" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,359 124,352 132,352 128,359" stroke="rgb(0,0,0)" />
<path d="M 128 320 L 128 340" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 320 L 128 340" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 340 L 512 340" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 340 L 512 340" fill="none" stroke="rgb(0,0,0)" />
<path d="M 512 340 L 512 352" fill="none" stroke="rgb(0,0,0)" /> <path d="M 512 340 L 512 352" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="512,359 508,352 516,352 512,359" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="512,359 508,352 516,352 512,359" stroke="rgb(0,0,0)" />
<path d="M 128 400 L 128 432" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,439 124,432 132,432 128,439" stroke="rgb(0,0,0)" />
<path d="M 128 400 L 128 420" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 420 L 704 420" fill="none" stroke="rgb(0,0,0)" />
<path d="M 704 420 L 704 432" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="704,439 700,432 708,432 704,439" stroke="rgb(0,0,0)" />
<path d="M 128 400 L 128 420" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 400 L 128 420" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 420 L 512 420" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 420 L 512 420" fill="none" stroke="rgb(0,0,0)" />
<path d="M 512 420 L 512 432" fill="none" stroke="rgb(0,0,0)" /> <path d="M 512 420 L 512 432" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="512,439 508,432 516,432 512,439" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="512,439 508,432 516,432 512,439" stroke="rgb(0,0,0)" />
<path d="M 128 400 L 128 432" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="128,439 124,432 132,432 128,439" stroke="rgb(0,0,0)" />
<path d="M 128 400 L 128 420" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 400 L 128 420" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 420 L 320 420" fill="none" stroke="rgb(0,0,0)" /> <path d="M 128 420 L 320 420" fill="none" stroke="rgb(0,0,0)" />
<path d="M 320 420 L 320 432" fill="none" stroke="rgb(0,0,0)" /> <path d="M 320 420 L 320 432" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="320,439 316,432 324,432 320,439" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="320,439 316,432 324,432 320,439" stroke="rgb(0,0,0)" />
<path d="M 512 480 L 512 512" fill="none" stroke="rgb(0,0,0)" /> <path d="M 704 480 L 704 512" fill="none" stroke="rgb(0,0,0)" />
<polygon fill="rgb(0,0,0)" points="512,519 508,512 516,512 512,519" stroke="rgb(0,0,0)" /> <polygon fill="rgb(0,0,0)" points="704,519 700,512 708,512 704,519" stroke="rgb(0,0,0)" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -187,6 +187,17 @@ It contains:
- Everything in `jupyter/scipy-notebook` and its ancestor images - Everything in `jupyter/scipy-notebook` and its ancestor images
- [tensorflow](https://www.tensorflow.org/) machine learning library - [tensorflow](https://www.tensorflow.org/) machine learning library
### jupyter/pytorch-notebook
[Source on GitHub](https://github.com/jupyter/docker-stacks/tree/main/images/pytorch-notebook) |
[Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/pytorch-notebook/Dockerfile) |
[Quay.io image tags](https://quay.io/repository/jupyter/pytorch-notebook?tab=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 ### jupyter/datascience-notebook
[Source on GitHub](https://github.com/jupyter/docker-stacks/tree/main/images/datascience-notebook) | [Source on GitHub](https://github.com/jupyter/docker-stacks/tree/main/images/datascience-notebook) |
@@ -234,7 +245,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. Any given image inherits the complete content of all ancestor images pointing to it.
[![Image inheritance [![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 ### Builds

View File

@@ -0,0 +1,2 @@
# Documentation
README.md

View File

@@ -0,0 +1,21 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
ARG REGISTRY=quay.io
ARG OWNER=jupyter
ARG BASE_CONTAINER=$REGISTRY/$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' \
'torch' \
'torchvision' \
'torchaudio' && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

View File

@@ -0,0 +1,8 @@
# Jupyter Notebook Deep Learning Stack
GitHub Actions in the <https://github.com/jupyter/docker-stacks> project builds and pushes this image to the Registry.
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)

View File

@@ -41,3 +41,6 @@ ignore_missing_imports = True
[mypy-tensorflow.*] [mypy-tensorflow.*]
ignore_missing_imports = True ignore_missing_imports = True
[mypy-torch.*]
ignore_missing_imports = True

View File

@@ -21,6 +21,7 @@ from tagging.taggers import (
JupyterNotebookVersionTagger, JupyterNotebookVersionTagger,
PythonMajorMinorVersionTagger, PythonMajorMinorVersionTagger,
PythonVersionTagger, PythonVersionTagger,
PytorchVersionTagger,
RVersionTagger, RVersionTagger,
SHATagger, SHATagger,
SparkVersionTagger, SparkVersionTagger,
@@ -72,6 +73,9 @@ ALL_IMAGES = {
"tensorflow-notebook": ImageDescription( "tensorflow-notebook": ImageDescription(
parent_image="scipy-notebook", taggers=[TensorflowVersionTagger()] parent_image="scipy-notebook", taggers=[TensorflowVersionTagger()]
), ),
"pytorch-notebook": ImageDescription(
parent_image="scipy-notebook", taggers=[PytorchVersionTagger()]
),
"datascience-notebook": ImageDescription( "datascience-notebook": ImageDescription(
parent_image="scipy-notebook", parent_image="scipy-notebook",
taggers=[RVersionTagger(), JuliaVersionTagger()], taggers=[RVersionTagger(), JuliaVersionTagger()],

View File

@@ -113,6 +113,12 @@ class TensorflowVersionTagger(TaggerInterface):
return "tensorflow-" + _get_pip_package_version(container, "tensorflow") 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, "torch").split("+")[0]
class JuliaVersionTagger(TaggerInterface): class JuliaVersionTagger(TaggerInterface):
@staticmethod @staticmethod
def tag_value(container: Container) -> str: def tag_value(container: Container) -> str:

View File

@@ -15,6 +15,7 @@ ALL_IMAGES = {
"r-notebook": "minimal-notebook", "r-notebook": "minimal-notebook",
"julia-notebook": "minimal-notebook", "julia-notebook": "minimal-notebook",
"tensorflow-notebook": "scipy-notebook", "tensorflow-notebook": "scipy-notebook",
"pytorch-notebook": "scipy-notebook",
"datascience-notebook": "scipy-notebook", "datascience-notebook": "scipy-notebook",
"pyspark-notebook": "scipy-notebook", "pyspark-notebook": "scipy-notebook",
"all-spark-notebook": "pyspark-notebook", "all-spark-notebook": "pyspark-notebook",

View File

@@ -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]]))