Unverified Commit 7d947757 authored by guoshzhao's avatar guoshzhao Committed by GitHub
Browse files

Benchmarks: Docker Benchmarks - Setup Docker-in-Docker environment (#180)

**Description**
Setup docker environment in docker container.

**Major Revision**
- Install docker client for cuda and rocm images.
- Mount /var/run/docker.sock from host
parent b90b47f3
...@@ -2,6 +2,7 @@ FROM nvcr.io/nvidia/pytorch:20.12-py3 ...@@ -2,6 +2,7 @@ FROM nvcr.io/nvidia/pytorch:20.12-py3
# OS: # OS:
# - Ubuntu: 20.04 # - Ubuntu: 20.04
# - Docker Client: 20.10.8
# NVIDIA: # NVIDIA:
# - CUDA: 11.1.1 # - CUDA: 11.1.1
# - cuDNN: 8.0.5 # - cuDNN: 8.0.5
...@@ -41,6 +42,13 @@ RUN apt-get update && \ ...@@ -41,6 +42,13 @@ RUN apt-get update && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /opt/cmake-3.14.6-Linux-x86_64 rm -rf /var/lib/apt/lists/* /tmp/* /opt/cmake-3.14.6-Linux-x86_64
# Install Docker
ENV DOCKER_VERSION=20.10.8
RUN cd /tmp && \
wget https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz
# Configure SSH # Configure SSH
RUN mkdir -p /root/.ssh && \ RUN mkdir -p /root/.ssh && \
touch /root/.ssh/authorized_keys && \ touch /root/.ssh/authorized_keys && \
......
...@@ -2,6 +2,7 @@ FROM rocm/pytorch:rocm4.0_ubuntu18.04_py3.6_pytorch_1.7.0 ...@@ -2,6 +2,7 @@ FROM rocm/pytorch:rocm4.0_ubuntu18.04_py3.6_pytorch_1.7.0
# OS: # OS:
# - Ubuntu: 18.04 # - Ubuntu: 18.04
# - Docker Client: 20.10.8
# AMD: # AMD:
# - ROCm: 4.0 # - ROCm: 4.0
# - HIP: 3.21.2 # - HIP: 3.21.2
...@@ -41,6 +42,13 @@ RUN wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | APT_KEY_DON ...@@ -41,6 +42,13 @@ RUN wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | APT_KEY_DON
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* rm -rf /var/lib/apt/lists/* /tmp/*
# Install Docker
ENV DOCKER_VERSION=20.10.8
RUN cd /tmp && \
wget https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz
# Configure SSH # Configure SSH
RUN mkdir -p /root/.ssh && \ RUN mkdir -p /root/.ssh && \
touch /root/.ssh/authorized_keys && \ touch /root/.ssh/authorized_keys && \
......
...@@ -2,6 +2,7 @@ FROM rocm/pytorch:rocm4.2_ubuntu18.04_py3.6_pytorch_1.7.0 ...@@ -2,6 +2,7 @@ FROM rocm/pytorch:rocm4.2_ubuntu18.04_py3.6_pytorch_1.7.0
# OS: # OS:
# - Ubuntu: 18.04 # - Ubuntu: 18.04
# - Docker Client: 20.10.8
# AMD: # AMD:
# - ROCm: 4.2 # - ROCm: 4.2
# - HIP: 3.27.5 # - HIP: 3.27.5
...@@ -41,6 +42,13 @@ RUN wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | APT_KEY_DON ...@@ -41,6 +42,13 @@ RUN wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | APT_KEY_DON
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* rm -rf /var/lib/apt/lists/* /tmp/*
# Install Docker
ENV DOCKER_VERSION=20.10.8
RUN cd /tmp && \
wget https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -O docker.tgz && \
tar --extract --file docker.tgz --strip-components 1 --directory /usr/local/bin/ && \
rm docker.tgz
# Configure SSH # Configure SSH
RUN mkdir -p /root/.ssh && \ RUN mkdir -p /root/.ssh && \
touch /root/.ssh/authorized_keys && \ touch /root/.ssh/authorized_keys && \
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
{{ '--gpus=all' if nvidia_gpu_exist else '' }} \ {{ '--gpus=all' if nvidia_gpu_exist else '' }} \
{{ '--security-opt seccomp=unconfined --group-add video' if amd_gpu_exist else '' }} \ {{ '--security-opt seccomp=unconfined --group-add video' if amd_gpu_exist else '' }} \
-w /root -v {{ workspace }}:/root -v /mnt:/mnt \ -w /root -v {{ workspace }}:/root -v /mnt:/mnt \
-v /var/run/docker.sock:/var/run/docker.sock \
{{ docker_image }} bash && \ {{ docker_image }} bash && \
docker exec {{ container }} bash -c \ docker exec {{ container }} bash -c \
"chown -R root:root ~ && \ "chown -R root:root ~ && \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment