You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate start-notebook & start-singleuser to python (#2006)
* Migrate start-notebook.sh to bash
Based on
> Stop using bash, haha 👍
from #1532.
If there's more apetite for this, I'll try to migrate
`start.sh` and `start-singleuser.sh` as well - I think they should
all be merged together. We can remove the `.sh` suffixes for
accuracy, and keep symlinks in so old config still works. Since
the shebang is what is used to launch the correct interpreter,
the `.sh` doesn't matter.
Will help fix#1532,
as I believe all those things are going to be easier to do from
python than bash
* Rename start-notebook.sh to start-notebook
* Cleanup start-notebook a little
* Fix typo
* Migrate start-singleuser as well
* Remove unused import
* Run symlink commands as root
* Combine repetitive RUN commands
* Remove multiple args to env
-u can not be set by shebang, we must set the env var
instead
* Fix conditional inversion
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
* Fix how start-singleuser is exec'd
* Actually call jupyterhub-singleuser in start-singleuser
* Pass through any additional args we get
* Put .py suffix on the start-* scripts
* Add .sh shims for the start-* scripts
* Document start-notebook.sh and start-singleuser.sh
* Partially test start-notebook.sh
* Reflow warning docs
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
---------
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ system when the container exits, but any changes made to the `~/work` directory
65
65
By default, [jupyter's root_dir](https://jupyter-server.readthedocs.io/en/latest/other/full-config.html) is `/home/jovyan`.
66
66
So, new notebooks will be saved there, unless you change the directory in the file browser.
67
67
68
-
To change the default directory, you will need to specify `ServerApp.root_dir` by adding this line to previous command: `start-notebook.sh --ServerApp.root_dir=/home/jovyan/work`.
68
+
To change the default directory, you will need to specify `ServerApp.root_dir` by adding this line to previous command: `start-notebook.py --ServerApp.root_dir=/home/jovyan/work`.
Copy file name to clipboardExpand all lines: docs/using/common.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,34 @@
1
1
# Common Features
2
2
3
3
Except for `jupyter/docker-stacks-foundation`, a container launched from any Jupyter Docker Stacks image runs a Jupyter Server with the JupyterLab frontend.
4
-
The container does so by executing a `start-notebook.sh` script.
4
+
The container does so by executing a `start-notebook.py` script.
5
5
This script configures the internal container environment and then runs `jupyter lab`, passing any command-line arguments received.
6
6
7
7
This page describes the options supported by the startup script and how to bypass it to run alternative commands.
8
8
9
9
## Jupyter Server Options
10
10
11
-
You can pass [Jupyter Server options](https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html) to the `start-notebook.sh` script when launching the container.
11
+
You can pass [Jupyter Server options](https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html) to the `start-notebook.py` script when launching the container.
12
12
13
13
1. For example, to secure the Jupyter Server with a [custom password](https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html#preparing-a-hashed-password)
14
14
hashed using `jupyter_server.auth.passwd()` instead of the default token,
15
15
you can run the following (this hash was generated for the `my-password` password):
16
16
17
17
```bash
18
18
docker run -it --rm -p 8888:8888 jupyter/base-notebook \
2. To set the [base URL](https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html#running-the-notebook-with-a-customized-url-prefix) of the Jupyter Server, you can run the following:
23
23
24
24
```bash
25
25
docker run -it --rm -p 8888:8888 jupyter/base-notebook \
You may instruct the `start-notebook.sh` script to customize the container environment before launching the Server.
31
+
You may instruct the `start-notebook.py` script to customize the container environment before launching the Server.
32
32
You do so by passing arguments to the `docker run` command.
33
33
34
34
### User-related configurations
@@ -104,7 +104,7 @@ You do so by passing arguments to the `docker run` command.
104
104
You do **not** need this option to allow the user to `conda` or `pip` install additional packages.
105
105
This option is helpful for cases when you wish to give `${NB_USER}` the ability to install OS packages with `apt` or modify other root-owned files in the container.
106
106
You **must** run the container with `--user root` for this option to take effect.
107
-
(The `start-notebook.sh` script will `su ${NB_USER}` after adding `${NB_USER}` to sudoers.)
107
+
(The `start-notebook.py` script will `su ${NB_USER}` after adding `${NB_USER}` to sudoers.)
108
108
**You should only enable `sudo` if you trust the user or if the container runs on an isolated host.**
109
109
110
110
### Additional runtime configurations
@@ -147,7 +147,7 @@ For example, to mount a host folder containing a `notebook.key` and `notebook.cr
Copy file name to clipboardExpand all lines: docs/using/running.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Any other changes made in the container will be lost.
69
69
By default, [jupyter's root_dir](https://jupyter-server.readthedocs.io/en/latest/other/full-config.html) is `/home/jovyan`.
70
70
So, new notebooks will be saved there, unless you change the directory in the file browser.
71
71
72
-
To change the default directory, you will need to specify `ServerApp.root_dir` by adding this line to previous command: `start-notebook.sh --ServerApp.root_dir=/home/jovyan/work`.
72
+
To change the default directory, you will need to specify `ServerApp.root_dir` by adding this line to previous command: `start-notebook.py --ServerApp.root_dir=/home/jovyan/work`.
0 commit comments