Wednesday, May 13, 2020

Setting up remote Jupyter Notebook

I have recently started reading the book Python for Finance. In chapter 2 the writer explains how to use Docker for professional development and Digital Ocean to run a remote Jupyter Notebook for cloud based development. The scripts provided in the book are good for linux but throw a host of problems when working with windows. Thought will compile a list of issues to watch for. Also the online portal for the book does not provide the scripts in a file, so providing those as well to save you some typing. I assume you have the book for reference.

Firstly, I was not able to use the script in example 2.5 to set up a Droplet. So, I followed the following steps:
  1. Used PuttyGen to generate an SSH key (see footnote on example 2.5 page)
  2. Add the public key to your Digital Ocean Account (Account>Settings>Security)
  3. Set up the Droplet as prescribed in the book, using the SSH key we added above
  4. Turn on your Droplet and open the console. Create a shell file using the editor of your choice which should look like this. Note this will ask for your input to create RSA keys.
  5. Bash the file as "bash install.sh"
  6. Under /root/.jupyter, you can update the jupyter_notebook_config.py file as per the guidance provided in the book. Activate the conda shell as "source activate -py4fi" and start the Jupyter notebook manually with command "jupyter notebook --allow-root". This should get you running. To turn off your droplet use "poweroff" command from the console to avoid any data loss.
AN issue I faced on digital ocean:
The command line interface can sometimes get stuck with caps lock such that whatever you write or paste is in CAPS

Also, I may point out that setting up a secure Jupyter server may be a bit more involved than what we see in the book, as you can find on the official website. I would advise looking at the auto-generated file, which is quite descriptive.

No comments:

Post a Comment

Trading212 ISA: A Brilliant Choice Brilliantly Ignored!

 As far as tax saving schemes are concerned, Stock & Shares ISAs are an amazing value for money for knowledgeable retail investors. £20,...