Bring Your Own Workbench Images
Use a BYO (bring your own) image when the built-in Workbench images do not
contain the framework, system library, or internal tooling that your team needs.
The image must be available to the cluster, and a cluster administrator must
register it in a WorkspaceKind before it appears in the Workbench creation
form.
This guide covers two supported approaches:
- Derive an image from an Alauda Workbench image. This is the recommended approach because the base image already contains the Workbench-compatible Jupyter or code-server startup configuration.
- Build a Jupyter Workbench image from a vendor accelerator image. This is useful when you need a particular CUDA or Ascend CANN version, but you must provide the IDE startup contract yourself and validate it on the target cluster.
TOC
WorkflowChoose the base imageStart with an Alauda Workbench imageChoose a CUDA base imageChoose an Ascend CANN base imageBuild by extending an Alauda imageBuild from a CUDA or CANN imageCUDA exampleAscend CANN exampleCreate a WorkspaceKindCUDA WorkspaceKindAscend NPU WorkspaceKindCreate and verify the WorkbenchBuild and security recommendationsWorkflow
The complete workflow is:
- Choose a base image that matches the target node architecture and driver stack.
- Build and test the image, then push it to a registry reachable by the Workbench namespace.
- Create a
WorkspaceKindthat points at the image and declares its Jupyter port and resource options. - Create a Workbench from that
WorkspaceKind, then verify the pod, device, and IDE logs.
The image registry, Kubernetes namespace, and Workbench service account are cluster-specific. Replace the placeholders in the examples with values from your environment.
Choose the base image
Start with an Alauda Workbench image
Use an Alauda image when you only need to add Python packages, CLI tools, or organization-specific code. Select an image from the available Workbench images, then pin the exact tag or digest used by your cluster.
Typical starting points include:
The image names and package versions can change between releases. Confirm the tag in the Workbench image table or the matching Docker Hub repository before building. For production builds, record the resolved digest:
Choose a CUDA base image
For a from-scratch NVIDIA image, choose the CUDA tag from the official
nvidia/cuda repository. A tag encodes
the CUDA version, cuDNN inclusion, image purpose, and Linux distribution. Use a
devel variant when the image build needs to compile CUDA or Python extensions;
use a runtime variant when all dependencies are already built.
The CUDA version in the image must be supported by the NVIDIA driver on the
target nodes. The image does not install or upgrade the host driver. Before
choosing a tag, check the NVIDIA CUDA/driver compatibility documentation and
confirm that the cluster has the NVIDIA device plugin and container runtime
configured. Also check the image architecture: Workbench CUDA images in this
guide target linux/amd64 unless the selected CUDA tag explicitly provides
another platform.
For example, this is a build base only; replace the tag with the CUDA version validated for your nodes:
Choose an Ascend CANN base image
For a from-scratch Ascend image, choose the CANN tag from the official
openeuler/cann repository. Select
the tag whose CANN version, openEuler base, and architecture match the Ascend
driver and firmware installed on the target nodes. CANN compatibility is a
vendor stack concern: do not select the newest image by default or install a
different CANN release into an existing image without checking the release
compatibility matrix.
The image does not install or upgrade the host Ascend driver. The cluster must
already provide the Ascend device plugin and expose the resource name used by
your hardware, for example huawei.com/Ascend910B4. Confirm the node
architecture and driver state before building:
For example, this is a build base only; replace the tag with the CANN release validated for your nodes:
Build by extending an Alauda image
This is the preferred path for a normal Jupyter Workbench. It preserves the base image's user, entrypoint, Jupyter configuration, and filesystem layout. Only install the packages that are specific to your workload.
Build and push it with an OCI-capable builder. Use --platform explicitly when
the build host and Workbench nodes have different architectures:
For an Ascend image, use the arm64 Alauda CANN image as BASE_IMAGE and build
with --platform linux/arm64. Do not mix an amd64 base image with an arm64
Workbench node, even if the image registry accepts the push.
Build from a CUDA or CANN image
Building from a vendor image gives you control over the accelerator stack, but it also makes your image responsible for the Workbench runtime. At minimum, the image must:
- run as a non-root user accepted by the cluster's Pod Security Admission;
- contain Python, JupyterLab, and Jupyter Server (or the IDE you expose);
- start an HTTP server on the port declared in the
WorkspaceKind; - honor the Workbench route prefix (
NB_PREFIX) when the platform supplies it; - write the user's home directory to the mounted home PVC; and
- avoid installing host drivers in the container.
The following launcher is a minimal Jupyter example for a from-scratch image. Production images should add a pinned dependency lock file, health checks, and an approved package mirror.
CUDA example
Use a CUDA devel tag when packages need compilation. If all packages are
prebuilt, a smaller runtime tag may be sufficient. The ubuntu version and
Python version below are examples; pin versions that are supported by your
selected CUDA tag.
Build for NVIDIA nodes and verify the CUDA runtime before registering it:
Ascend CANN example
Use an openeuler/cann tag that matches the node's CANN/driver/firmware
combination. CANN images commonly provide set_env.sh; source it before
starting Jupyter so the CANN libraries and compiler paths are visible. Install
torch and torch-npu from the wheel source specified by the matching CANN
release; a generic PyPI version may not be compatible with the device stack.
Use the same launcher as the CUDA example, but source CANN first:
Build for the architecture exposed by the Ascend nodes:
Test this image on an Ascend node, not only on the build host. For example,
verify npu-smi info, import torch_npu, and run a small device operation from
inside a pod with the same resource request as the Workbench:
Create a WorkspaceKind
WorkspaceKind is cluster-scoped. The imageConfig option selects the image,
and the podConfig option selects resources and node placement. The service
account must already exist in every namespace where users create Workspaces.
For a private registry, attach an imagePullSecret to that service account or
configure it according to your cluster's image-pull policy.
The examples below intentionally use separate WorkspaceKind resources. This
keeps the CUDA image on NVIDIA nodes and the CANN image on Ascend nodes.
Replace <workbench-service-account>, <cluster>, resource names, and image
tags before applying them.
CUDA WorkspaceKind
Ascend NPU WorkspaceKind
Apply the resources as a cluster administrator:
If an existing managed Jupyter WorkspaceKind already has the correct route,
security context, service account, and resource options, you can register an
additional image instead of creating a new WorkspaceKind. Add an item to
spec.podTemplate.options.imageConfig.values[] and preserve the existing
entries. The Create Workbench page contains a JSON
patch example for this migration path.
Create and verify the Workbench
-
Open Alauda AI and go to Workbench.
-
Click Create and select
JupyterLab | BYO CUDAorJupyterLab | BYO Ascend CANN. -
Select the resource option that matches the image and node hardware.
-
Wait for the Workbench status to become
Running, then click Connect. -
In a terminal, verify the architecture, framework, and accelerator:
For CUDA, also run
nvidia-smiand a framework CUDA availability check. For CANN, runnpu-smi infoand importtorch_npu.
If the Workspace does not start, inspect the image pull, scheduling, and container logs first:
Common causes are an image tag that is not present in the registry, a missing
image-pull secret, an architecture mismatch, an unsupported host driver, a
missing accelerator device plugin, or a WorkspaceKind resource name that
does not exist on the target nodes. On Ascend vNPU clusters, add the device-file
group to supplementalGroups; fsGroup alone may not grant access to
/dev/davinci*.
Build and security recommendations
- Pin the base image, Python packages, and final image by tag plus digest in CI.
- Build and scan the image in CI; do not install large or privileged packages when the Workbench starts.
- Run as non-root and make the mounted home directory writable by the runtime
UID/GID. Do not add
privileged: trueto make an accelerator appear. - Mirror all bases and packages into approved internal registries for an
air-gapped cluster, then use the mirrored image in
WorkspaceKind. - Keep CUDA and CANN images separate. A CUDA image belongs on NVIDIA nodes and an Ascend image belongs on Ascend nodes; the host driver and device plugin are supplied by the cluster, not by the container image.