Skip to content

Commit

Permalink
Improve handling of tensorboard (#2126)
Browse files Browse the repository at this point in the history
* Improve handling of tensorboard

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Improve style

* Move bash file to cuda-subdir

* Update tensorflow-notebook info

* Fix redirect link

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 1, 2024
1 parent 7f6f16c commit 1ad688e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/using/selecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ It contains:
`jupyter/tensorflow-notebook` includes popular Python deep learning libraries.

- 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 Server Proxy](https://jupyter-server-proxy.readthedocs.io/en/latest/) to support [TensorBoard](https://www.tensorflow.org/tensorboard)

### jupyter/pytorch-notebook

Expand Down
6 changes: 5 additions & 1 deletion images/tensorflow-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install tensorflow with pip, on x86_64 tensorflow-cpu
RUN [[ $(uname -m) = x86_64 ]] && TF_POSTFIX="-cpu" || TF_POSTFIX="" && \
pip install --no-cache-dir "tensorflow${TF_POSTFIX}" && \
pip install --no-cache-dir \
"tensorflow${TF_POSTFIX}" \
"jupyter-server-proxy" && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

COPY --chown="${NB_UID}:${NB_GID}" cuda/20tensorboard-proxy-env.sh /usr/local/bin/before-notebook.d/
10 changes: 10 additions & 0 deletions images/tensorflow-notebook/cuda/20tensorboard-proxy-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

set -e

# Initialize the TENSORBOARD_PROXY_URL with the appropriate path
# to use jupyter-server-proxy.

export TENSORBOARD_PROXY_URL="${JUPYTERHUB_SERVICE_PREFIX:-/}proxy/%PORT%/"
6 changes: 5 additions & 1 deletion images/tensorflow-notebook/cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install TensorFlow, CUDA and cuDNN with pip
RUN pip install --no-cache-dir "tensorflow[and-cuda]" && \
RUN pip install --no-cache-dir \
"tensorflow[and-cuda]" \
"jupyter-server-proxy" && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"

COPY --chown="${NB_UID}:${NB_GID}" 20tensorboard-proxy-env.sh /usr/local/bin/before-notebook.d/

# workaround for https://github.com/tensorflow/tensorflow/issues/63362
RUN mkdir -p "${CONDA_DIR}/etc/conda/activate.d/" && \
fix-permissions "${CONDA_DIR}"
Expand Down

0 comments on commit 1ad688e

Please sign in to comment.