-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from guimou/streamlit
Addition of Streamlit notebook
- Loading branch information
Showing
35 changed files
with
4,341 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.DS_Store | ||
*.bundle.* | ||
lib/ | ||
node_modules/ | ||
*.egg-info/ | ||
.ipynb_checkpoints | ||
*.tsbuildinfo | ||
*.lock | ||
__pycache__ | ||
|
||
# Ensure embedme does not run ont node_modules README.md files. | ||
**/node_modules/**/README.md | ||
|
||
static | ||
labextension | ||
**/test-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Streamlit Notebook | ||
|
||
Custom notebook based on RHODS standard data science notebook, adding: | ||
|
||
* [Streamlit](https://streamlit.io/) ([Github repo](https://github.com/streamlit/streamlit)) | ||
|
||
Streamlit turns data scripts into shareable web apps in minutes. | ||
All in pure Python. No front‑end experience required. | ||
|
||
 | ||
|
||
## Usage | ||
|
||
On top of the Streamlit package itself, this image includes jupyter-server-proxy and a custom JupyterLab extension to easily launch your files. | ||
|
||
You can either: | ||
|
||
* From the main menu bar, click on the Streamlit menu item, then Select file. In the dialog box select the file to launch with Streamlit. | ||
* From the file browser on the left, right-click on the file you want to launch. The Streamlit option in the contextual menu only shows if you selected a Python file. | ||
|
||
A new Terminal will open in your JupyterLab, launch Streamlit and give you information on where the app is accessible. And a new tab will open automatically in your browser to display the app! | ||
|
||
To shut down the Streamlit app you simply have to close the Terminal window, it will also shut down the associated Kernel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM quay.io/thoth-station/s2i-minimal-f34-py39-notebook:v0.3.0 | ||
|
||
LABEL name="s2i-generic-data-science-streamlit-notebook:latest" \ | ||
summary="Generic Data Science Jupyter Notebook Source-to-Image for Python 3.9 applications." \ | ||
description="Notebook image based on Source-to-Image.These images can be used in OpenDatahub JupterHub." \ | ||
io.k8s.description="Notebook image based on Source-to-Image.These images can be used in OpenDatahub JupterHub." \ | ||
io.k8s.display-name="Generic Data Science with Streamlit Notebook Python 3.9-ubi8 S2I" \ | ||
io.openshift.expose-services="8888:http" \ | ||
io.openshift.tags="python,python39" \ | ||
authoritative-source-url="https://quay.io/guimou/s2i-generic-data-science-streamlit-notebook" \ | ||
io.openshift.s2i.build.commit.ref="main" \ | ||
io.openshift.s2i.build.source-location="https://github.com/guimou/custom-notebooks" \ | ||
io.openshift.s2i.build.image="quay.io/thoth-station/s2i-minimal-f34-py39-notebook:v0.2.2" | ||
|
||
USER root | ||
|
||
WORKDIR /tmp/ | ||
|
||
# Copying custom packages | ||
COPY Pipfile Pipfile.lock /tmp/ | ||
RUN micropipenv install --deploy && \ | ||
rm -rf /opt/app-root/lib/python3.9/site-packages/~* | ||
|
||
# Streamlit extenstion installation | ||
COPY streamlit-launcher.sh /opt/app-root/bin/ | ||
COPY streamlit-menu/dist/jupyterlab_streamlit_menu-0.1.0-py3-none-any.whl /tmp/ | ||
|
||
# Install packages and cleanup upgrades | ||
RUN pip install --no-cache-dir /tmp/jupyterlab_streamlit_menu-0.1.0-py3-none-any.whl | ||
|
||
RUN jupyter lab build && \ | ||
jupyter lab clean && \ | ||
npm cache clean --force && \ | ||
rm -rf /usr/local/share/.cache/yarn && \ | ||
fix-permissions /opt/app-root | ||
|
||
WORKDIR /opt/app-root/src | ||
USER 1001 | ||
|
||
CMD /opt/app-root/bin/start-singleuser.sh --ip=0.0.0.0 --port=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
beautifulsoup4 = "==4.6.3" | ||
bokeh = "~=2.4.3" | ||
boto3 = "==1.24.2" | ||
cloudpickle = "~=2.1.0" | ||
cython = "==0.29.30" | ||
dask = "2022.5.2" | ||
dill = "~=0.3.5.1" | ||
distributed = "2022.5.2" | ||
elyra-python-editor-extension = "==3.9.0" | ||
h5py = "~=3.7.0" | ||
ipywidgets = "~=7.7.0" | ||
jupyter_kernel_gateway = "~=2.5.0" | ||
jupyter-bokeh = "~=3.0.4" | ||
jupyter-nbrequirements = "*" | ||
jupyter-server-proxy = "~=3.2.1" | ||
jupyterhub = "~=1.5.0" | ||
jupyterlab = "~=3.4.2" | ||
jupyterlab-git = "~=0.37.0" | ||
jupyterlab-requirements = "~=0.16.0" | ||
jupyterlab-spellchecker = "~=0.7.2" | ||
jupyterlab-tabnine = "==0.0.24" | ||
kafka-python = "~=2.0.2" | ||
matplotlib = "~=3.5.2" | ||
notebook = "~=6.4.0" | ||
numpy = "~=1.22.4" | ||
pandas = "~=1.4.2" | ||
plotly = "~=5.8.0" | ||
pre-commit = "~=2.19.0" | ||
pyarrow = "~=8.0.0" | ||
scikit-image = "~=0.19.2" | ||
scikit-learn = "~=1.1.1" | ||
scipy = "~=1.8.1" | ||
seaborn = "~=0.11.2" | ||
sqlalchemy = "~=1.4.37" | ||
statsmodels = "~=0.13.2" | ||
streamlit = "~=1.9.2" | ||
supervisor = "~=4.2.0" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.9" | ||
|
||
[pipenv] | ||
allow_prereleases = true |
Oops, something went wrong.