ML Workspace Documentation
repository·main·Indexed 25 days ago
https://github.com/ml-tooling/ml-workspaceAn all-in-one web-based development environment for machine learning and data science. It provides a full Linux desktop GUI accessible via browser, featuring integrated IDEs like Jupyter, JupyterLab, and VS Code, along with libraries such as TensorFlow, PyTorch, Keras, and Sklearn. Available in multiple Docker image flavors including Minimal, R, Spark, and GPU (with CUDA 11.2 support).
What's inside ML Workspace
- ML Workspace is an all-in-one web-based IDE specialized for machine learning and data science. It provides a pre-configured environment with popular data science libraries (Tensorflow, PyTorch, Keras, Sklearn) and development tools (Jupyter, JupyterLab, VS Code, Tensorboard) integrated into a full Linux desktop GUI accessible via a web browser. It can be deployed on Mac, Linux, and Windows using Docker.
Overview of Jupyter Tooling Extension
mainThe Jupyter Tooling extension is a Jupyter extension designed to provide a proxy and direct links to various configured development tools within the Jupyter environment.Overview of ML Workspace GPU-flavor
mainML Workspace [GPU-flavor] is an all-in-one, web-based development environment specifically designed for machine learning tasks. It provides a pre-configured environment that includes GPU support, making it suitable for deep learning and intensive ML workloads.Manage Git repositories and notebooks
mainThe workspace includes several tools for Git integration:
- Cloning: Navigate to a folder and click the
gitbutton to openungit, a web-based Git client. You can clone repositories and handle authentication withinungit. - Notebook Git Actions: Use the integrated Jupyter Git plugin to commit and push single notebooks.
- Advanced Git: Use
ungitfor branching, tagging, pulling, and merging. - Notebook Diffing/Merging:
nbdimeis pre-installed to handle intelligent diffing and merging of JSON-based notebook files. - Plain Text Notebooks:
jupytextallows you to open, edit, and run.pyor.mdfiles as notebooks within Jupyter.
- Cloning: Navigate to a folder and click the
Use the correct python/pip version in Jupyter Notebooks
mainWhen using a dedicated Jupyter Kernel for a virtual environment or a specific Python version, standard shell commands like
!pip install matplotlibmay use the wrong Python/pip instance. To ensure you are using the version associated with the current kernel, use the following pattern in a notebook cell:import sys !{sys.executable} -m pip install matplotlibPersist data in ML Workspace
mainTo ensure your work is not lost when the container restarts, you must mount a volume to the/workspacedirectory using the-vflag. The/workspacedirectory is the default working directory and the root of the Jupyter instance. Data stored in other directories (like/root) will be lost on restart.Use the workspace as a remote Jupyter kernel
mainYou can use the workspace as a remote runtime for a local Jupyter instance using
remote_ikernel.- Install the tool locally:
pip install remote_ikernel. - The workspace SSH setup script will offer to configure the remote kernel automatically.
- To manage kernels manually:
# Add a remote kernel remote_ikernel manage --add \ --interface=ssh \ --kernel_cmd="ipython kernel -f {connection_file}" \ --name="ml-server (Python)" \ --host="my-workspace" # List kernels remote_ikernel manage --show # Delete a kernel remote_ikernel manage --delete <REMOTE_KERNEL_NAME>- Install the tool locally:
Build the GPU workspace flavor
mainTo build the
gpuflavor, update CUDA tooling based on NVIDIA container images and ensure compatibility with TensorFlow and PyTorch. Build the flavor using thebuild.pyscript. Verify GPU access by runningnvidia-smiin the terminal and testing the GPU interface in Netdata and Glances.python build.py --flavor=gpuBuild the minimal workspace flavor
mainTo build the
minimalflavor of the workspace, use thebuild.pyscript with the--makeand--flavor=minimalflags. After building, verify the container by checking startup logs, comparing image layer sizes in Portainer, and checking folder sizes viaDisk Usage Analyzerwithin the Desktop VNC.python build.py --make --flavor=minimalCustomize the workspace image with a Dockerfile
mainYou can create a custom workspace flavor by extending an existing image in a Dockerfile. This allows you to include your own software or specific configurations. Use the
$RESOURCES_PATHenvironment variable to access provided installation scripts.# Extend from any of the workspace versions/flavors FROM mltooling/ml-workspace:0.13.2 # Run you customizations, e.g. RUN \ # Install r-runtime, r-kernel, and r-studio web server from provided install scripts /bin/bash $RESOURCES_PATH/tools/r-runtime.sh --install && \ /bin/bash $RESOURCES_PATH/tools/r-studio-server.sh --install && \ # Cleanup Layer - removes unneccessary cache files clean-layer.shEnable authentication for ML Workspace
mainAuthentication is required to secure access to all pre-installed tools. It is recommended to use one of the following two methods:
1. Token-based Authentication via Jupyter (Recommended)
Set
AUTHENTICATE_VIA_JUPYTERto a specific token string or<generated>to have Jupyter print a random token in the logs.docker run -p 8080:8080 --env AUTHENTICATE_VIA_JUPYTER="mytoken" mltooling/ml-workspace:0.13.22. Basic Authentication via Nginx
Set
WORKSPACE_AUTH_USERandWORKSPACE_AUTH_PASSWORD. This is configured via the nginx proxy and may be more performant.docker run -p 8080:8080 --env WORKSPACE_AUTH_USER="user" --env WORKSPACE_AUTH_PASSWORD="pwd" mltooling/ml-workspace:0.13.2Update minimal and light flavor Python requirements
mainUse tools like
piprot,pur, orpip-upgraderto update the requirement files located in./resources/libraries/.Using piprot:
piprot ./resources/libraries/requirements-minimal.txt piprot ./resources/libraries/requirements-light.txtUsing pur:
pur -i -r ./resources/libraries/requirements-minimal.txt