Open Source for IBM Z and LinuxONE

Open Source for IBM Z and LinuxONE

Open Source for IBM Z and LinuxONE

Your one-stop destination to share, collaborate and learn about the latest innovations in open source software for s390x processor architecture (IBM Z and LinuxONE)

 View Only

Install Jupyterhub on IBM LinuxONE (S390x) VM

By Manogya Sharma posted Mon February 12, 2024 05:02 AM

  

Install Jupyterhub on LinuxONE VM


JupyterHub gives user groups access to laptop power. It allows users to access resources and computing environments without requiring them to perform installation or maintenance work.
Users can complete their work in their workspaces using shared resources that system administrators can effectively manage.

Jupyterhub can be easily installed on X86 architecture with minimal effort.

conda install -c conda-forge jupyterhub   # on X86 Arch VM

On the other hand, because of missing dependencies in the Anaconda default channel and conda-forge community channel, we can not directly install Jupyterhub on S390x architecture VMs.
To install Jupyterhub inside s390x VM I followed a different approach which I am describing in this blog.

This process consists of two main steps:
  • Creating ruamel.yaml.clib conda package with the help of feedstock.
  • Consuming this package with other dependencies of Jupyterhub during installation.


Creating ruamel.yaml.clib conda package with the help of feedstock


S390x is a Big Endian CPU arch and ruamel.yaml.clib has an open bug related to this hence we need to apply a patch and build the ruamel.yaml.clib package with the help of feedstock.

1.  Clone the repo https://github.com/manogy/ruamel.yaml.clib-feedstock.git

      git clone https://github.com/manogy/ruamel.yaml.clib-feedstock.git
 

2.  change the directory to recipe
 
  cd ruamel.yaml.clib-feedstock/recipe
 
3.  
    Make sure you are in the base environment of the conda unless you want to use a specific conda environment. 
    If the conda-build package is not installed please install it with the below command.
   
    conda install conda-build
   
4.  To build the conda package run the below command (from the recipe folder).

   
    conda build .
   

5. The above command will start the build of the package, once it completes it will generate the last lines of the log similar to the below lines,

Here /root/miniconda3/conda-bld is the channel name which conda-build created and created the conda package.

   

        # Automatic uploading is disabled
        # If you want to upload package(s) to anaconda.org later, type:


        # To have conda build upload to anaconda.org automatically, use
        # conda config --set anaconda_upload yes
        anaconda upload \
            /root/miniconda3/conda-bld/linux-s390x/ruamel.yaml.clib-0.2.7-py310ha92ec59_2.tar.bz2
        anaconda_upload is not set.  Not uploading wheels: []

        INFO :: The inputs making up the hashes for the built packages are as follows:
        {
        "ruamel.yaml.clib-0.2.7-py310ha92ec59_2.tar.bz2": {
            "recipe": {
            "c_compiler": "gcc",
            "target_platform": "linux-s390x"
            }
        }
        }


        ####################################################################################
        Resource usage summary:

        Total time: 0:00:53.9
        CPU usage: sys=0:00:00.2, user=0:00:05.3
        Maximum memory usage observed: 200.2M
      Total disk usage observed (not including envs): 2.7  


Consuming this package with other dependencies of Jupyterhub during installation.

Previous Steps will create a conda package that we need to install during our Jupyterhub installation.

Here I am creating a conda environment with the name "jupyterhub-test".
As a Prerequisite make sure Nodejs is available on the VM.

In my VM nodejs version 16 was installed. I installed some other packages as well on the base VM / conda environment.


  • Install configurable-http-proxy on the VM globally by running the below command:
npm install -g configurable-http-proxy
  • Create a new conda env with the desired name
conda create -n jupyterhub-test

  • Activate the conda env and install the required packages
conda activate jupyterhub-test

conda install python=3.10.13 cryptography=41.0.7 notebook jupyterlab ipykernel libsodium ruamel.yaml


Install the Jupyterhub with ruamel.yaml.clib package which we created with Feedstock


  • Install the ruamel.yaml.clib package like below, here /root/miniconda3/conda-bld is the channel name that we get during the build process.

conda install ruamel.yaml.clib -c /root/miniconda3/conda-bld

  • Install Jupyterhub with the help of the PIP command

pip install jupyterhub==4.0.2 --no-cache-dir


Now Jupyter Hub has been installed, which can be used by the user.


### Example:

09:06:59 |jupyterhub-test|root@manogya1 ~ → uname
Linux
09:07:03 |jupyterhub-test|root@manogya1 ~ → uname -m
s390x
09:07:09 |jupyterhub-test|root@manogya1 ~ → jupyterhub
[I 2024-02-07 09:07:18.364 JupyterHub app:2859] Running JupyterHub version 4.0.2
[I 2024-02-07 09:07:18.364 JupyterHub app:2889] Using Authenticator: jupyterhub.auth.PAMAuthenticator-4.0.2
[I 2024-02-07 09:07:18.364 JupyterHub app:2889] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-4.0.2
[I 2024-02-07 09:07:18.364 JupyterHub app:2889] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-4.0.2
[I 2024-02-07 09:07:18.369 JupyterHub app:1664] Loading cookie_secret from /root/jupyterhub_cookie_secret
[I 2024-02-07 09:07:18.423 JupyterHub proxy:556] Generating new CONFIGPROXY_AUTH_TOKEN
[I 2024-02-07 09:07:18.451 JupyterHub app:1984] Not using allowed_users. Any authenticated user will be allowed.
[I 2024-02-07 09:07:18.463 JupyterHub app:2928] Initialized 0 spawners in 0.001 seconds
[I 2024-02-07 09:07:18.467 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.twenty_four_hours
[I 2024-02-07 09:07:18.468 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.seven_days
[I 2024-02-07 09:07:18.468 JupyterHub metrics:278] Found 0 active users in the last ActiveUserPeriods.thirty_days
[W 2024-02-07 09:07:18.468 JupyterHub proxy:625] Found proxy pid file: /root/jupyterhub-proxy.pid
[W 2024-02-07 09:07:18.469 JupyterHub proxy:637] Proxy no longer running at pid=4381
[W 2024-02-07 09:07:18.470 JupyterHub proxy:746] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else...
[I 2024-02-07 09:07:18.470 JupyterHub proxy:750] Starting proxy @ http://:8000
09:07:18.741 [ConfigProxy] info: Proxying http://*:8000 to (no default)
09:07:18.746 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes


For more information please refer to my GitHub repository.


Other Ways to Run Jupyter Notebook on LinuxOne VM.

  • Cloud Pak for Data provided Jupyter Notebooks with a much more advanced layer of security and data connectivity.
    Notebooks provided by CPD on IBM Z systems and LinuxOne are tightly knit with Project, which provides many capabilities like loading of data with drag and drop
    and auto-generation of code snippets to load the data. A Quick Introduction to Notebooks on CPD as a Service ( hosted on IBM cloud ) is available in a Demo video.
    For detailed information refer to the Documents available on IBM's official website.
  • The notebook can be run on the LinuxOne Community Cloud. Details are available at the jupyter-lab-ml Github.
0 comments
13 views

Permalink