diff --git a/docker/Dockerfile.customrocmtest b/docker/Dockerfile.customrocmtest new file mode 100644 index 0000000000..7efc607c28 --- /dev/null +++ b/docker/Dockerfile.customrocmtest @@ -0,0 +1,49 @@ +# Use a base image +FROM 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 git curl \ + && add-apt-repository ppa:deadsnakes/ppa \ + && apt-get update + +# Allows running git commands in /app +RUN git config --global --add safe.directory /app + +# 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 libsqlite3-dev + +# Update pip +RUN apt remove -y python3-wheel +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py +RUN python3.10 get-pip.py +RUN python3.10 -m pip install --upgrade pip setuptools wheel + +# Set Python 3.10 as the default python3 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 + +# Remove blinker python package +RUN apt-get remove -y python3-blinker + +# Install rocm +# Define custom version +ARG DEB_FILE="" +ARG AMDGPU_BUILD="" +ARG ROCM_BUILD="" +RUN curl -O "https://artifactory-cdn.amd.com/artifactory/list/amdgpu-deb/${DEB_FILE}" +RUN apt-get install -y "./${DEB_FILE}" +RUN amdgpu-repo --amdgpu-build="${AMDGPU_BUILD}" --rocm-build="compute-rocm-dkms-no-npi-hipclang/${ROCM_BUILD}" +RUN DEBIAN_FRONTEND=noninteractive TZ="America/Toronto" amdgpu-install --yes --usecase=rocm + +# Install any dependencies specified in requirements.txt +# Run interactive bash shell +CMD ["/bin/bash", "-c", "\ + python3.10 -m pip install -r requirements.txt -r requirements-test.txt \ + && exec /bin/bash \ +"] diff --git a/docker/Dockerfile.doctest b/docker/Dockerfile.doctest new file mode 100644 index 0000000000..8b68b54337 --- /dev/null +++ b/docker/Dockerfile.doctest @@ -0,0 +1,27 @@ +# 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 git \ + && add-apt-repository ppa:deadsnakes/ppa \ + && apt-get update + +# Allows running git commands in /app +RUN git config --global --add safe.directory /app + +# 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 + +# Install any dependencies specified in requirements.txt +# Run interactive bash shell + CMD ["/bin/bash", "-c", "\ + python3 -m pip install -r docs/sphinx/requirements.txt \ + && exec /bin/bash \ + "] diff --git a/docker/docker-compose.customrocmtest.yml b/docker/docker-compose.customrocmtest.yml new file mode 100644 index 0000000000..614eb8ed9b --- /dev/null +++ b/docker/docker-compose.customrocmtest.yml @@ -0,0 +1,17 @@ +services: + customrocmtest: # service name + build: + context: ../ + dockerfile: docker/Dockerfile.customrocmtest + devices: + - /dev/kfd + - /dev/dri + security_opt: + - seccomp:unconfined + volumes: + - ../:/app + - ../../rocprofiler-sdk:/rocprofiler-sdk + ports: + - 8050:8050 + tty: true + stdin_open: true diff --git a/docker/docker-compose.doctest.yml b/docker/docker-compose.doctest.yml new file mode 100644 index 0000000000..791ad512bb --- /dev/null +++ b/docker/docker-compose.doctest.yml @@ -0,0 +1,14 @@ +services: + doctest: # service name + build: + context: ../ + dockerfile: docker/Dockerfile.doctest + devices: + - /dev/kfd + - /dev/dri + security_opt: + - seccomp:unconfined + volumes: + - ../:/app + tty: true + stdin_open: true