Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/run_umt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if [ "$1" == "build_umt" ]; then
fi

pushd $AOMP_REPOS_TEST/$CAMP_SRC_DIR
git clone https://github.com/LLNL/camp.git .
git clone --branch v2025.12.0 https://github.com/LLNL/camp.git .
rm -rf build
mkdir build
pushd build
Expand Down Expand Up @@ -120,6 +120,7 @@ if [ "$1" == "build_umt" ]; then
pushd $AOMP_REPOS_TEST/$UMPIRE_SRC_DIR
git clone https://github.com/LLNL/Umpire.git .
git submodule update --init
git -C src/tpl/umpire/camp checkout v2025.12.0
rm -rf build
mkdir build
pushd build
Expand Down
100 changes: 100 additions & 0 deletions upstream-buildbots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,106 @@ A manual start of the container should look similar to
sudo docker run --rm -it --network=host --device=/dev/kfd --device=/dev/dri --group-add video --cpuset-cpus 0-31 --user botworker <container-image> bash
```

## Quick setup with `run.py`

`run.py` is a helper that lets a developer quickly set up an environment from one
of the manylinux image directories (e.g. `manylinux-build-only`, `manylinux-hip-tpl`)
for local debugging and reproduction. It downloads the base build context from
[TheRock](https://github.com/ROCm/TheRock/tree/main/dockerfiles), builds the
images, and creates a container ready to `docker exec` into.

### Usage

```
python run.py <target> [--pull] [--build] [--rebuild-base] [--clean] [--clean-all] [options]
```

`<target>` is one of `manylinux-build-only` or `manylinux-hip-tpl`.

When no operation flag is given, the default flow is **pull then build** (download
the base files, build the images, and start the container). The operations run in
a fixed order (`clean` -> `pull` -> `build`) and abort if any step fails.

| Operation | Meaning |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `--pull` | Download `build_manylinux_x86_64.Dockerfile` and the helper scripts it needs into `<dest>/manylinux-base`. |
| `--build` | Build the base image `localhost/manylinux:base` (only if missing), build the target image (tagged `<target>`), then create and run a container. |
| `--rebuild-base` | Rebuild `localhost/manylinux:base` even if it already exists, then build the target image and run a container. |
| `--clean` | Remove the selected container. |
| `--clean-all` | Remove the selected container, the target image, and the base image. |

| Option | Default | Meaning |
| ---------- | -------------- | -------------------------------------------------------------------- |
| `--dest` | current dir | Where the base build context (`manylinux-base/`) is downloaded/read. |
| `--name` | generated for build, required for clean | Container name. |
| `--no-gpu` | (off) | Skip the GPU device/group run flags when starting the container. |
| `--llvm-src` | (none) | Bind-mount a local LLVM source tree at `/home/botworker/bbot/llvm-project`. |

`--dest` is not remembered between runs. If you split `--pull` and `--build` into
two separate invocations and pulled to a non-default location, you must pass the
same `--dest` to `--build` so it can find the downloaded base files. For example,
after `python run.py manylinux-build-only --pull --dest ~/test`, build with:

```
python run.py manylinux-build-only --build --dest ~/test
```

Omitting `--dest` on the build step would look in `./manylinux-base` instead and
fail with a "Run a pull first" error (the base image is only built by `--build`,
not by `--pull`).

If upstream TheRock base files changed and you want to rebuild the local
`localhost/manylinux:base` image from the downloaded files, pass `--rebuild-base`
with the build step.

Use `--llvm-src` to mount an existing local LLVM checkout instead of cloning
inside the container; it appears at `/home/botworker/bbot/llvm-project`.
This is a normal read-write Docker bind mount: Docker preserves the host
checkout's UID/GID ownership, and `run.py` does not remap UID/GID. The container
runs as the image default user, so access follows normal Unix file permissions.

When `--build` is used without `--name`, `run.py` generates a container name with
the form `test-<target>-<5-digit-random-number>`, such as
`test-manylinux-build-only-12345`. The generated name is printed after the
container starts. `--clean` and `--clean-all` require `--name` so the script knows
which container to remove.

The container is started detached and kept alive, so you can open a shell with:

```
docker exec -it <container-name> bash
```

### Examples

```
# Default: pull base files, build the images, and start the container
python run.py manylinux-build-only

# Only download the base Dockerfile + helper scripts
python run.py manylinux-build-only --pull

# Split pull and build into two steps with a custom location
# (pass the same --dest to both so build can find the pulled files)
python run.py manylinux-build-only --pull --dest ~/test
python run.py manylinux-build-only --build --dest ~/test

# Build and run without GPU device flags
python run.py manylinux-build-only --build --no-gpu

# Rebuild the local base image from downloaded TheRock files
python run.py manylinux-build-only --build --rebuild-base

# Mount a local LLVM source tree instead of cloning inside the container
python run.py manylinux-hip-tpl --build --llvm-src ~/git/llvm-project

# Remove the selected container
python run.py manylinux-build-only --clean --name test-manylinux-build-only-12345

# Remove the selected container and images
python run.py manylinux-build-only --clean-all --name test-manylinux-build-only-12345
```

## Assumptions / Requirements

- The images require a working AMDGPU dkms / KFD to be installed in order to test work on the GPU.
Expand Down
Loading
Loading