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

jupyter pytorch geometric v1 <do not merge> #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
59 changes: 59 additions & 0 deletions jupyter_pytorch_geometric/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
ARG OWNER=jupyter
ARG BASE_CONTAINER=$OWNER/tensorflow-notebook
FROM $BASE_CONTAINER

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

# Fix DL4006
# SHELL ["/bin/bash", "-o", "pipefail", "-c"]

USER root

RUN apt update --yes && apt install --yes build-essential

USER ${NB_UID}

# Install Mamba gator
RUN mamba install --quiet --yes \
'conda-forge::mamba_gator' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#add-a-python-3-x-environment
ARG conda_env=python37
ARG py_ver=3.7

# you can add additional libraries you want mamba to install by listing them below the first line and ending with "&& \"
# RUN mamba create --quiet --yes -p "${CONDA_DIR}/envs/${conda_env}" python=${py_ver} ipython ipykernel && \
# cudatoolkit=11.3.1 && \
# cudnn=8.2.1 && \
# mamba clean --all -f -y

# alternatively, you can comment out the lines above and uncomment those below
# if you'd prefer to use a YAML file present in the docker build context

COPY --chown=${NB_UID}:${NB_GID} environment.yml "/home/${NB_USER}/tmp/"
RUN cd "/home/${NB_USER}/tmp/" && \
mamba env create -p "${CONDA_DIR}/envs/${conda_env}" -f environment.yml && \
mamba clean --all -f -y


# create Python 3.x environment and link it to jupyter
RUN "${CONDA_DIR}/envs/${conda_env}/bin/python" -m ipykernel install --user --name="${conda_env}" && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

# any additional pip installs can be added by uncommenting the following line
# RUN "${CONDA_DIR}/envs/${conda_env}/bin/pip" install tensorflow
RUN conda install pytorch cudatoolkit=11.3 pyg -c pytorch -c pyg -c conda-forge

# prepend conda environment to path
ENV PATH "${CONDA_DIR}/envs/${conda_env}/bin:${PATH}"

# if you want this environment to be the default one, uncomment the following line:
ENV CONDA_DEFAULT_ENV ${conda_env}

USER root
28 changes: 28 additions & 0 deletions jupyter_pytorch_geometric/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: python37

channels:
- nvidia
- conda-forge
- defaults
- pytorch
- pyg

dependencies:
- python=3.7
- ipykernel
# Install cuda libs + ptxas compiler from nvidia channel
# This will accelerate the compilation of kernels for your specific card
- cudatoolkit=11.3
- cudnn=8
- cupti=11.3
- cuda-nvcc
- pyg
- pytorch-lightning
- ffmpeg
- pip
- pip:
- tensorflow==2.6.*
- matplotlib
- pandas
- seaborn
- scikit-learn