opendatahub-io-contrib / workbench-images

Various custom Workbenches and Runtimes for Open Data Hub and OpenShift Data Science
MIT License
35 stars 23 forks source link

issues with path when launching streamlit #6

Closed erwangranger closed 2 years ago

erwangranger commented 2 years ago

I saw this when testing a streamlit app that was using a local csv file.

The command to launch streamlit looks like:

streamlit-launcher.sh -f streamlit-showcase/app.py -p 8503 -s https://jupyterhub-redhat-ods-applications.apps.cluster.openshiftapps.com/user/mysuer/proxy/8503/

The problem is that if I have the following structure:

(app-root) (app-root) ls -al streamlit-showcase/
-rw-r--r--.  1 1000970000 1000970000      0 Jun 23 18:16 app.py
-rw-r--r--.  1 1000970000 1000970000     66 Jun 23 18:15 file.csv

it would be safe to assume that app.py will refer to either file.csv or ./file.csv.

But because we launched from one folder up (streamlit-launcher.sh -f streamlit-showcase/app.py) we don't find the csv file.

Therefore, if it is possible, I think it would be better if the launch sequence was:

cd streamlit-showcase/
streamlit-launcher.sh -f app.py -p 8503 -s https://jupyterhub-redhat-ods-applications.apps.cluster.openshiftapps.com/user/mysuer/proxy/8503/
guimou commented 2 years ago

Fixed with #8, in release 0.0.11