Jupyter Setup - WM-SEMERU/SemeruGuidelines GitHub Wiki

Prerequisites

Please go through the following material to get accustomed to this way of developing:

Steps to start developing in one of the Jupyter Notebooks

  • Log into Semeru Tower 2 via the command: ssh -L 8004:localhost:8004 [email protected] -p 11612. Figure out which docker container you need to connect to via the command: docker ps
    • docker
    • Look for the “Names” row that lines up with the image “ds4se”
  • Connect to the docker container via the command: docker exec -it <name> /bin/bash
  • Open up in a browser to: localhost:8004
    • If prompted for a token run the command jupyter notebook list and copy and paste the token for jupyter server
  • Now you should be able to edit any of the jupyter notebooks.

Things to consider while developing in Jupyter Notebooks

  • Jupyter notebooks are not collaborative, i.e., two people cannot work on the same notebook at the same time. So, be careful not to accidentally overwrite other’s work accidentally. Generally, make sure to claim a “lock” on a particular notebook by sending a message in Slack. Also, release locks by also messaging in Slack when you are done developing in a notebook
  • Before pushing any changes make sure to build the library and the docs so that everything is up to date that goes into the repository
    • This can be done via the CLI with nbdev_build_lib and nbdev_build_docs
    • Or to build the lib using Python code, just add the following code snippet to the end of your notebook and run it:
      • from nbdev.export import notebook2script
      • notebook2script()
    • This will create additional files that you need to add and commit to git, so make sure to add them before pushing
  • Also, as a general rule, please do a git pull before pushing, but please work inside the master branch as if you try and change to a different branch, you will be changing the branch for everyone using the same Docker Container.
⚠️ **GitHub.com Fallback** ⚠️