diff --git a/jupyter-tensorflow-cuda-full/rockcraft.yaml b/jupyter-tensorflow-cuda-full/rockcraft.yaml index 1f4f31d..7518749 100644 --- a/jupyter-tensorflow-cuda-full/rockcraft.yaml +++ b/jupyter-tensorflow-cuda-full/rockcraft.yaml @@ -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: | @@ -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_ @@ -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 @@ -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: @@ -69,7 +70,7 @@ parts: kubectl: plugin: nil stage-snaps: - - kubectl/1.24/stable + - kubectl/1.25/stable organize: kubectl: bin/kubectl stage: @@ -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 diff --git a/jupyter-tensorflow-cuda-full/tests/imports.py b/jupyter-tensorflow-cuda-full/tests/imports.py index 71502b2..79527fc 100755 --- a/jupyter-tensorflow-cuda-full/tests/imports.py +++ b/jupyter-tensorflow-cuda-full/tests/imports.py @@ -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 diff --git a/jupyter-tensorflow-cuda-full/tests/test_access.py b/jupyter-tensorflow-cuda-full/tests/test_access.py index b7688bd..bea6037 100644 --- a/jupyter-tensorflow-cuda-full/tests/test_access.py +++ b/jupyter-tensorflow-cuda-full/tests/test_access.py @@ -25,10 +25,10 @@ def main(): container_id = container_id[0:12] # to ensure container is started - time.sleep(5) + time.sleep(10) # 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}"]) diff --git a/jupyter-tensorflow-cuda-full/tox.ini b/jupyter-tensorflow-cuda-full/tox.ini index 659f219..3ee3136 100644 --- a/jupyter-tensorflow-cuda-full/tox.ini +++ b/jupyter-tensorflow-cuda-full/tox.ini @@ -20,7 +20,7 @@ allowlist_externals = rockcraft deps = charmed-kubeflow-chisme - juju~=2.9.0 + juju<4.0 pytest pytest-operator ops @@ -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'