jupyter-on-openshift / jupyter-notebooks

OpenShift compatible S2I builder for basic notebook images.
Apache License 2.0
54 stars 111 forks source link

Cannot deploy app based on scipy-notebook template #24

Open aagara opened 4 years ago

aagara commented 4 years ago

When deploying the template, the template fails with the following error

ERROR: don't know how to run your application. Please set either APP_MODULE, APP_FILE or APP_SCRIPT environment variables, or create a file 'app.py' to launch your application.

The environment is OpenShift 4.3

Here is what I have done.

Successfully created s2i-minimal-notebook and ran it by attaching to a persistent volume. As a next step tried building and deploying the scipy-template.

oc apply -f s2i-scipy-notebook.json

The build configuration is below

{ "kind": "List", "apiVersion": "v1", "items": [ { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "s2i-scipy-notebook", "labels": { "build": "s2i-scipy-notebook" } }, "spec": { "lookupPolicy": { "local": true } } }, { "kind": "BuildConfig", "apiVersion": "build.openshift.io/v1", "metadata": { "name": "s2i-scipy-notebook-py36", "labels": { "build": "s2i-scipy-notebook" } }, "spec": { "triggers": [ { "type": "ConfigChange" }, { "type": "ImageChange" } ], "source": { "type": "Git", "git": { "uri": "https://github.com/jupyter-on-openshift/jupyter-notebooks", "ref": "2.5.1" }, "contextDir": "scipy-notebook" }, "strategy": { "type": "Source", "sourceStrategy": { "from": { "kind": "ImageStreamTag", "name": "s2i-minimal-notebook:3.6" } } }, "output": { "to": { "kind": "ImageStreamTag", "name": "s2i-scipy-notebook:3.6" } }, "resources": { "limits": { "memory": "3Gi" } } } } ] }

The build log is

Cloning "https://github.com/jupyter-on-openshift/jupyter-notebooks" ... Commit: 3caf4f2bff7c3ae665234f63034421965aa013aa (Merge branch 'release/2.5.1') Author: Graham Dumpleton Graham.Dumpleton@gmail.com Date: Sat Nov 30 14:24:57 2019 +1100 Caching blobs under "/var/cache/blobs". Getting image source signatures Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2 Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b Copying blob sha256:c8106f599d69375cbfc2ef44b11812ddc33938ab1e94860b02c262118f837611 Copying blob sha256:d796d9c455b3bb7953bfc479ad682ad206dc1fed8dda0feff247ce5ae2b7f7ef Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412 Copying blob sha256:6a4fa4bc2d06e942c0e92d69614b4ee30c2d409c95f29a3a22ece8087ce164be Copying config sha256:fe58f0d156ce4570484e00c72fc5382064b09644f9321061c55c55c7dbd3c9e8 Writing manifest to image destination Storing signatures Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/custom-namespace/s2i-minimal-notebook@sha256:cbd4e8258e4b7bb84e810129e364d1243c549a32cc52f4869edb98d15bb7e6cb STEP 1: FROM image-registry.openshift-image-registry.svc:5000/custom-namespace/s2i-minimal-notebook@sha256:cbd4e8258e4b7bb84e810129e364d1243c549a32cc52f4869edb98d15bb7e6cb STEP 2: LABEL "io.openshift.build.commit.author"="Graham Dumpleton Graham.Dumpleton@gmail.com" "io.openshift.build.commit.date"="Sat Nov 30 14:24:57 2019 +1100" "io.openshift.build.commit.id"="3caf4f2bff7c3ae665234f63034421965aa013aa" "io.openshift.build.commit.ref"="2.5.1" "io.openshift.build.commit.message"="Merge branch 'release/2.5.1'" "io.openshift.build.source-location"="https://github.com/jupyter-on-openshift/jupyter-notebooks" "io.openshift.build.source-context-dir"="scipy-notebook" "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/custom-namespace/s2i-minimal-notebook@sha256:cbd4e8258e4b7bb84e810129e364d1243c549a32cc52f4869edb98d15bb7e6cb" STEP 3: ENV XDG_CACHE_HOME="/opt/app-root/src/.cache" OPENSHIFT_BUILD_NAME="s2i-scipy-notebook-py36-1" OPENSHIFT_BUILD_NAMESPACE="custom-namespace" OPENSHIFT_BUILD_SOURCE="https://github.com/jupyter-on-openshift/jupyter-notebooks" OPENSHIFT_BUILD_REFERENCE="2.5.1" OPENSHIFT_BUILD_COMMIT="3caf4f2bff7c3ae665234f63034421965aa013aa" STEP 4: USER root STEP 5: COPY upload/scripts /tmp/scripts STEP 6: COPY upload/src /tmp/src STEP 7: RUN chown -R 1001:0 /tmp/scripts /tmp/src STEP 8: USER 1001 STEP 9: RUN /tmp/scripts/assemble

Pushing image image-registry.openshift-image-registry.svc:5000/custom-namespace/s2i-scipy-notebook:3.6 ... Getting image source signatures Copying blob sha256:84e620d0abe585d05a7bed55144af0bc5efe083aed05eac1e88922034ddf1ed2 Copying blob sha256:6a4fa4bc2d06e942c0e92d69614b4ee30c2d409c95f29a3a22ece8087ce164be Copying blob sha256:c8106f599d69375cbfc2ef44b11812ddc33938ab1e94860b02c262118f837611 Copying blob sha256:bb13d92caffa705f32b8a7f9f661e07ddede310c6ccfa78fb53a49539740e29b Copying blob sha256:455ea8ab06218495bbbcb14b750a0d644897b24f8c5dcf9e8698e27882583412 Copying blob sha256:d796d9c455b3bb7953bfc479ad682ad206dc1fed8dda0feff247ce5ae2b7f7ef Copying blob sha256:56f9c969c0265bdb920b12db283a1be54e84445d8f4abb71627894744daff78a Copying config sha256:16e589a7d0c21d90f7ca665f1f8fbce02c945b1c867c67bee9a948eec453de9d Writing manifest to image destination Storing signatures Successfully pushed image-registry.openshift-image-registry.svc:5000/custom-namespace/s2i-scipy-notebook@sha256:3d391f19e46c5943a74444bda0dd42dd2efa0dc5a6890c79aab0fc4e84d02db2 Push successful

==================================================================================

oc process -f openshift-jupyter-dc-template.yaml -p APPLICATION_NAME=scipy-notebook -p NOTEBOOK_IMAGE='s2i-scipy-notebook:3.6' -p SUPPLEMENTAL_GROUPS=200300 -p NOTEBOOK_PASSWORD=secret -p VOLUME_SIZE=5Gi | oc create -f -

The set-up volume takes a while to run. I had to configure timeoutSeconds more than 600 seconds for it to complete. Not sure the log of set-up volume is required.

Any help to resolve this issue is greatly appreciated.

Thanks -Arun

GrahamDumpleton commented 4 years ago

What is the definition of the container for the deployment in:

Looks to me like you are overriding the start command for the container and not using the default the image sets up.

aagara commented 4 years ago

I used the notebook-workspace.json as the base template and added one more parameter. The start command is only for the initialization container. Below is the entire yaml. Please let me know if something I have modified is incorrect.


kind: Template apiVersion: template.openshift.io/v1 metadata: name: notebook-workspace annotations: openshift.io/display-name: Jupyter Notebook Workspace description: Template for deploying Jupyter Notebook images with persistent storage and webdav filesystem access. iconClass: icon-python tags: python,jupyter parameters: