Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Docker to setup development environment #515

Open
wants to merge 3 commits into
base: amd-staging
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ from the `amd-mainline` branch, while new features are developed in our

Users may checkout `amd-staging` to preview upcoming features.

## Testing
vedithal-amd marked this conversation as resolved.
Show resolved Hide resolved

To quickly get the environment (bash shell) for building and testing, run the following commands:
* `cd utils/docker_env`
* `docker compose run app`

Inside the docker container, clean, build and install the project with tests enabled:
```
rm -rf build install && cmake -B build -D CMAKE_INSTALL_PREFIX=install -D ENABLE_TESTS=ON -D INSTALL_TESTS=ON -DENABLE_COVERAGE=ON -S . && cmake --build build --target install --parallel 8
```

Note that per the above command, build assets will be stored under `build` directory and installed assets will be stored under `install` directory.

Then, to run the automated test suite, run the following command:
```
ctest
```

For manual testing, you can find the executable at `install/bin/rocprof-compute`

NOTE: This Dockerfile uses `rocm/dev-ubuntu-22.04` as the base image

## How to Cite

This software can be cited using a Zenodo
Expand Down
29 changes: 29 additions & 0 deletions utils/docker_env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use a base image
FROM rocm/dev-ubuntu-22.04

# Set the working directory
WORKDIR /app

# Update package list and install prerequisites
RUN apt-get update && apt-get install -y \
software-properties-common cmake locales \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update

# Generate the desired locale
RUN locale-gen en_US.UTF-8

# Install Python 3.10 and pip
RUN apt-get install -y python3.10 python3.10-venv python3.10-dev python3-pip

# Set Python 3.10 as the default python3
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

# Copy your application code to the container
COPY . .

# Install any dependencies specified in requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt -r requirements-test.txt

# Command to run your application
CMD ["/bin/bash"]
10 changes: 10 additions & 0 deletions utils/docker_env/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
app:
build:
context: ../../
dockerfile: utils/docker_env/Dockerfile
devices:
- /dev/kfd
- /dev/dri
security_opt:
- seccomp:unconfined
Loading