Installing Jupyter Notebooks for Team Studio Version 6.3.x and Earlier

Follow this procedure to enable Jupyter Notebooks for Team Studio. It includes instructions for installing and configuring the Jupyter Notebook server, as well as configuring Team Studio to connect to the server, then steps to perform simple tests.

These instructions apply only to Jupyter Notebooks for Team Studio installation versions 6.3.x or earlier.

Prerequisites

You must have administrative privileges on the server.

Procedure

  1. Install and configure the Jupyter Notebook Server.
    • Identify the host to install as a Jupyter Notebook server. This host should have the following prerequisites met:
      • Specify 4+ CPU cores for the host.
        nproc
      • Specify 8+ GB RAM for the host.
        cat /proc/meminfo | grep MemTotal
      • Specify 40+ GB of disk space for the host.
        df -h
      • Set the hostname.
        hostname -f
      • Specify a Red Hat/CentOS or SUSE distribution, and with Linux kernel version >3.0, or 2.6.
        cat /etc/redhat-release
        uname -r
        Note: If you are on a Linux kernel that is less than 3.10, you might see this message when starting Docker:
        [root@alpineqa3 ~]# docker -d
        WARN[0000] You are running linux kernel version 2.6.32-431.11.2.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.10.0.
        INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
        docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
        
        The solution is:
        [root@alpineqa3 ~]# sudo yum update
      • Install the basic packages and updates.
        yum -y install lsof wget screen ed telnet iotop unzip & yum -y update
    • Identify a user to run the Jupyter Notebook server. In a customer site, root can be blocked, so a user such as tdsts should be identified for this purpose. Create the user if it does not already exist:
      useradd tdsts
      passwd tdsts
    • Set up Docker:
      curl -fsSL https://get.docker.com/ | sh
      usermod -aG docker tdsts
      service docker start
      useradd tdsts
      usermod -aG docker tdsts
      su - tdsts
    • Install the ChorusCommander package. This should be provided by Team Studio support.
      wget https://s3.amazonaws.com/alpine-distro/alpine_connectors_<version>.zip
      unzip chorus_notebook-<version>.zip
      cd chorus_notebook-<version>
      chmod +x chorus_notebook-<version>.sh
      ./chorus_notebook-<version>.sh
       ..................................................
      [install] No CHORUS_NOTEBOOK_HOME detected, preparing a fresh install
       
      Enter the installation path: /data/chorus/notebooks
      **********************************************************
      Install is complete, to start the chorus notebook service:
      cd /data/chorus/notebooks                                       
      ./start-notebook-server                                    
      **********************************************************
    • Configure the Jupyter Notebook settings and edit $CHORUS_NOTEBOOK_HOME/settings.cfg. No settings should need modification for basic use.
      DEBUG=True
      HOST="0.0.0.0"
      PORT=8000
      # notebook data directory: the base dir when starting the notebook server
      # default will be $CHORUS_NOTEBOOK_HOME/notebook_data
      #NOTEBOOK_DATA_DIR=./notebook_data
      # max concurrent users
      #MAX_CONCURRENT_USERS=10
      # default command to execute
      #COMMAND="jupyter notebook --config=chorus_notebook_config.py"
      # default memory per container
      #MEM_LIMIT_PER_CONTAINER="512m"
      # the CPU core that the container will use.
      #If the machine has 2 cores, the value can be:
      # 0
      # 1
      # 0,1
      # default value will be all the available cores.
      #CPUSET_CPUS=""
      #ssl key and certfile if want to enable ssl
      #CERTFILE=
      #KEYFILE=
    • Start the Jupyter Notebook server and verify that it is running on port 8000:
      $ ./start-notebook-server
      $ tail -n 20 /home/chorus/notebook.log
       * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
       * Restarting with stat
       * Debugger is active!
       * Debugger pin code: 118-590-655
      $ netstat -nlp | grep 8000
      tcp   0    0 0.0.0.0:8000    0.0.0.0:*             LISTEN      27932/python        
  2. Configure Team Studio to communicate with Notebook Server:
    • Log in to the Team Studio host, and verify you can ping and access the Jupyter Notebook server on port 8000:
      $ ping notebooks2.alpinenow.local
      PING notebooks2.alpinenow.local (10.10.6.44) 56(84) bytes of data.
      64 bytes from 10.10.6.44: icmp_seq=1 ttl=64 time=0.262 ms
      64 bytes from 10.10.6.44: icmp_seq=2 ttl=64 time=0.263 ms
      64 bytes from 10.10.6.44: icmp_seq=3 ttl=64 time=0.274 ms
      64 bytes from 10.10.6.44: icmp_seq=4 ttl=64 time=0.281 ms
      64 bytes from 10.10.6.44: icmp_seq=5 ttl=64 time=0.353 ms
       
      $ telnet notebooks2.alpinenow.local 8000
      Trying 10.10.6.44...
      Connected to notebooks.alpinenow.local.
      Escape character is '^]'.
      
    • Navigate to the $CHORUS_HOME/ shared directory:
      $ cd $CHORUS_HOME/shared
    • Edit the chorus.properties file, and add the following lines to the bottom of the file. Set the notebook_server.docker_manager_host and notebook_server.docker_container_host to the hostname or IP address of your notebook server.
      # Jupyter Notebook Settings
      notebooks.enabled=true
      notebook_server.host_api_version=4.1.0
      notebook_server.docker_manager_host=<IP ADDRESS>
      notebook_server.docker_container_host=<IP ADDRESS>
      notebook_server.docker_manager_port=8000
    • Add the public_url key. Verify that this is set to the FQDN of your Team Studio host in chorus.properties. This value is used to set HTTP security so the Jupyter Notebook can display in Team Studio. When you have completed this task, save and exit your text editor.
      public_url=nate.alpinenow.local
    • Restart the Team Studio web server:
      $ chorus_control.sh restart webserver