Skip to content

Commit

Permalink
remove token auth in notebook (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Dec 24, 2022
1 parent e6de047 commit 6a27ad6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*
!bin/profile-examples.sh
!jupyter_notebook_config.py
!LightGBM/lib_lightgbm.so
!LightGBM/LICENSE
!LightGBM/python-package
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-notebook
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG INSTALL_DIR=/root/testing/LightGBM
# hadolint ignore=DL3006
FROM ${BASE_IMAGE}

COPY jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
COPY LightGBM/lib_lightgbm.so ${INSTALL_DIR}/lib_lightgbm.so
COPY LightGBM/LICENSE ${INSTALL_DIR}/LICENSE
COPY LightGBM/python-package ${INSTALL_DIR}/python-package
Expand Down
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,18 @@ Every time after that, `make notebook-image` should run very quickly.

#### 2. Run a notebook locally

Start up Jupyter Lab! This command will run Jupyter Lab in a container using the image you built with `make notebook-image`.
Start up Jupyter Lab!
This command will run Jupyter Lab in a container using the image you built with `make notebook-image`.

```shell
make start-notebook
```

After running this command, you'll see some output like this:
Navigate to `http://127.0.0.1:8888/lab` in your web browser.

```text
[C 23:03:44.234 LabApp]
To access the notebook, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-19-open.html
Or copy and paste one of these URLs:
http://d96d64837199:8888/?token=e8aa897c8afbbbc559976854a78cc9effe957a912270f7bf
or http://127.0.0.1:8888/?token=e8aa897c8afbbbc559976854a78cc9effe957a912270f7bf
```

Copy the URL starting with `http://127.0.0.1` and paste it into your web browser. This will open Jupyter Lab.

The command `make start-notebook` mounts your current working directory into the running container. That means that even though Jupyter Lab is running inside the container, changes that you make in it will be saved on your local filesystem even after you shut the container down. So you can edit and create notebooks and other code in there with confidence!
The command `make start-notebook` mounts your current working directory into the running container.
That means that even though Jupyter Lab is running inside the container, changes that you make in it will be saved on your local filesystem even after you shut the container down.
So you can edit and create notebooks and other code in there with confidence!

When you're done with the notebook, stop the container by running the following from another shell:

Expand Down
4 changes: 4 additions & 0 deletions jupyter_notebook_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.open_browser = False
c.ServerApp.ip = "localhost"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = LightGBM
exclude = jupyter_notebook_config.py,LightGBM
max-line-length = 100
ignore =
# module level import not at top of file
Expand Down

0 comments on commit 6a27ad6

Please sign in to comment.