Article ID: 000094885 Content Type: Install & Setup Last Reviewed: 06/08/2023

Creating Customer Kernel on Intel® Developer Cloud for the Edge

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Quick steps to install and use additional python packages on Intel® Developer Cloud for the Edge.

Description
  • Launched Jupyter Notebook on Intel® Developer Cloud for the Edge
  • Ran into an error due to a missing python* package
Resolution

Follow these steps to create a custom kernel, add it to JupyterLab and submit the job to an edge node.

  1. Open the Terminal on Intel Developer Cloud for the Edge
  2. Create a virtual environment in your home directory and install the required packages

    virtualenv --python=/usr/bin/python3.8 ~/venv/openvino_2022.2.0_python3.8_custom

    source ~/venv/openvino_2022.2.0_python3.8_custom/bin/activate

    pip install -U pip

    pip install wheel jupyterhub jupyterlab-widgets==1.1.0 widgetsnbextension==3.6.0

    pip install openvino==2022.2.0 tensorflow <missing package name>

  3.  Create the kernel file

    mkdir -p ~/.local/share/jupyter/kernels/custom

    cat > ~/.local/share/jupyter/kernels/custom/kernel.json <<EOF

    {

    "argv":[

    "$HOME/venv/openvino_2022.2.0_python3.8_custom/bin/python3",

    "-m",

    "ipykernel_launcher",

    "-f",

    "{connection_file}"

    ],

    "display_name": "Python3.8 (OpenVINO 2022.2.0) Custom",

    "language": "python",

    "env": {"PBS_DEFAULT": "v-qsvr-1", "VENV_PATH": "$HOME/venv/openvino_2022.2.0_python3.8_custom"}

    }

    EOF

  4. From the top menu, click File -> Hub Control Panel and stop the Server.
  5.  Click Start My Server
  6. Create a new Jupyter Notebook and select the custom kernel from the top right dropdown.
  7. Copy the following code into individual cells

    %%writefile main.py import <missing package name> print("Done Importing")

     

    %%writefile run.sh cd $PBS_O_WORKDIR source $HOME/venv/openvino_2022.2.0_python3.8_custom/bin/activate python3 --version python3 main.py

     

    #Submit job to the queue job_id_cpu = !qsub run.sh -l nodes=1:idc082 -N test print(job_id_cpu[0])

  8. Open the job output file ( e.g. custom_kernel_job.o851554) and confirm you see the following

    # Resources: neednodes=1:idc082,nodes=1:idc082,walltime=01:00:00 ######################################################################## Python 3.8.0 Done Importing ######################################################################## # End of output for job 851554.v-qsvr-1.devcloud-edge

Related Products

This article applies to 1 products