Updating Anaconda Enterprise Notebooks (AEN 4.1.0)

Summary

These instructions are for upgrading Anaconda Enterprise Notebooks (AEN) to the current version 4.1 from 4.0 ONLY.

For help upgrading from a version older than 4.0, see the AEN 4.0 upgrade instructions, and contact your enterprise support representative for help.

NOTE: Named Service Account functionality is available with Anaconda Enterprise Notebooks 4.0.0+ for new installations only. It is not available for upgraded installations. Contact your enterprise support rep for more information.

An upgrade to the Anaconda Enterprise Notebooks Platform requires all instances of the three service categories to be upgraded individually:

  • AEN Server
  • AEN Gateway
  • AEN Compute

An installation of Anaconda Enterprise Notebooks typically consists of several Compute instances running on independent Compute Nodes, and multiple Gateways if there is more than one Data Center tied into AEN. More details can be found in the Overview.

The upgrade process requires that all AEN service instances be stopped, upgraded, and then restarted. These instructions describe how to perform this process.

Note: Any commands that call for the root user can also be done using sudo.

If you encounter any difficulty during the process, please refer to the Troubleshooting Guide which provides guidance on:

  • processes
  • configuration files
  • log files
  • ports

In the event you are unable to resolve an installation or upgrade problem please contact your enterprise support representative.

Pre-Flight Check

CAUTION: Make a tested backup of your installation before starting the upgrade. Upgrading to a higher version of AEN is not reversible. Any errors during the upgrade procedure may result in partial or complete data loss and require restoring data from backups.

IMPORTANT: TERMINATE ALL AEN APPS AND STOP ALL PROJECTS before starting the upgrade process.

Before upgrading each service on each host, perform the following operation:

  1. Suspend the services on each of the nodes with the following commands:

    sudo service wakari-server stop
    sudo service wakari-gateway stop
    sudo service wakari-compute stop
    
  2. Set the AEN Functional ID (NFI) and AEN Functional Group (NFG), which are described in the installation instructions.

    The NFI is the username of the AEN Service Account which is used to run all AEN services and is also the username of the AEN Admin account.

    The NFG is the Linux group that includes the AEN Service Account, so all files and directories that have the owner NFI also have the group NFG.

    When upgrading AEN, set the NFI and NFG to the NFI and NFG of the current installation.

    The default NFI is “wakari”, and “aen_admin” or any other name may be used instead.

    Set the NFI and NFG with these commands, replacing “wakari” if you are using another name:

    export AEN_SRVC_ACCT="wakari"
    export AEN_SRVC_GRP="wakari"
    

AEN Server

NOTE: If you are using LDAP-based authentication, back up the configuration file:

/opt/wakari/wakari-server/etc/wakari/wk-server-config.json

After the Server has been upgraded, copy that file back into the same location as before the upgrade.

