Skip to content
Merged
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
2 changes: 1 addition & 1 deletion doc/run/k8s/install-sqlflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
- containerPort: 8888
name: notebook
command:
- bash
- sh
- -c
- 'export SQLFLOW_DATASOURCE=mysql://root:root@tcp\(${MY_POD_IP}:3306\)/?maxAllowedPacket=0 && jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root --NotebookApp.token=""'
env:
Expand Down
5 changes: 4 additions & 1 deletion docker/jupyter/install-jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ set -e
wget -q http://cdn.sqlflow.tech/alpine/py3-pandas-1.0.3-r0.apk
wget -q -P /etc/apk/keys/ http://cdn.sqlflow.tech/alpine/sqlflow-5ef80180.rsa.pub
apk add py3-pandas-1.0.3-r0.apk && rm py3-pandas-1.0.3-r0.apk
# Dependencies for jupyterhub
apk add py3-cryptography py3-ruamel.yaml.clib py3-requests

pip -q install \
jupyterhub==1.1.0 \
notebook \
sqlflow==0.10.0

# Load SQLFlow's Jupyter magic command
# automatically. c.f. https://stackoverflow.com/a/32683001.
IPYTHON_STARTUP="/root/.ipython/profile_default/startup/"
mkdir -p "$IPYTHON_STARTUP"
mkdir -p /workspace
mkdir -p /workspace/jupyter
{ echo 'get_ipython().magic(u"%reload_ext sqlflow.magic")';
echo 'get_ipython().magic(u"%reload_ext autoreload")';
echo 'get_ipython().magic(u"%autoreload 2")'; } \
Expand Down
4 changes: 2 additions & 2 deletions docker/jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
'Brings SQL and AI together. <a href="https://sqlflow.org">https://sqlflow.org</a>'
}]
c.KubeSpawner.cmd = [
"bash", "-c",
"sh", "-c",
"export SQLFLOW_DATASOURCE=mysql://root:root@tcp\(${MY_POD_IP}:3306\)/?maxAllowedPacket=0 && \
export SQLFLOW_SERVER=${SQLFLOW_SERVER_SERVICE_HOST}:${SQLFLOW_SERVER_SERVICE_PORT} && start-notebook.sh"
export SQLFLOW_SERVER=${SQLFLOW_SERVER_SERVICE_HOST}:${SQLFLOW_SERVER_SERVICE_PORT} && jupyterhub-singleuser jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root --notebook-dir=/workspace/"
]

c.KubeSpawner.extra_containers = [{
Expand Down