Introduction, Access & Resource Requests

Teaching: 25 min · Exercises: 0 min · Total: 25 min

Launch the workspace in JupyterHub

▶ Launch the workspace in JupyterHub — signs you in at jh-training.nrp-nautilus.io, pulls the repo, and opens JupyterLab in the training workspace directory on the training GPU nodes.

Time: 00:00-00:25

This section gets everyone into the NAIRR Pilot Classroom training environment, confirms that the JupyterHub terminal has kubectl access, and shows how accelerator requests appear both in the NRP portal and in Kubernetes manifests.

Run all commands from a JupyterHub terminal. Command blocks are formatted for copy/paste into that terminal.

Schedule

TopicOutcome
NRP overviewUnderstand where JupyterHub, Kubernetes, GPUs, and Qualcomm Cloud AI 100 SoCs fit.
Access with CILogonLog into the training JupyterHub and open the tutorial workspace.
Resource portalInspect available hardware, quotas, and allocation paths.
Kubernetes resource requestsLaunch a small GPU request on the workshop reservation and clean it up.

NRP Overview

The National Research Platform (NRP) is a shared national cyberinfrastructure built on the Nautilus Kubernetes cluster. It provides hundreds of nodes, many NVIDIA GPU types, Qualcomm Cloud AI 100 Ultra devices, shared storage, and services such as JupyterHub, GitLab, Coder, and S3.

The core mental model is:

  1. CILogon authenticates users through institutional identity providers.
  2. JupyterHub gives each participant a browser-based JupyterLab workspace and terminal.
  3. Kubernetes useris interact with the cluster directly via commnd line tools.
  4. YAML manifests describe the compute resources a workload needs.
  5. Device plugins expose accelerators such as NVIDIA GPUs and Qualcomm Cloud AI 100 SoCs to Kubernetes.

NAIRR Classroom Provider

NAIRR1


NAIRR2

Capabilities

Scale

Dashboard image
Click to reveal more

NRP

Useful links for the live session:

Kubernetes basics (quick intro)

Kubernetes is a system for running applications on a cluster by managing workloads (things you want to run) and keeping them in the desired state.

Most interactions with Kubernetes involve creating and updating resources (objects) described in YAML.

Typical workflow:

  1. Write or edit a YAML manifest
  2. Apply it to the cluster (e.g., kubectl apply -f ...)
  3. Check status and troubleshoot (pods, logs, events)

Kubernetes workloads

Workloads are the resource types you use to run containers on the cluster.

Rule of thumb:

Namespaces

Namespaces are what Kubernetes uses to group users. Certain resources are namespace scoped, meaning they can only be accessed by members of that namespace, not everyone on the cluster. Every namespace has two types of members admins and users. Admins have elevated priviliges including adding and removing members, as well as creating additional namespaces.

Important

Admins are also charged with ensuring the other members of the namespace follow cluster policies.

Today, we are using three namespaces, nrp-training, nrp-training-k8s

Keep in mind

Important

In Kubernetes, you do not need to ssh to the compute nodes themselves.

Docker and containers

Docker is a tool for building and running containers.

A container image packages:

This makes the environment portable: the same image can run on your laptop, a VM, or on a Kubernetes cluster.

Why Docker matters for Kubernetes

Kubernetes runs container images. It does not build them.

In practice:

Container registries

A container registry stores and distributes container images.

NRP note:

Login and Terminal Setup

Open the tutorial workspace link and sign in through CILogon. The training JupyterHub is the recommended path for this workshop because kubectl, helm, and kubeconfig are already wired up in the terminal.

JupyterHub launch screen

Use the JupyterLab launcher to open:

JupyterLab workspace

Confirm that the prepared environment is ready:

Bash
cd ~/cra-rel/workspace
kubectl version --client
kubectl auth whoami
kubectl config current-context
kubectl auth can-i get pods -n nrp-training-k8s

Set a username variable for this session. Use a lower-case NRP, GitHub, or institutional username that is unique within the room; Kubernetes names work best with lower-case letters, numbers, and hyphens.

Bash
export TUTORIAL_USER=<username>

Resource Portal Walkthrough

Open the NRP live resource view and look for:

NRP resource page

NRP has many GPU types available across the cluster.

GPU distribution GPU model list

For classroom use, distinguish two levels of "request":

  1. Portal or allocation request: Ask NRP for access, namespace membership, quotas, or exceptions needed for a class.
  2. Kubernetes workload request: Ask the scheduler for CPU, memory, and accelerator devices inside a YAML manifest.

Check what quota information is visible from the JupyterHub terminal:

Bash
kubectl get resourcequota -n nrp-training-k8s
kubectl describe resourcequota -n nrp-training-k8s

Nautilus also enforces admission policies. A common classroom failure is a pod that omits CPU or memory requests and limits. The training example manifests set requests and limits explicitly, usually with requests == limits, so they pass the cluster policy.

Hardware Resource Keys

For NVIDIA GPUs, the most common Kubernetes resource key is nvidia.com/gpu:

YAML
resources:
  limits:
    nvidia.com/gpu: 1
  requests:
    nvidia.com/gpu: 1

For Qualcomm Cloud AI 100 SoCs, the resource key is:

YAML
resources:
  limits:
    qualcomm.com/qaic: 1
  requests:
    qualcomm.com/qaic: 1

Some GPUs also use product-specific resource keys such as nvidia.com/a100 or scheduling labels such as nvidia.com/gpu.product=NVIDIA-A10.

Workshop Reservation Pattern

For this training, NRP has a reserved pool of training nodes. The manifests use:

Explore the reservation:

Bash
kubectl get nodes -l nrp-training=true -L nvidia.com/gpu.product
kubectl get nodes -l nrp-training=true \
  -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.taints}{"\n"}{end}'

The manifest pattern is:

YAML
tolerations:
- key: nautilus.io/reservation
  operator: Equal
  value: nrp
  effect: NoSchedule

affinity:
  nodeAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 100
      preference:
        matchExpressions:
        - key: nrp-training
          operator: In
          values: ["true"]

The toleration allows the pod onto tainted reservation nodes. The affinity asks the scheduler to prefer the reserved pool.

Hands-on Resource Request

Open yamls/gpu-pod.yaml. The important section is the accelerator request:

YAML
resources:
  limits:
    nvidia.com/gpu: 1
    memory: 4Gi
    cpu: "2"
  requests:
    nvidia.com/gpu: 1
    memory: 4Gi
    cpu: "2"

Create a per-user copy of the manifest, replace <username>, and launch the pod:

Bash
cd ~/cra-rel/workspace
cp yamls/gpu-pod.yaml /tmp/gpu-pod-${TUTORIAL_USER}.yaml
sed -i "s/<username>/${TUTORIAL_USER}/g" /tmp/gpu-pod-${TUTORIAL_USER}.yaml
kubectl apply -n nrp-training-k8s -f /tmp/gpu-pod-${TUTORIAL_USER}.yaml
kubectl get pods -n nrp-training-k8s

Watch the pod and check the GPU output:

Bash
kubectl wait -n nrp-training-k8s --for=condition=Ready pod/tutorial-${TUTORIAL_USER}-gpu-pod --timeout=10m
kubectl logs -n nrp-training-k8s tutorial-${TUTORIAL_USER}-gpu-pod --tail=30

Discuss:

Clean up before moving on:

Bash
kubectl delete -n nrp-training-k8s -f /tmp/gpu-pod-${TUTORIAL_USER}.yaml --ignore-not-found

Transition

At this point participants should have:

The next section uses the same namespace and YAML workflow to run LLM inference.