Skip to content

CLI access

For large-scale jobs, automation, and advanced workflows beyond what the JupyterHub web UI offers, you can interact with FLAME from the command line using SSH. For more advanced use cases, you can also use the Kubernetes API directly with kubectl.

Not sure if you need this?

If you're just getting started with FLAME, we recommend trying JupyterHub first. This is the easiest way to use FLAME. You can set up CLI access later if you need it.

Drexel network required

You must be on the Drexel network to access FLAME. This includes JupyterHub, SSH, the Kubernetes API, and every other FLAME service. If you are not on the Drexel network, you cannot connect. There are two ways to get connected:

  1. On campus: Be physically on campus and connect to an active Drexel Ethernet jack or DragonFly3 Wi-Fi.
  2. Off campus: Connect to the Drexel VPN.

SSH access

FLAME uses short-lived SSH certificates instead of SSH keys. You never upload a public key; instead you log in with your institutional credentials in your browser and receive a certificate that lives in your ssh-agent and expires after 48 hours. When it expires, you need to log in again.

Install and set up the step CLI

FLAME uses the step command line tool to handle issuing SSH certificates and adding them to your SSH agent. You'll need to install step to SSH into FLAME. See the official install instructions for all options; the most common methods are below.

brew install step
wget https://dl.smallstep.com/cli/docs-cli-install/latest/step-cli_amd64.deb
sudo dpkg -i step-cli_amd64.deb

On ARM64, substitute step-cli_arm64.deb.

sudo dnf install https://dl.smallstep.com/cli/docs-cli-install/latest/step-cli_amd64.rpm

On ARM64, substitute step-cli_arm64.rpm.

In PowerShell:

winget install Smallstep.step

Open a new PowerShell window afterwards so that step is on your PATH.

If you prefer Windows Subsystem for Linux (WSL), follow the instructions in the "Linux" tab from within WSL.

Verify the installation:

step version

Then you need a couple of once-per-machine setup steps. First, point step at the FLAME certificate authority:

step ca bootstrap --ca-url https://ca.flamecluster.io --fingerprint 6a997ce44bade7ec7ef26aeaa4a8a5cfbf270604e73c344a8dc08a72df86f775

Then fetch the SSH configuration you'll need to connect to FLAME (this writes the flame host aliases and trust settings into ~/.ssh, managed between markers so your own config is untouched — re-run it any time to pick up updates):

step ssh config

Start your SSH agent

Before logging in, make sure an SSH agent is running:

ssh-add -l

If this lists identities or says The agent has no identities., the agent is running. If it says that it cannot connect to an authentication agent, start one:

eval "$(ssh-agent -s)"

You may need to start the agent again in each new terminal session unless your environment does this automatically.

The agent is a Windows service that is disabled by default. Enable it once from a PowerShell window opened with Run as administrator:

Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent

Log in

Now you can login:

step ssh login your-email@drexel.edu

A browser window opens for the standard FLAME sign-in. When it completes, a certificate is loaded into your ssh-agent. Confirm with:

ssh-add -l    # shows a -CERT entry that expires in 48 hours

Connect to your JupyterHub server

ssh flame

That's it. You land in a shell inside your JupyterHub server. If it isn't running, ssh flame starts it first and shows you the progress, then drops you in. The web interface and your SSH sessions work side by side on the same server.

While waiting, ssh flame and ssh flamectl server start check the pod every five seconds and print changes to its scheduling and startup status, including messages such as Insufficient cpu or ImagePullBackOff. You can also see the current message with ssh flamectl server status.

Notebook SSH connections disable connection sharing so each connection checks the current server through the gateway. Run step ssh config and accept the replacement prompts to refresh an existing SSH configuration.

You should be able to interact with FLAME in the same way you'd interact with any other server reachable over SSH:

ssh flame nvidia-smi                          # run one command and return
scp results.tar.gz flame:~/                   # copy a file in
scp flame:/workspace/plots/loss.png .         # ...or out
rsync -av --progress data/ flame:/workspace/data/   # sync a directory
ssh -L 6006:localhost:6006 flame              # forward a port, e.g. TensorBoard
sftp flame                                    # interactive file transfer

Graphical programs over ssh -X flame need a custom image with X11 tools installed; see SSH into custom images.

Anything you put under /home/ubuntu or /workspace lands on persistent storage and is there next time — see Storage. Files written anywhere else live only as long as the server.

VSCode works too

VSCode can connect over SSH as well — see VSCode.

Choosing what ssh flame starts

When ssh flame has to start a server, it uses your saved settings — workspace, size, GPU, and image. If you haven't saved any and you belong to exactly one workspace, it starts a default (medium, no GPU) server there. If you belong to several workspaces, it asks you to choose first.

Settings are managed through the flamectl host:

ssh flamectl server config options

lists the workspaces, sizes, and GPU types available to you, then:

ssh flamectl server config set --workspace mylab --size large --gpu rtxa6000:2

See GPUs for the hardware behind each GPU type and help choosing between them.

To use a custom image on your next start:

ssh flamectl server config set --image registry.flamecluster.io/mylab/devbox:v1
ssh flamectl server start
ssh flame

Settings persist until you change them. Any subset works (set --size small alone keeps your other settings). --gpu none clears a GPU request, ssh flamectl server config set --image none restores the default image, and ssh flamectl server config unset returns all settings to the defaults. Changing settings does not replace a running server; stop it first if you want the next start to use the new image.

Same choices as the web form

ssh flame and the JupyterHub start page are two entry points into the same server. The workspaces, sizes, GPU types, and custom image are the same choices, and whichever way you start the server, the other side sees it running.

Managing your server

ssh flamectl on its own prints the full command list:

Command What it does
ssh flamectl server status current server status, scheduling or startup messages, and settings
ssh flamectl server start start it without connecting
ssh flamectl server stop stop it
ssh flamectl server config show your saved settings
ssh flamectl server config options what you can choose from
ssh flamectl server config set [options] save settings
ssh flamectl server config unset back to the defaults

Troubleshooting

Permission denied (publickey) when connecting
Your certificate has expired (they last 48 hours). Run step ssh login your-email@drexel.edu again.
getsockname failed: Not a socket on Windows
Your SSH configuration predates Windows support. Run step ssh config again to refresh it.
error connecting with ssh-agent on Windows
The ssh-agent service isn't running — see Start your SSH agent.
ssh: Could not resolve hostname flame
The flame/flamectl host aliases come from step ssh config. Run it once (it's safe to repeat), then try again.
You are a member of multiple workspaces, so I can't pick one for you
Save a default: ssh flamectl server config set --workspace <name>. Use ssh flamectl server config options to see the names.
your server is running but does not accept SSH connections
The server is using a custom image that wasn't built FROM a URCF base image, so it's missing FLAME's SSH support — see Building a custom container image.
Starting your server... sits for a long time
Large images take a few minutes to start, and GPU servers wait for a free GPU. The same waits apply in the web interface; ssh flamectl server status shows where it's at.

Kubernetes API access (advanced)

kubectl talks to the Kubernetes API directly — how you submit TrainJobs, inspect pods and logs, and work with FLAME's Kubernetes objects. It authenticates separately from SSH (a different helper, Pinniped), so set it up in addition to SSH if you need it. You need to install two pieces of software:

  1. kubectl: the Kubernetes command-line tool, used to run commands against the cluster
  2. Pinniped: authentication helper that integrates kubectl with the FLAME Authentication system

Install kubectl

Follow the official instructions for your operating system:

Verify the installation:

kubectl version --client

Install the Pinniped CLI

Pinniped is what connects kubectl to Drexel's single sign-on. See the official install instructions for all options; the most common methods are below.

Homebrew

brew install vmware/pinniped/pinniped-cli

Direct download

curl -Lo pinniped https://get.pinniped.dev/v0.47.0/pinniped-cli-darwin-arm64
chmod +x pinniped
mkdir -p ~/.local/bin && mv pinniped ~/.local/bin/
curl -Lo pinniped https://get.pinniped.dev/v0.47.0/pinniped-cli-darwin-amd64
chmod +x pinniped
mkdir -p ~/.local/bin && mv pinniped ~/.local/bin/

Add ~/.local/bin to your PATH if needed

On macOS, ~/.local/bin may not be on your PATH by default. If pinniped version doesn't work after installing, add this to your ~/.zshrc or ~/.bash_profile:

export PATH="$HOME/.local/bin:$PATH"
curl -Lo pinniped https://get.pinniped.dev/v0.47.0/pinniped-cli-linux-amd64
chmod +x pinniped
mkdir -p ~/.local/bin && mv pinniped ~/.local/bin/
curl -Lo pinniped https://get.pinniped.dev/v0.47.0/pinniped-cli-linux-arm64
chmod +x pinniped
mkdir -p ~/.local/bin && mv pinniped ~/.local/bin/

Download pinniped-cli-windows-amd64.exe from the Pinniped releases page, rename it to pinniped.exe, and add it to your PATH.

Verify the installation:

pinniped version

Download the FLAME kubeconfig

The kubeconfig file, stored at ~/.kube/config, tells kubectl how to connect and authenticate to a cluster. To use FLAME, you need to create ~/.kube/config with a standard configuration file.

There are three options:

Run the following commands to download the kubeconfig directly:

mkdir -p ~/.kube
curl -Lo ~/.kube/config https://docs.flamecluster.io/assets/flame-kubeconfig.yaml

Click the button below to download the kubeconfig file, then move it to ~/.kube/config:

Download kubeconfig

mkdir -p ~/.kube
mv ~/Downloads/flame-kubeconfig.yaml ~/.kube/config

Create ~/.kube/config using a text editor and paste the following contents:

apiVersion: v1
clusters:
- cluster:
    server: https://k8s.flamecluster.io
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNCVENDQVl5Z0F3SUJBZ0lVQVpENFpPSnNZUEJRQ09sZXV5ZXdrNGl1U1d3d0NnWUlLb1pJemowRUF3TXcKTWpFVU1CSUdBMVVFQ2d3TFJISmxlR1ZzSUZWU1EwWXhHakFZQmdOVkJBTU1FWFZ5WTJZdGNtOXZkQzFqWVMxdwpjbTlrTUI0WERUSTJNREl4T0RFNU1qa3dORm9YRFRRMk1ESXhNekU1TWprd05Gb3dNakVVTUJJR0ExVUVDZ3dMClJISmxlR1ZzSUZWU1EwWXhHakFZQmdOVkJBTU1FWFZ5WTJZdGNtOXZkQzFqWVMxd2NtOWtNSFl3RUFZSEtvWkkKemowQ0FRWUZLNEVFQUNJRFlnQUU4Q3ZxZ2ZOT0xTZkhBcnM2MW9XOCtOZlhyN3p4aU52TEk3WlJUSU1MdGdmVgpBakJoeWYyODJMWjZaa1VPdjdpZ3NMaGlWSmcrL09QNTY1V0NpeEJ1MThlRmRYYjFBSS8xeFljMkpDa1hSbEwvCngxOGlaTUJuL2JCazlVU3ZhNi9RbzJNd1lUQWRCZ05WSFE0RUZnUVVQMXlqcnNlaE84WHJvYit6UXp4a3IxMXAKeSt3d0h3WURWUjBqQkJnd0ZvQVVQMXlqcnNlaE84WHJvYit6UXp4a3IxMXB5K3d3RHdZRFZSMFRBUUgvQkFVdwpBd0VCL3pBT0JnTlZIUThCQWY4RUJBTUNBWVl3Q2dZSUtvWkl6ajBFQXdNRFp3QXdaQUl3Vmd5KzZqN2VrQTh2CkhNZi9ReHhVTmFmNjRCaW5QZHFMSGJXcGdEMWhQMFlRZkkveVJ6SWo3K3ZZN1hYbGJkamJBakF4S0RTQ0V0YSsKUVhYQ0pEVHR3TEZoRnFTY0REMFMveVh0SlZXcnAweW02UWpDa29Ha1ZKekxwejFORjNTejRqOD0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
  name: flame
contexts:
- context:
    cluster: flame
    user: flame
  name: flame
current-context: flame
kind: Config
preferences: {}
users:
- name: flame
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - login
      - oidc
      - --enable-concierge
      - --concierge-authenticator-name=keycloak-authenticator
      - --concier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1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
      - --issuer=https://keycloak.flamecluster.io/realms/flame
      - --client-id=pinniped-cli
      - --scopes=openid,email,profile,offline_access
      - --request-audience=pinniped-cli
      command: pinniped
      env: []
      installHint: |
        The pinniped CLI does not appear to be installed.
        See https://pinniped.dev/docs/howto/install-cli/ for installation instructions.
      interactiveMode: IfAvailable
      provideClusterInfo: true

Existing kubeconfig

If you already have a ~/.kube/config for another cluster, back it up first:

cp ~/.kube/config ~/.kube/config.backup

Or keep configs separate with the KUBECONFIG environment variable (substitute the method above accordingly):

export KUBECONFIG=~/.kube/flame-config

Authenticate

Now you're ready to authenticate. Run the following command, which prints info about the machines available in the cluster:

kubectl get nodes

Your browser will open to the Globus Auth login page. Choose "Drexel University" as your institution and sign in with your Drexel username and password (the same process described in Authentication). After login, the browser tab will confirm success and you can close it.

Back in your terminal, the command will complete and show you the cluster nodes. You should see something like this, although the exact contents will vary:

$ kubectl get nodes
NAME            STATUS   ROLES                       AGE     VERSION
prod-cpu01      Ready    <none>                      3h35m   v1.35.7+rke2r1
prod-cpu02      Ready    <none>                      3h35m   v1.35.7+rke2r1
prod-cpu03      Ready    <none>                      3h35m   v1.35.7+rke2r1
prod-cpu04      Ready    <none>                      3h35m   v1.35.7+rke2r1
prod-cpu06      Ready    <none>                      3h35m   v1.35.7+rke2r1
prod-cpu07      Ready    <none>                      3h35m   v1.35.7+rke2r1
prod-ctrl01     Ready    control-plane,etcd,master   3h41m   v1.35.7+rke2r1
prod-ctrl02     Ready    control-plane,etcd,master   3h39m   v1.35.7+rke2r1
prod-ctrl03     Ready    control-plane,etcd,master   3h39m   v1.35.7+rke2r1
prod-gh200-01   Ready    <none>                      3h29m   v1.35.7+rke2r1
prod-gh200-02   Ready    <none>                      3h29m   v1.35.7+rke2r1
prod-rtxa6000-01 Ready   <none>                      3h29m   v1.35.7+rke2r1

Sessions last 48 hours

After the initial login, Pinniped caches your credentials, so you won't need to re-authenticate for every command. Sessions last up to 48 hours from when you log in, after which your next kubectl command will open a browser to sign in again.

Set your namespace

Most Kubernetes resources live in a namespace. On FLAME, each workspace has its own namespace.

Not sure what your workspace is?

If you don't know your workspace, email URCF staff and they can tell you.

You can set the namespace for a kubectl command using the -n argument, e.g.:

kubectl get pods -n my-workspace

will list all the pods in my-workspace. However, this gets tedious quickly, so you should set a default namespace as follows:

kubectl config set-context --current --namespace=my-workspace

Now when you run:

kubectl get pods

You'll automatically see only the pods in your workspace namespace.

Getting a throwaway shell

ssh flame gives you a shell in your own server; for a shell in a fresh, disposable pod (a different image, or nothing of yours mounted), run one:

kubectl run my-shell --rm -it --image=ubuntu -- bash

This starts a temporary bash shell in a minimal Ubuntu pod. When you exit, the pod is automatically cleaned up.

Next steps