The following operations are all done on the Server host:

  1. If you are using the search capabilities provided by ElasticSearch and a Java Runtime Environment (JRE 8):

    Stop the ElasticSearch service:

    sudo service elasticsearch stop
    

    Remove any previous index:

    sudo rm -rf /var/lib/elasticsearch/*
    

NOTE: You can choose to keep the old index but if you detect any issues with the search capabilities after the upgrade, you will need to perform the following steps to start with a clean index:

sudo service wakari-server stop
sudo service elasticsearch stop
sudo rm -rf /var/lib/elasticsearch/*
sudo service elasticsearch start
sudo service wakari-server start
  1. Upgrade the Server:

    pushd /tmp
    wget http://j.mp/aen-server-update-4_1_0
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/miniconda/bin/conda install \
                     -p /opt/wakari/wakari-server          \
                     --file aen-server-update-4_1_0
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/miniconda/bin/conda install \
                     -p /opt/wakari/wakari-server          \
                     --no-deps                             \
                     wakari-enterprise-server-conf-update=2.0.1
    popd
    
  2. Start ElasticSearch:

    sudo service elasticsearch start
    

    Or, if you do not want to use the search features, edit your server’s config.json:

    /opt/wakari/wakari-server/etc/wakari/config.json
    

    adding the line item: "SEARCH_ENABLED": false.

  3. Start the Server:

    sudo service wakari-server start
    
  4. Check that the Server is running properly:

    sudo service wakari-server status
    
  5. Finally, use your web browser to connect to AEN Server, using the correct protocol (http or https), hostname, and port number.

AEN Gateway

Repeat the following operations on each Gateway host.

  1. Upgrade the Gateway:

    pushd /tmp
    wget http://j.mp/aen-gateway-update-4_1_0
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/miniconda/bin/conda install \
                     -p /opt/wakari/wakari-gateway         \
                     --file aen-gateway-update-4_1_0
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/miniconda/bin/conda install \
                     -p /opt/wakari/wakari-gateway         \
                     --no-deps                             \
                     wakari-enterprise-gateway-conf-update=2.0.1
    popd
    
  2. Start the Gateway:

    sudo service wakari-gateway start
    
  3. Check that the Gateway is running properly:

    sudo service wakari-gateway status
    
  4. Finally, use your web browser to connect to the Gateway, using the correct protocol (http or https), hostname, and port number.

AEN Compute

Repeat the following operations on each host where an AEN Compute service is running.

The processes killed with killall are run by the $AEN_SRVC_ACCT user, so they can be killed as root with sudo killall or killed as the $AEN_SRVC_ACCT user with sudo -u $AEN_SRVC_ACCT killall. These example commands show the sudo killall option.

  1. Check for any wakari-indexer processes running:

    ps aux | grep wakari-indexer
    

    NOTE: If you stopped all the projects, you will not see any wakari-indexer processes running.

    Terminate any remaining wakari-indexer processes:

    sudo killall wakari-indexer
    
  2. Check for any AEN apps (gateone, workbench, viewer, terminal, notebook) processes running:

    ps aux | grep wk-app-gateone
    ps aux | grep wk-app-workbench
    ps aux | grep wk-app-viewer
    ps aux | grep wk-app-terminal
    ps aux | grep notebookwrapper
    

    NOTE: If you stopped all the projects, you will not see any AEN app processes running.

    Terminate any remaining AEN apps processes that you find:

    sudo killall wk-app-gateone
    sudo killall wk-app-workbench
    sudo killall wk-app-viewer
    sudo killall wk-app-terminal
    sudo killall notebookwrapper.py
    
  3. Verify the contents of /opt/wakari/anaconda/.condarc. Modify it properly to contain the following entries (and possibly others if you customized the .condarc file).

    NOTE: Modify the file as the AEN_SRVC_ACCT user (or be sure to keep the same ownership).

    channels:
      - https://conda.anaconda.org/t/<TOKEN>/anaconda-nb-extensions
      - r
      - https://conda.anaconda.org/wakari
      - defaults
    
    create_default_packages:
      - anaconda-client
      - ipykernel
    auto_update_conda: false
    

    NOTE: Contact your enterprise support representative to get your <TOKEN> for the Anaconda channel referenced above.

    NOTE: Replace <TOKEN> with the actual token from your enterprise support representative.

  4. Install necessary dependencies:

    sudo yum groupinstall "X Window System" -y
    sudo yum install libXrender libXext libSM -y
    sudo yum install git -y
    
  5. Remove any pinning to specific conda versions from Anaconda Enterprise Notebooks 4.0.0:

    sudo rm /opt/wakari/anaconda/conda-meta/pinned
    
  6. Modify the ownership of the package cache:

    sudo chown -R $AEN_SRVC_ACCT:$AEN_SRVC_GRP /opt/wakari/anaconda/pkgs
    
  7. Upgrade the Compute service.

    NOTE: From AEN 4.1.0 and above, wakari-app-gateone is deprecated and no longer supported, so we remove that package with conda here:

    pushd /tmp
    wget http://j.mp/aen-compute-update-4_1_0
    wget http://j.mp/aen-anaconda-update-4_1_0
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda install \
                     -p /opt/wakari/wakari-compute        \
                     --file aen-compute-update-4_1_0
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda remove  \
                     -p /opt/wakari/wakari-compute        \
                     wakari-app-gateone
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda install \
                     --no-deps                            \
                     -p /opt/wakari/wakari-compute        \
                     wakari-enterprise-compute-conf-update=2.0.1
    

    NOTE: When upgrading the wakari-compute environment nbextensions you may see ImportError warnings. As long as the Validating message is OK, the ImportError warnings are harmless (just a consequence of the post-link presence on those packages).

  8. Upgrade Anaconda in the root environment:

    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda install \
                     -p /opt/wakari/anaconda conda=4.2.9
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda remove  \
                     -p /opt/wakari/anaconda              \
                     spyder ipython-we pandoc keyring     \
                     ecdsa util-linux sphinx_rtd_theme    \
                     mklfft numbapro numbapro_cudalib     \
                     ncurses nlopt paramiko               \
                     wakari-client conda-manager conda-api\
                     conda_analysis_package
    
    sudo rm /opt/wakari/anaconda/lib/terminfo
    
    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda install \
                     -p /opt/wakari/anaconda              \
                     --file aen-anaconda-update-4_1_0
    popd
    
  9. Initialize the root environment to prime the package cache:

    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda create \
                     -p /opt/wakari/testenv \
                     --clone root
    

    and test the offline cloning step with:

    sudo -E -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda create \
                     -p /opt/wakari/testenvoffline \
                     --clone root --offline
    

    finally remove those test environments with:

    sudo rm -rf /opt/wakari/testenv
    sudo rm -rf /opt/wakari/testenvoffline
    
  10. Run the upgrade_410 script to make your old projects compatible with the 4.1.0 codebase:

    pushd /tmp
    wget http://j.mp/upgrade_410
    chmod a+x upgrade_410
    ./upgrade_410
    popd
    
  11. Start the Compute service:

    sudo service wakari-compute start
    
  12. Verify the Compute service is running properly:

    sudo service wakari-compute status
    

Post-Flight Check

  1. You can now start the projects and start using the AEN apps.
  2. If you have a customized default environment, you may choose to upgrade it depending on the needs of your users.

NOTE: Upgrading the default environment at /opt/wakari/anaconda/envs/default does NOT automatically upgrade the default environment in the users pre-existing projects. For pre-existing projects, the upgrade (if it is requested) should be done on a per-user basis.

  1. If you did not stop all your projects before upgrading, then the first time you start an app you will see an error page requesting you to restart the app. Restart the app to complete the upgrade and use it again.
  2. If you still see old apps or the old IPython logo in the notebook app, reload the page to reset the browser cache.