# Install a tenant

Go from a release bundle to a finished training job for one tenant. With the prerequisites ready, this takes under an hour. Repeat steps 3 to 8 for each new tenant; steps 1 and 2 are once per release.

The examples install tenant `tenant-a` from release `1.4.0`. The control plane goes into namespace `arena-tenant-a` and the agent into namespace `arena-agent` on the GPU cluster.

## Step 1: Get the release bundle

### What you do

AgileRL sends you a links file for release `1.4.0`, `arena-self-hosted-1.4.0.links`. To ask for it, email [arena@agilerl.com](mailto:arena@agilerl.com) with your organisation’s name and the release you want. Each line names a file and gives a private download link for it. The release comes as numbered parts of one tar file (`arena-self-hosted-1.4.0.tar.000`, `.001` and so on, each at most 4 GiB) and a checksum file, `arena-self-hosted-1.4.0.tar.sha256`, about 50 GiB in all.

Download the files on a machine with internet access and a fast connection. About 50 GiB takes around 3 hours at 5 MB/s, so an office line may not do; a staging host in a data centre or cloud region is quicker. You then carry the files into your environment, so plan for that copy too. The machine where you unpack them needs about 100 GiB free: the parts plus the unpacked bundle. On macOS, install `wget` first; it doesn’t ship with macOS.

```bash
while read -r name url; do wget -c --tries=5 -O "$name" "$url"; done < arena-self-hosted-1.4.0.links
```

If the download stops, run the same command again. `wget -c` carries on each file from where it stopped. The links work for 7 days. If they expire before you finish, ask for new ones the same way. Anyone with the links file can download the release until then, so keep it to the people doing the install.

Carry the files into your environment. Check the parts, join and unpack them, then check the bundle. On macOS, use `shasum -a 256 -c` in place of `sha256sum -c`:

```bash
sha256sum -c arena-self-hosted-1.4.0.tar.sha256
cat arena-self-hosted-1.4.0.tar.[0-9]* | tar -x
cd arena-self-hosted-1.4.0
sha256sum -c SHA256SUMS
```

### What happens

The bundle is everything a tenant needs: the charts `charts/arena-self-hosted-1.4.0.tgz` and `charts/arena-byoc-agent-1.4.0.tgz`, every container image for both amd64 and arm64 (under `images/`), and `images.lock`, which lists each image with its digest and platforms. It also holds `mirror-images.sh` with the Linux `crane` binaries it uses (under `tools/`; on macOS, install [crane](https://github.com/google/go-containerregistry) yourself), an example tenant values file `values-example-tenant.yaml`, and `RELEASE-NOTES.md`, which names the platform release and ML bundle and lists every image in the bundle with its digest. Nothing is downloaded later.

## Step 2: Mirror the images

### What you do

Log in to your registry, then push every image from the bundle:

```bash
docker login registry.internal
./mirror-images.sh . registry.internal/arena
```

A registry with no login needs no `docker login`. For a registry served over plain HTTP, add `--insecure` after the registry, for example `./mirror-images.sh . 10.0.0.5:5000/arena --insecure`, and make sure the container runtime on every node is set up to pull from it over HTTP.

### What happens

The script pushes each image in `images.lock` to `registry.internal/arena`, keeping its repository path, tags and digests. For example `761296822462.dkr.ecr.us-east-1.amazonaws.com/containers/arena-train:59.7.2-cu130` becomes `registry.internal/arena/containers/arena-train:59.7.2-cu130`, and `public.ecr.aws/zinclabs/openobserve:v0.80.1` becomes `registry.internal/arena/zinclabs/openobserve:v0.80.1`. The tenant pulls only from your registry, so it needs no login to Arena’s. It talks only to your registry and stops if a pushed digest differs from `images.lock`. Running it again is safe. Every tenant on this release uses these images, so this is once per release, not once per tenant.

## Step 3: Prepare the tenant’s resources

### What you do

Create, for the tenant:

- A bucket (here `arena-tenant-a`) and an access key for it. When people use the tenant from a browser, browsers upload and download datasets and models straight to the store, so its endpoint must be reachable from your users’ network, and its CORS rules must allow the tenant’s UI origin (here `https://arena.tenant-a.internal`) to `GET`, `PUT`, `POST` and `HEAD` with the `Content-Type`, `Content-MD5` and `Content-Encoding` request headers, and expose `ETag`, which multipart uploads read. Put the key in a Secret in the control plane namespace:
  ```bash
  kubectl create namespace arena-tenant-a
  kubectl -n arena-tenant-a create secret generic tenant-a-s3 \
    --from-literal=accessKeyId=… --from-literal=secretAccessKey=…
  ```
- A DNS name for the API (here `arena.tenant-a.internal`) pointing at your ingress, and a TLS certificate that covers that name and `*.arena.tenant-a.internal`. Deployments are served on the wildcard. Create the Secret only after the certificate includes both names:
  ```bash
  kubectl -n arena-tenant-a create secret tls arena-tenant-a-tls --cert=tls.crt --key=tls.key
  ```
- On the GPU cluster, a namespace for the agent (here `arena-agent`) with two Secrets. The store Secret has the **same name** as the one above, with the keys training and inference pods read. The TLS Secret serves the deployment hostnames. Any namespace name works, because the agent reads the store Secret from its own namespace:
  ```bash
  kubectl create namespace arena-agent
  kubectl -n arena-agent create secret generic tenant-a-s3 \
    --from-literal=AWS_ACCESS_KEY_ID=… --from-literal=AWS_SECRET_ACCESS_KEY=… \
    --from-literal=endpoint=https://s3.internal \
    --from-literal=AWS_ENDPOINT_URL=https://s3.internal \
    --from-literal=APP_AWS_CLIENT_ENDPOINT=https://s3.internal
  kubectl -n arena-agent create secret tls arena-tenant-a-tls --cert=tls.crt --key=tls.key
  ```
- A node label that picks the tenant’s reserved GPU nodes, for example `nvidia.com/gpu.product: NVIDIA-B300`. The NVIDIA GPU Operator (through GPU Feature Discovery) sets `nvidia.com/gpu.product` for you. With the device plugin alone, nodes don’t get it, so label them yourself, for example `kubectl label node <gpu-node> nvidia.com/gpu.product=NVIDIA-B300`. Any label works, as long as `gpuCluster.nodeSelector` in step 4 matches it.
- On the GPU cluster, a node with at least 20 GiB of memory, no GPUs and no `NoSchedule` or `NoExecute` taint. A training job’s Ray head holds the job’s own message broker and needs a node like this. An untainted control-plane node counts, as on a single-server k3s install; a separate CPU worker node is recommended, so the head doesn’t take the control plane’s CPU and memory. Without any such node, the job connects to the bundled broker, which nothing reads: Arena stops it by stopping its Ray job instead of halting it gracefully, and its metric names are not recorded. The head requests 16 GiB and has no node selector, so Kubernetes may also place it on a GPU node with room (a `PreferNoSchedule` taint doesn’t stop it), for example when a second job starts while the CPU node already holds one head.

### What happens

Arena stores datasets, models, checkpoints and exported metrics under the bucket. The API is served only at the DNS name you give it, and the GPU cluster reaches the control plane through that name. The agent copies the store Secret into each job’s namespace, so training and inference pods reach the bucket with the tenant’s own key.

## Step 4: Write the tenant’s values file

### What you do

Start from `values-example-tenant.yaml` in the bundle. Tenant settings go under `arena-platform:`; the bundled dependencies have their own top-level sections:

```yaml
# tenant-a.yaml
arena-platform:
  tenant: tenant-a
  domain: arena.tenant-a.internal

  image:
    registryOverride: registry.internal/arena

  storage:
    endpoint: https://s3.internal
    bucket: arena-tenant-a
    existingSecret: tenant-a-s3

  ingress:
    className: nginx

  tls:
    existingSecret: arena-tenant-a-tls

  onPrem:
    images:
      trainImage: …     # copy from values-example-tenant.yaml
      inferenceTag: …   # copy from values-example-tenant.yaml

  gpuCluster:
    name: tenant-a-gpus
    nodeSelector:
      nvidia.com/gpu.product: NVIDIA-B300
    gpuType: nvidia-b300
    classes:
      - name: b300-8x1
        gpusPerNode: 8
        numNodes: 1
        cpu: 192
        memoryGib: 1536

openobserve:
  image:
    oss:
      repository: registry.internal/arena/zinclabs/openobserve
```

If your certificate comes from a private CA, add its PEM as `arena-platform.tls.caBundle`. The control plane, the agent and its validators, and training and inference pods trust it, as well as their images’ own roots, for calls to the API and to S3, so if your S3 store’s certificate also comes from a private CA, put that CA in the same bundle.

The CA certificate must carry the key usage extension with `keyCertSign`. Training and inference pods run Python 3.13, which checks certificates strictly and rejects a CA without it (`CA cert does not include key usage extension`). A run still trains, but its metric names never reach the API and a stop can’t reach the job. `openssl x509 -in ca.crt -noout -ext keyUsage` should print `Certificate Sign`. For the same reason the certificate for `domain` needs an authority key identifier (`Missing Authority Key Identifier` otherwise): `openssl x509 -in tls.crt -noout -ext authorityKeyIdentifier` should print one. OpenSSL 3.0 adds it when it signs a certificate with `-CA`; some other tools do not.

### What happens

This file is the whole tenant configuration. It names only resources inside your environment. `onPrem.images.trainImage` and `onPrem.images.inferenceTag` name the release’s training and inference images; copy them from the `values-example-tenant.yaml` of the release you install, because without `trainImage` bootstrap creates no resource classes and the install fails. `image.registryOverride` replaces the registry of every image the tenant runs, including Postgres and Pulsar, and the images Arena hands to the GPU cluster. OpenObserve takes its full repository in `openobserve.image.oss.repository`. Deployment hostnames and the address the GPU cluster calls follow `domain`.

Each entry under `gpuCluster.classes` becomes a resource the tenant can train and deploy on: `gpusPerNode` GPUs of `gpuType`, `cpu` CPUs and `memoryGib` GiB of memory on each of `numNodes` nodes. Set `cpu` and `memoryGib` to no more than one GPU node has. Training pods request them less what Kubernetes keeps on each node, and more is kept back on a bigger class: about 6 GiB of 28 GiB, 8 GiB of 46 GiB, 16 GiB of 184 GiB. `/resources` shows what a run actually gets as `ram_gb`. Without `classes`, the tenant gets one class, `gpu-1x1` (one GPU, 6 CPUs, 28 GiB), the smallest that trains a 0.8B model. Training and inference workers of every class, and the agent’s own pods, run only on nodes that match `gpuCluster.nodeSelector`; a job’s Ray head doesn’t (step 3).

Each class is its own pool of `numNodes` nodes. Arena runs one job per class node at a time and queues the rest, but it doesn’t know when two classes share the same machines. With `l4-1x1`, `l4-2x1` and `l4-4x1` on one 4-GPU node, two `l4-1x1` runs never run together, while one run of each class can be admitted at once, asking for 7 GPUs on a 4-GPU node; the pods that don’t fit wait in `Pending` until GPUs free up. Classes have no node selector of their own, so on shared nodes either define one class per node size or accept that waiting. `gpuCluster.tolerations` reaches the agent’s pods only; training and inference pods don’t get it.

The [values reference](reference.md#values) lists every key, including an external Postgres and resource limits.

## Step 5: Install

### What you do

Install with the release name `arena`. The bundled services have fixed names (`arena-postgres`, `arena-pulsar`, `arena-openobserve`) that the tenant settings point at.

```bash
helm install arena charts/arena-self-hosted-1.4.0.tgz \
  -n arena-tenant-a -f tenant-a.yaml --wait --timeout 20m
```

### What happens

Helm creates the control plane: API, workers, scheduler, Postgres, Pulsar and OpenObserve. A migration Job creates the database schema; the API and workers restart until it exists, then turn Ready. Once every pod is Ready, two Jobs run:

- **Bootstrap** (`arena-bootstrap`). Creates the tenant’s organisation and API key, registers the GPU cluster and creates its resource classes.
- **Self-check** (`arena-doctor`). Checks every dependency and confirms that every configured endpoint is inside your environment. A failed check fails the install. A GPU cluster whose agent has stopped reporting is only a warning here, so the control plane installs and upgrades while the GPU side is offline.

`helm install` returns when all pods are Ready and both Jobs have succeeded.

## Step 6: Read the self-check and bootstrap output

### What you do

```bash
kubectl -n arena-tenant-a logs job/arena-doctor
kubectl -n arena-tenant-a logs job/arena-bootstrap
```

### What happens

The self-check prints one line per dependency:

```text
postgres            ok   arena-postgres:5432
object store        ok   https://s3.internal (bucket arena-tenant-a)
openobserve         ok   arena-openobserve:5080
gpu cluster         waiting   tenant-a-gpus (agent not installed yet)
outbound endpoints  ok   all 9 configured endpoints are inside the tenant
```

With a private CA (`arena-platform.tls.caBundle`) a `ca bundle` line follows `openobserve`. It fails when a CA in the bundle lacks key usage `keyCertSign`, which training and inference pods require, and names that CA.

The endpoint count depends on your values. The check allows the tenant’s `domain` and `*.domain`, the release’s own services, the store endpoint, the database host and the registry. If you use an external OpenObserve, add its host to `arena-platform.doctor.allowlist`.

Bootstrap prints what it created:

```text
organisation   tenant-a (created)
api key        arena_org_8c1f…Qx7a (stored in secret arena-partner-key)
gpu cluster    tenant-a-gpus registered
agent values   stored in secret arena-agent-values
resource class b300-8x1 created
```

On later upgrades the same Job prints `exists`, `unchanged` and `already registered`. A class changed in the values file shows as `updated`. So do the agent values after an upgrade to a new release, because bootstrap writes that release’s agent images into them ([Upgrade](operations.md#upgrade)).

The full API key is in the Secret `arena-partner-key`, under `key`; the log shows only its start and end. Give it to the developer building your service (see [Your first model](../first-model.md)):

```bash
kubectl -n arena-tenant-a get secret arena-partner-key -o jsonpath='{.data.key}' | base64 -d
```

## Step 7: Connect the GPU cluster

### What you do

Copy the agent values and the agent’s cluster token from the control plane. On the GPU cluster, store the token and install the agent:

```bash
kubectl -n arena-tenant-a get secret arena-agent-values \
  -o jsonpath='{.data.values\.yaml}' | base64 -d > agent-values.yaml
kubectl -n arena-tenant-a get secret arena-agent-values \
  -o jsonpath='{.data.cluster-token}' | base64 -d > cluster-token

kubectl -n arena-agent create secret generic cluster-token --from-file=cluster-token=./cluster-token
helm install arena-agent charts/arena-byoc-agent-1.4.0.tgz \
  -n arena-agent -f agent-values.yaml --set provisioner.enabled=false --wait
```

A tenant doesn’t use the agent chart’s machine provisioner. `agent-values.yaml` from bootstrap already turns it off, and `--set provisioner.enabled=false` keeps it off whatever the values file says. The bundle has neither `containers/arena-byoc-provisioner` nor `containers/arena-wg` for that reason. If you turn the provisioner on, mirror both to your registry through `image.registryOverride`. Mirror `provisioner.image` (`containers/arena-byoc-provisioner`) at `provisioner.image.tag` in `agent-values.yaml`: the provisioner pod pulls that and stays in `ImagePullBackOff` when it is missing. Mirror `containers/arena-wg` at the chart’s `provisioner.wireguardImage.tag`: job VMs pull that and fail their WireGuard wait when it is missing. `agent-values.yaml` and `cluster-token` are the agent’s credentials. Keep them with your other tenant secrets.

Run the self-check again from the API pod, with the allowlist the chart generated:

```bash
kubectl -n arena-tenant-a get configmap arena-doctor-allowlist \
  -o jsonpath='{.data.outbound-allowlist\.txt}' \
  | kubectl -n arena-tenant-a exec -i deploy/arena-api -- \
    sh -c 'cat > /tmp/allowlist.txt && /usr/app/arena-cli task doctor_outbound allowlist:/tmp/allowlist.txt'
```

### What happens

The agent connects to `https://arena.tenant-a.internal` and reports the GPUs it finds on the selected nodes. Within a few minutes the self-check shows:

```text
gpu cluster         ok   tenant-a-gpus (Connected, agent 3.7.4)
```

The agent has its own version number, not the release’s; `RELEASE-NOTES.md` lists it as the `containers/arena-byoc-agent` tag.

The tenant can now train and deploy on the classes bootstrap created in step 5, here `b300-8x1`. These are the only resources it has.

## Step 8: Add a base model and run a first job

### What you do

Copy a model into the tenant’s bucket and register it ([Base models](models.md) has the detail):

```bash
aws --endpoint-url https://s3.internal s3 sync ./Qwen3.5-0.8B \
  s3://arena-tenant-a/models/qwen3.5-0.8b/

kubectl -n arena-tenant-a exec deploy/arena-api -- \
  /usr/app/arena-cli task register_model name:qwen3.5-0.8b \
  path:s3://arena-tenant-a/models/qwen3.5-0.8b/
```

Then run the built-in smoke test. It uploads a 200-row dataset, fine-tunes the model with SFT and LoRA for 20 steps, and checks the checkpoint, metrics and export. Add `deploy:true` to deploy the checkpoint as well:

```bash
kubectl -n arena-tenant-a exec deploy/arena-api -- /usr/app/arena-cli task smoke model:qwen3.5-0.8b
```

### What happens

The smoke test calls the same partner API your service will use. It mints its own key, which expires within 24 hours and is revoked when the test ends. It reads the tenant’s GPU types from the API and lets submit pick the GPUs, as your service would. `gpu_type:b300` asks for one of the listed types instead. After training it downloads the exported model and checks every file’s size and sha256. A download that fails gets a fresh link and is tried again, up to 3 times per file. Then it resumes the run and stops it. It prints one line per step, and a green run means the tenant is ready:

```text
auth             ok   unknown key 401, admin route 404
resources        ok   submit picks among b300
dataset          ok   smoke-20261123101500-sft (200 rows)
project          ok   smoke-20261123101500
model            ok   qwen3.5-0.8b
run-spec         ok   SFT, max_steps 20
submit           ok   Training job for 'smoke-20261123101500-run' submitted successfully
train            ok   20 steps in 3m41s
checkpoint       ok   step 20
metrics          ok   14 names, 21 CSV lines
export           ok   9 files, 1795164160 bytes, sha256 verified
resume           ok   smoke-20261123101500-resume queued
stop             ok   smoke-20261123101500-resume Stopped
cleanup          ok
```

On a tenant the auth line ends in `admin route 404`. On a hosted API it ends in `admin route 403`.

With `deploy:true`, a `deploy` line before `cleanup` shows the deployment’s URL. The test removes everything it created, pass or fail. If it can’t stop one of its runs, `cleanup` fails and leaves the project and dataset in place, so stop that run and remove them yourself. If a step fails, its line says why, the steps after it are skipped, and the command exits non-zero. Ctrl-C or SIGTERM to the process skips the remaining steps, prints a `cancelled` line and still cleans up. The test waits up to an hour each for training, the export, the stop and the deployment. For a large model, raise that with `timeout_secs:<seconds>`, keeping the whole run inside the key’s 24 hours.

## Next

- Hand the API key and `https://arena.tenant-a.internal` to your developers: [Your first model](../first-model.md) and the [Partner API reference](../api-reference.md).
- Plan upgrades, backups and key rotation: [Operations](operations.md).
