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

feat: update jupyter tensorflow cuda rock for 1.8 #48

Open
wants to merge 4 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
19 changes: 10 additions & 9 deletions jupyter-tensorflow-cuda-full/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on the following Dockerfiles:
# https://github.com/kubeflow/kubeflow/blob/v1.7-branch/components/example-notebook-servers/base/Dockerfile
# https://github.com/kubeflow/kubeflow/blob/v1.7-branch/components/example-notebook-servers/jupyter/Dockerfile
# https://github.com/kubeflow/kubeflow/blob/v1.7-branch/components/example-notebook-servers/jupyter-tensorflow-full/cuda.Dockerfile
# https://github.com/kubeflow/kubeflow/blob/v1.8-branch/components/example-notebook-servers/base/Dockerfile
# https://github.com/kubeflow/kubeflow/blob/v1.8-branch/components/example-notebook-servers/jupyter/Dockerfile
# https://github.com/kubeflow/kubeflow/blob/v1.8-branch/components/example-notebook-servers/jupyter-tensorflow-full/cuda.Dockerfile
name: jupyter-tensorflow-cude-full
summary: An image for using Jupyter & Tensorflow on GPUs
description: |
Expand All @@ -11,7 +11,7 @@ description: |

Both Tensorflow and Jupyter are installed in Conda environment, which is
automatically activated.
version: v1.7.0_20.04_1
version: v1.8.0_20.04_1
license: Apache-2.0
base: ubuntu:20.04
run-user: _daemon_
Expand All @@ -21,8 +21,9 @@ services:
summary: "jupyter-tensorflow-cuda-full service"
startup: enabled
environment:
NB_USER: jovyan
NB_UID: 1001
# The following environment variables need to be specified in the Pod's environment, and not hardcoded.
#HOME: ""
#NB_PREFIX: ""
NB_PREFIX: /
HOME: /home/jovyan
SHELL: /bin/bash
Expand All @@ -31,7 +32,7 @@ services:
LC_ALL: en_US.UTF-8
PATH: /opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PYTHONPATH: /opt/conda/lib/python3.8/site-packages/
command: ./jupyter lab --notebook-dir="/home/jovyan" --ip=0.0.0.0 --no-browser --port=8888 --ServerApp.token="" --ServerApp.password="" --ServerApp.allow_origin="*" --ServerApp.base_url="/" --ServerApp.authenticate_prometheus=False
command: bash -c './jupyter lab --notebook-dir=${HOME} --ip=0.0.0.0 --no-browser --port=8888 --ServerApp.token="" --ServerApp.password="" --ServerApp.allow_origin="*" --ServerApp.base_url=${NB_PREFIX} --ServerApp.authenticate_prometheus=False'
working-dir: /opt/conda/bin/
platforms:
amd64:
Expand Down Expand Up @@ -69,7 +70,7 @@ parts:
kubectl:
plugin: nil
stage-snaps:
- kubectl/1.24/stable
- kubectl/1.25/stable
organize:
kubectl: bin/kubectl
stage:
Expand All @@ -94,7 +95,7 @@ parts:
plugin: nil
source: https://github.com/kubeflow/kubeflow
source-type: git
source-tag: v1.7-branch # upstream branch
source-tag: v1.8-branch # upstream branch
build-packages:
- curl
- lsb-release
Expand Down
3 changes: 2 additions & 1 deletion jupyter-tensorflow-cuda-full/tests/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# This python script tests loading of required modules
#
import tensorflow as tf
import kfp
# TO-DO verfiy proper kfp import. Upgrade might be needed.
#import kfp
import kfp_server_api
import kfserving
import bokeh
Expand Down
4 changes: 2 additions & 2 deletions jupyter-tensorflow-cuda-full/tests/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def main():
container_id = container_id[0:12]

# to ensure container is started
time.sleep(5)
time.sleep(10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to use tenacity here as in other ROCKs.


# retrieve notebook server URL
output = subprocess.run(["curl", "http://127.0.0.1:8888/lab"], stdout=subprocess.PIPE).stdout.decode('utf-8')
output = subprocess.run(["curl", "http://0.0.0.0:8888/lab"], stdout=subprocess.PIPE).stdout.decode('utf-8')
# cleanup
subprocess.run(["docker", "stop", f"{container_id}"])
subprocess.run(["docker", "rm", f"{container_id}"])
Expand Down
4 changes: 2 additions & 2 deletions jupyter-tensorflow-cuda-full/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ allowlist_externals =
rockcraft
deps =
charmed-kubeflow-chisme
juju~=2.9.0
juju<4.0
pytest
pytest-operator
ops
Expand All @@ -29,7 +29,7 @@ commands =
rockcraft pack
bash -c 'NAME=$(yq eval .name rockcraft.yaml) && \
VERSION=$(yq eval .version rockcraft.yaml) && \
ARCH=$(yq eval ".platforms | keys" rockcraft.yaml | awk -F " " '\''{ print $2 }'\'') && \
ARCH=$(yq eval -r ".platforms | keys" rockcraft.yaml | cut -d" " -f2) && \
ROCK="$\{NAME\}_$\{VERSION\}_$\{ARCH\}" && \
sudo skopeo --insecure-policy copy oci-archive:$ROCK.rock docker-daemon:$ROCK:$VERSION && \
docker save $ROCK > $ROCK.tar'
Expand Down