CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
63 lines
3.6 KiB
Markdown
63 lines
3.6 KiB
Markdown
# Using Project Dockerfiles
|
|
|
|
## Building/Running User Image
|
|
|
|
[user-image/start_user_container](https://github.com/ROCm/rocRoller/blob/master/docker/user-image/start_user_container) can be used to automatically build and run the base and user dockerfiles. It must be run from the root of the project repo. It does the following for you:
|
|
|
|
- Builds both of the the base dockerfiles([clang](https://github.com/ROCm/rocRoller/blob/master/docker/dockerfile-ubuntu-clang) and/or [gcc](https://github.com/ROCm/rocRoller/blob/master/docker/dockerfile-ubuntu-gcc)).
|
|
- Builds the [user dockerfile](https://github.com/ROCm/rocRoller/blob/master/docker/user-image/Dockerfile), based on both of the newly built base images.
|
|
- Starts a container from the newly built user images with the following properties:
|
|
- It's named with your host username so it's easy to manage later.
|
|
- It has a user whose name and ID match your host user.
|
|
- That user has git configured with the same git username and email as the host user.
|
|
- The host git repo is mounted in the `/data` folder.
|
|
- The correct arguments are passed in to give the container access to the host GPUs.
|
|
|
|
The defaults are good for most cases. For example, the following will checkout the repo and build/run the gcc and clang dockerfiles.
|
|
|
|
```shell
|
|
$ git checkout git@github.com:ROCm/rocRoller.git rocroller
|
|
$ cd rocroller
|
|
$ ./docker/user-image/start_user_container
|
|
...
|
|
Enter these containers with the following commands:
|
|
docker exec -ti -u USER USER_dev_clang bash
|
|
docker exec -ti -u USER USER_dev_gcc bash
|
|
```
|
|
|
|
After running the script, there will be containers running that you can enter and exit:
|
|
|
|
```shell
|
|
$ docker ps -a
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
b6d83ba92ff3 roller-gcc-user:latest "/opt/user-entrypoint" 20 minutes ago Up <1 minutes USER_dev_gcc
|
|
5e502b7b5cab roller-clang-user:latest "/opt/user-entrypoint" 21 minutes ago Up <1 minutes USER_dev_clang
|
|
$ docker exec -ti -u USER USER_dev_clang bash
|
|
$ ls /data
|
|
CMakeLists.txt CppCheckSuppressions.txt GPUArchitectureGenerator README.md build_clang build_gcc dependencies docker docs lib scripts test
|
|
$ exit
|
|
$ docker exec -ti -u USER USER_dev_gcc bash
|
|
$ ls /data
|
|
CMakeLists.txt CppCheckSuppressions.txt GPUArchitectureGenerator README.md build_clang build_gcc dependencies docker docs lib scripts test
|
|
$ exit
|
|
```
|
|
|
|
> Note: The containers started by the script will exist until they are manually removed. To manually remove a container you can use `docker rm -f <container name>`.
|
|
|
|
The following is a more complicated example that uses the following options:
|
|
|
|
- `--privileged`: runs the container in prvileged mode.
|
|
- `--delete_existing_container`: will remove any already launched containers and replace them with newly launched ones.
|
|
- `--versions clang`: instructs the script to only build and run the clang version of the dockerfile.
|
|
- `--user_build_extra_args="--no-cache"`: passes the extra argument `--no-cache` to `docker build` when building the user image.
|
|
- `--volumes="/home/USER:/host_home"`: adds the extra volume mapping to the `docker run` command.
|
|
|
|
```shell
|
|
$ ./docker/user-image/start_user_container --privileged \
|
|
--delete_existing_container \
|
|
--versions clang \
|
|
--user_build_extra_args="--no-cache" \
|
|
--volumes="/home/USER:/host_home"
|
|
```
|
|
For a full list of options see `./docker/user-image/start_user_container -h`.
|