From 59f0385d71884eb682c5e6be456596fa038cbc75 Mon Sep 17 00:00:00 2001 From: Vignesh Edithal Date: Tue, 17 Dec 2024 12:03:07 -0800 Subject: [PATCH] Use Docker to setup development environment --- Dockerfile | 29 +++++++++++++++++++++++++++++ README.md | 4 ++++ docker-compose.yml | 8 ++++++++ 3 files changed, 41 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..19c91b4fd --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/README.md b/README.md index 36d4d7f5d..063b14a34 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,10 @@ from the `amd-mainline` branch, while new features are developed in our Users may checkout `amd-staging` to preview upcoming features. +## Testing + +To quickly get the environment for building and testing in a bash shell, you can run `docker compose run app` + ## How to Cite This software can be cited using a Zenodo diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..73a185024 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + app: + build: . + devices: + - /dev/kfd + - /dev/dri + security_opt: + - seccomp:unconfined \ No newline at end of file