mimoralea / gdrl

Grokking Deep Reinforcement Learning
https://www.manning.com/books/grokking-deep-reinforcement-learning
BSD 3-Clause "New" or "Revised" License
798 stars 231 forks source link

Empty notebooks folder #7

Closed juan-sv closed 3 years ago

juan-sv commented 3 years ago

Hello,

I'm trying to execute the notebooks from docker image, but when I run the container and log in into jupyter notebook, the notebook/folder list is empty.

gdrl

I cloned the repository and CD to the gdrl directory. I'm using Docker Toolbox with Oracle Virtual Box to execute either:

The logs when spinning the docker container are:

$ docker run -it --rm -p 8888:8888 -v "$PWD"/notebooks/:/mnt/notebooks/ mimoralea/gdrl:v0.14
Container must be run with group "root" to update passwd file
Executing the command: jupyter notebook
[I 13:28:52.426 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 13:28:58.160 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 13:28:58.166 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 13:29:02.874 NotebookApp] Serving notebooks from local directory: /mnt/notebooks
[I 13:29:02.880 NotebookApp] The Jupyter Notebook is running at:
[I 13:29:02.883 NotebookApp] http://ba85e00e685a:8888/
[I 13:29:02.884 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

when I log into Jupyter Notebook (See error in line 10):

[W 13:31:50.797 NotebookApp] Clearing invalid/expired login cookie username-192-168-99-101-8888
[W 13:31:50.806 NotebookApp] Forbidden
[W 13:31:50.816 NotebookApp] 403 GET /api/sessions?_=1608384680945 (192.168.99.1) 28.33ms referer=http://192.168.99.101:8888/tree?
[W 13:31:50.836 NotebookApp] Clearing invalid/expired login cookie username-192-168-99-101-8888
[W 13:31:50.838 NotebookApp] Forbidden
[W 13:31:50.845 NotebookApp] 403 GET /api/terminals?_=1608384680946 (192.168.99.1) 8.98ms referer=http://192.168.99.101:8888/tree?
[W 13:31:50.856 NotebookApp] Clearing invalid/expired login cookie username-192-168-99-101-8888
[W 13:31:50.861 NotebookApp] Clearing invalid/expired login cookie username-192-168-99-101-8888
[I 13:31:50.864 NotebookApp] 302 GET /tree? (192.168.99.1) 10.72ms
[E 13:31:50.973 NotebookApp] Could not open static file ''
[W 13:31:51.152 NotebookApp] 404 GET /static/components/react/react-dom.production.min.js (192.168.99.1) 90.56ms referer=http://192.168.99.101:8888/login?next=%2Ftree%3F
[I 13:31:53.770 NotebookApp] 302 POST /login?next=%2Ftree%3F (192.168.99.1) 3.23ms
[W 13:31:54.074 NotebookApp] 404 GET /static/components/react/react-dom.production.min.js (192.168.99.1) 2.61ms referer=http://192.168.99.101:8888/tree?
[W 13:31:54.131 NotebookApp] 404 GET /static/components/react/react-dom.production.min.js (192.168.99.1) 13.17ms referer=http://192.168.99.101:8888/tree?

Thanks for the support

mimoralea commented 3 years ago

Hey, Juan. I don't use Windows, so I won't be able to help. However, after a quick search, I noticed Docker Toolbox is deprecated: https://docs.docker.com/docker-for-windows/docker-toolbox/. And obviously, make sure that you actually have the notebooks in the ./notebooks directory, that's from the gdrl folder. You should be able to ls notebooks and see the list of per-chapter folders the same as this: https://github.com/mimoralea/gdrl/tree/master/notebooks.

Once you figure it out, please come back and let folks know what the issue was.

boyko11 commented 3 years ago

Container must be run with group "root" to update passwd file It seems you have to have root privilegies to do this? I'd try running again logged in as root, but if that's not an option, I'd try sudo docker run -it --rm -p 8888:8888 -v "$PWD"/notebooks/:/mnt/notebooks/ mimoralea/gdrl:v0.14 If this says something along the lines of <your_username> is not in the sudoers file then you may find this helpful: Add To Sudoers File Hope this helps!

Edit: I just noticed the same line shows up in my output. But I can see all the notebooks - it works fine for me. So this root message might be just red herring. The missing part for you is the 'signing notebook' lines though. Here's what it looks like on my Win machine:

`docker run -it --rm -p 8888:8888 -v %CD%/notebooks/:/mnt/notebooks/ mimoralea/gdrl:v0.14 [TrustNotebookApp] Writing notebook-signing key to /home/jovyan/.local/share/jupyter/notebook_secret Signing notebook: /mnt/notebooks/chapter_02/chapter-02.ipynb Signing notebook: /mnt/notebooks/chapter_03/chapter-03.ipynb Signing notebook: /mnt/notebooks/chapter_04/chapter-04.ipynb Signing notebook: /mnt/notebooks/chapter_05/chapter-05.ipynb Signing notebook: /mnt/notebooks/chapter_06/chapter-06.ipynb Signing notebook: /mnt/notebooks/chapter_07/chapter-07.ipynb Signing notebook: /mnt/notebooks/chapter_08/chapter-08.ipynb Signing notebook: /mnt/notebooks/chapter_09/chapter-09.ipynb Signing notebook: /mnt/notebooks/chapter_10/chapter-10.ipynb Signing notebook: /mnt/notebooks/chapter_11/chapter-11.ipynb Signing notebook: /mnt/notebooks/chapter_12/chapter-12.ipynb Container must be run with group "root" to update passwd file Executing the command: jupyter notebook [I 14:30:20.050 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret [I 14:30:22.145 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab [I 14:30:22.145 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab [I 14:30:23.623 NotebookApp] Serving notebooks from local directory: /mnt/notebooks [I 14:30:23.623 NotebookApp] The Jupyter Notebook is running at: [I 14:30:23.623 NotebookApp] http://e076f7812446:8888/ [I 14:30:23.624 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [I 14:30:34.969 NotebookApp] 302 GET / (172.17.0.1) 1.81ms

juan-sv commented 3 years ago

Thanks @mimoralea, @boyko11,

I finally got it! The problem was using Docker Toolbox, but I can't upgrade to Docker Desktop, because my old PC doesn't meet the requirements. I found the answer here. The solution: