|
| 1 | +# Building Relocatable TransferBench Packages with GitHub Actions |
| 2 | + |
| 3 | +This document describes the GitHub Actions workflow for building relocatable |
| 4 | +TransferBench packages using the ROCm SDK from |
| 5 | +[TheRock](https://github.com/ROCm/TheRock). |
| 6 | + |
| 7 | +The workflow (`.github/workflows/build-relocatable-packages.yml`) and the |
| 8 | +`build_packages_local.sh` script at the repo root produce: |
| 9 | + |
| 10 | +- **DEB** packages for Ubuntu/Debian |
| 11 | +- **RPM** packages for AlmaLinux/Rocky/RHEL (built in `manylinux_2_28`) |
| 12 | +- **TGZ** archives for any Linux distribution |
| 13 | + |
| 14 | +All packages install to `/opt/rocm/extras-<MAJOR>` and use relocatable |
| 15 | +`$ORIGIN`-relative `RPATH` so the install tree itself can be moved without |
| 16 | +hard-coded library paths. These artifacts are **not** fully self-contained: |
| 17 | +target systems must still provide the required ROCm/HSA runtime libraries |
| 18 | +(declared as package dependencies: `hsa-rocr` and `numactl`). |
| 19 | + |
| 20 | +This workflow is modeled on the |
| 21 | +[ROCmValidationSuite packaging workflow](https://github.com/ROCm/ROCmValidationSuite/blob/master/.github/workflows/README_BUILD_PACKAGES.md). |
| 22 | + |
| 23 | +## Workflow Triggers |
| 24 | + |
| 25 | +| Trigger | Behavior | |
| 26 | +|---------|----------| |
| 27 | +| Push to `develop`, `mainline`, `release/**` | Build + upload to S3 (if configured) + regenerate apt/yum repo metadata | |
| 28 | +| Pull request to `develop`, `mainline` | Build + upload to ref-specific S3 path (no repo metadata) | |
| 29 | +| Schedule (daily 13:00 UTC) | Same as push, with auto-fetched latest ROCm | |
| 30 | +| `workflow_dispatch` | Manual trigger with `rocm_version` and `gpu_family` inputs | |
| 31 | + |
| 32 | +### Manual trigger inputs |
| 33 | + |
| 34 | +- **`rocm_version`** (e.g. `7.11.0a20260121`). Empty = auto-fetch latest from TheRock. |
| 35 | +- **`gpu_family`** — one of: |
| 36 | + - `gfx94X-dcgpu` (MI300A/MI300X) — **default** |
| 37 | + - `gfx950-dcgpu` (MI350X/MI355X) |
| 38 | + - `gfx110X-all` (RX 7900 XTX, 7800 XT, 7700S, Radeon 780M) |
| 39 | + - `gfx120X-all` (RX 9060/XT, 9070/XT) |
| 40 | + - `gfx1151` (Strix Halo iGPU) |
| 41 | + |
| 42 | +## Build features enabled in CI |
| 43 | + |
| 44 | +The workflow always builds with: |
| 45 | + |
| 46 | +- `ENABLE_NIC_EXEC=OFF` — RDMA NIC executor disabled (would require libibverbs.so.1 at runtime; not bundled by TheRock SDK) |
| 47 | +- `ENABLE_MPI_COMM=OFF` — MPI multi-node communicator disabled (would require OpenMPI at runtime; not bundled by TheRock SDK). Packages are built to run out of the box with only `numactl`/`libnuma1` from the OS. |
| 48 | +- `DISABLE_DMABUF=OFF` — DMA-BUF support for GPU Direct RDMA |
| 49 | +- `BUILD_RELOCATABLE_PACKAGE=ON` — RVS-style install prefix + package naming |
| 50 | +- `GPU_TARGETS` — full data-center + consumer set (gfx906, 908, 90a, 942, 950, 1030, 1100/01/02, 1150/51, 1200/01) |
| 51 | + |
| 52 | +## Local builds |
| 53 | + |
| 54 | +The same script the workflow uses also works locally: |
| 55 | + |
| 56 | +```bash |
| 57 | +# Auto-fetch latest ROCm |
| 58 | +sudo ./build_packages_local.sh |
| 59 | + |
| 60 | +# Pin a specific version (use sudo -E to preserve env) |
| 61 | +sudo -E ROCM_VERSION=7.11.0a20260121 GPU_FAMILY=gfx94X-dcgpu ./build_packages_local.sh |
| 62 | + |
| 63 | +# Debug build |
| 64 | +sudo -E BUILD_TYPE=Debug ./build_packages_local.sh |
| 65 | +``` |
| 66 | + |
| 67 | +`sudo` is required because the script installs system packages |
| 68 | +(`libnuma-dev`, `libibverbs-dev`, `libopenmpi-dev`, etc). |
| 69 | + |
| 70 | +After the script completes, packages live under `build/`: |
| 71 | + |
| 72 | +``` |
| 73 | +build/amdrocm7-transferbench_1.66.02-<release>_amd64.deb |
| 74 | +build/amdrocm7-transferbench-1.66.02-<release>.x86_64.rpm |
| 75 | +build/amdrocm7-transferbench-1.66.02-Linux.tar.gz |
| 76 | +``` |
| 77 | + |
| 78 | +## Installing built packages |
| 79 | + |
| 80 | +### Ubuntu / Debian |
| 81 | + |
| 82 | +```bash |
| 83 | +sudo dpkg -i build/amdrocm7-transferbench_*.deb |
| 84 | +/opt/rocm/extras-7/bin/TransferBench |
| 85 | +``` |
| 86 | + |
| 87 | +### Rocky / RHEL / AlmaLinux |
| 88 | + |
| 89 | +```bash |
| 90 | +sudo rpm -i --replacefiles --nodeps build/amdrocm7-transferbench-*.rpm |
| 91 | +/opt/rocm/extras-7/bin/TransferBench |
| 92 | +``` |
| 93 | + |
| 94 | +### Any Linux (TGZ — relocatable install tree, requires ROCm runtime on target) |
| 95 | + |
| 96 | +End-user instructions (pre-install ROCm, runtime dependencies, extract, |
| 97 | +`PATH` / `LD_LIBRARY_PATH`, troubleshooting) live in the project docs at |
| 98 | +[docs/install/INSTALL_TGZ.rst](../../docs/install/INSTALL_TGZ.rst). |
| 99 | + |
| 100 | +Quick smoke test from the repo root after a successful build: |
| 101 | + |
| 102 | +```bash |
| 103 | +sudo mkdir -p /opt/rocm/extras-7 |
| 104 | +sudo tar -xzf build/amdrocm7-transferbench-*.tar.gz -C /opt/rocm/extras-7 --strip-components=1 |
| 105 | +export PATH=/opt/rocm/extras-7/bin:$PATH |
| 106 | +# With no args, TransferBench prints version, usage, available presets, |
| 107 | +# and detected topology — a fast end-to-end check that the binary loads |
| 108 | +# its ROCm libs correctly. |
| 109 | +TransferBench |
| 110 | +``` |
| 111 | + |
| 112 | +> Once the `help` and `smoketest` presets land on `develop` (currently on |
| 113 | +> `candidate`), prefer `TransferBench help` for usage and `TransferBench |
| 114 | +> smoketest` for a real correctness check. |
| 115 | +
|
| 116 | +## S3 upload (OIDC) |
| 117 | + |
| 118 | +S3 upload runs only when: |
| 119 | +- The repository is `ROCm/TransferBench`, **and** |
| 120 | +- The `AWS_S3_BUCKET` repository variable is set. |
| 121 | + |
| 122 | +Upload uses **AWS OIDC** — no long-term keys are stored in the repo. |
| 123 | + |
| 124 | +### S3 path layout |
| 125 | + |
| 126 | +| Trigger | Path | |
| 127 | +|---------|------| |
| 128 | +| `release/*` push or dispatch | `release/transferbench/{deb,rpm,tar}/` | |
| 129 | +| Schedule, push to `develop`/`mainline`, dispatch on non-release | `nightly/transferbench/{deb,rpm,tar}/` | |
| 130 | +| Pull request (same repo) | `transferbench/<head_ref>/<run_number>/{ubuntu-22.04,manylinux_2_28}/` | |
| 131 | + |
| 132 | +### Required repository setup |
| 133 | + |
| 134 | +In **Settings → Secrets and variables → Actions**: |
| 135 | + |
| 136 | +**Secrets tab:** |
| 137 | +- `AWS_ROLE_ARN` — IAM role ARN with OIDC trust for this repo (e.g. `arn:aws:iam::123456789012:role/rocm-transferbench-s3-upload`) |
| 138 | + |
| 139 | +**Variables tab:** |
| 140 | +- `AWS_S3_BUCKET` — bucket name (e.g. `rocm-transferbench-packages`) |
| 141 | +- `RUNNER_LABEL` (optional) — override Ubuntu runner label (default `ubuntu-22.04`) |
| 142 | +- `RUNNER_LABEL_CONTAINER` (optional) — override container-job runner label (default `ubuntu-latest`) |
| 143 | +- `RUNNER_LABEL_UTILITY` (optional) — override summary-job runner label (default `ubuntu-latest`) |
| 144 | + |
| 145 | +### IAM role trust policy |
| 146 | + |
| 147 | +The role in `AWS_ROLE_ARN` must trust GitHub's OIDC provider: |
| 148 | + |
| 149 | +```json |
| 150 | +{ |
| 151 | + "Version": "2012-10-17", |
| 152 | + "Statement": [{ |
| 153 | + "Effect": "Allow", |
| 154 | + "Principal": { |
| 155 | + "Federated": "arn:aws:iam::<ACCOUNT_ID>:oidc-provider/token.actions.githubusercontent.com" |
| 156 | + }, |
| 157 | + "Action": "sts:AssumeRoleWithWebIdentity", |
| 158 | + "Condition": { |
| 159 | + "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" }, |
| 160 | + "StringLike": { "token.actions.githubusercontent.com:sub": "repo:ROCm/TransferBench:*" } |
| 161 | + } |
| 162 | + }] |
| 163 | +} |
| 164 | +``` |
| 165 | + |
| 166 | +Permissions needed: `s3:PutObject`, `s3:GetObject`, `s3:ListBucket`, `s3:DeleteObject` on the bucket. |
| 167 | + |
| 168 | +## Using the S3 paths as apt / yum repos |
| 169 | + |
| 170 | +Push and scheduled builds also publish APT / YUM metadata so the S3 paths |
| 171 | +work directly as native package repositories. |
| 172 | + |
| 173 | +### apt (Ubuntu / Debian) |
| 174 | + |
| 175 | +```bash |
| 176 | +echo "deb [trusted=yes] https://<bucket>.s3.amazonaws.com/nightly/transferbench/deb/ ./" \ |
| 177 | + | sudo tee /etc/apt/sources.list.d/transferbench-nightly.list |
| 178 | +sudo apt update |
| 179 | +sudo apt install amdrocm7-transferbench |
| 180 | +``` |
| 181 | + |
| 182 | +### yum / dnf (Rocky / RHEL / AlmaLinux) |
| 183 | + |
| 184 | +```bash |
| 185 | +sudo tee /etc/yum.repos.d/transferbench-nightly.repo <<'EOF' |
| 186 | +[transferbench-nightly] |
| 187 | +name=TransferBench Nightly |
| 188 | +baseurl=https://<bucket>.s3.amazonaws.com/nightly/transferbench/rpm/ |
| 189 | +enabled=1 |
| 190 | +gpgcheck=0 |
| 191 | +EOF |
| 192 | +sudo dnf install amdrocm7-transferbench |
| 193 | +``` |
| 194 | + |
| 195 | +> **Note:** `[trusted=yes]` / `gpgcheck=0` skip GPG verification. For |
| 196 | +> production deployments, sign packages and metadata with a GPG key. |
| 197 | +
|
| 198 | +## Verifying RPATH |
| 199 | + |
| 200 | +```bash |
| 201 | +readelf -d /opt/rocm/extras-7/bin/TransferBench | grep -E 'RPATH|RUNPATH' |
| 202 | +# Should contain $ORIGIN, $ORIGIN/../lib, /opt/rocm/extras-7/lib |
| 203 | +``` |
| 204 | + |
| 205 | +## Troubleshooting |
| 206 | + |
| 207 | +### S3 step fails with "Credentials could not be loaded" |
| 208 | + |
| 209 | +- PR from a fork: OIDC is unavailable; the upload step is skipped. |
| 210 | +- Same-repo: confirm `AWS_ROLE_ARN` secret is set and the role's trust |
| 211 | + policy allows `repo:ROCm/TransferBench:*`. |
| 212 | + |
| 213 | +### Build fails: missing `libibverbs.h` / `mpi.h` |
| 214 | + |
| 215 | +The packaged builds disable both `ENABLE_NIC_EXEC` and `ENABLE_MPI_COMM`, so these |
| 216 | +headers are not required. If you've manually re-enabled either flag for a local |
| 217 | +build, install the dev packages yourself: |
| 218 | + |
| 219 | +```bash |
| 220 | +# Ubuntu — for ENABLE_NIC_EXEC=ON |
| 221 | +sudo apt install -y libibverbs-dev rdma-core |
| 222 | +# Ubuntu — for ENABLE_MPI_COMM=ON |
| 223 | +sudo apt install -y libopenmpi-dev openmpi-bin |
| 224 | +# Rocky/RHEL |
| 225 | +sudo dnf install -y rdma-core-devel openmpi-devel |
| 226 | +``` |
| 227 | + |
| 228 | +### TheRock tarball download 404s |
| 229 | + |
| 230 | +Check available builds at |
| 231 | +<https://therock-nightly-tarball.s3.amazonaws.com/index.html>. Set |
| 232 | +`ROCM_VERSION` explicitly to a known-good version. |
| 233 | + |
| 234 | +## References |
| 235 | + |
| 236 | +- [TheRock Releases](https://github.com/ROCm/TheRock/blob/main/RELEASES.md) |
| 237 | +- [TheRock nightly tarballs](https://therock-nightly-tarball.s3.amazonaws.com/index.html) |
| 238 | +- [ROCmValidationSuite packaging workflow](https://github.com/ROCm/ROCmValidationSuite/blob/master/.github/workflows/README_BUILD_PACKAGES.md) — reference implementation |
| 239 | +- [TransferBench README](../../README.md) |
0 commit comments