From 97a884bb351effa7489215aa515328c35259aece Mon Sep 17 00:00:00 2001 From: OeslleLucena Date: Wed, 15 Jul 2020 11:06:38 +0100 Subject: [PATCH 1/3] add docker file instructions --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index a5ed026..56f7974 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,25 @@ pip install tox tox ``` +### Docker Image +You can also directly use TAPAS via Docker. + +For first time use of nvidia-docker, it is important to run the following commands: + +``` +distribution=$(. /etc/os-release;echo $ID$VERSION_ID) +curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - +curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list +sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit +sudo systemctl restart docker +``` + +To pull and run the docker image (contains all prerequisites) you can call the following command: + +``` +sudo docker run -it --gpus all -v /absolute/path/to/my/data/directory:/home/data oeslle/tapas:1.0 +``` + ## Data See the section below for the pre-training data. From b59120ca43826a2d1ba3dc24c717c5b4db4e001c Mon Sep 17 00:00:00 2001 From: OeslleLucena Date: Tue, 21 Jul 2020 11:07:45 +0100 Subject: [PATCH 2/3] Update README.md Added official documentation link for Nvidia-docker and Dockerfile instructions. --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 56f7974..7df2f48 100644 --- a/README.md +++ b/README.md @@ -41,23 +41,20 @@ pip install tox tox ``` -### Docker Image -You can also directly use TAPAS via Docker. +### Docker +You can also directly use TAPAS via Docker. NVIDIA driver and Docker 19.03+ must be installed beforehand. There is no need to install the CUDA toolkit on the host, but the driver needs to be installed. More details can be found on [nvidia-docker](https://github.com/NVIDIA/nvidia-docker). -For first time use of nvidia-docker, it is important to run the following commands: +#### Build Image +To build a docker image you can call the following command in the same folder the `Dockerfile` is: ``` -distribution=$(. /etc/os-release;echo $ID$VERSION_ID) -curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - -curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list -sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit -sudo systemctl restart docker +docker build --tag tapas:latest . ``` -To pull and run the docker image (contains all prerequisites) you can call the following command: +Then, you can simply call the following command to run image: ``` -sudo docker run -it --gpus all -v /absolute/path/to/my/data/directory:/home/data oeslle/tapas:1.0 +docker run -it --gpus all -v /absolute/path/to/my/data/directory:/home/data tapas:latest ``` ## Data From 32b2f025132fc34b2794e0b6a4cb9a4177e4b648 Mon Sep 17 00:00:00 2001 From: OeslleLucena Date: Tue, 21 Jul 2020 11:10:55 +0100 Subject: [PATCH 3/3] Create Dockerfile Added Dockerfile. --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c359250 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 +LABEL maintainer="oeslle.lucena@gmail.com" + +# Set up environment +RUN DEBIAN_FRONTEND="noninteractive" apt-get update \ + && apt-get install -y \ + dialog apt-utils \ + curl \ + htop \ + nano \ + tmux \ + git \ + python3 \ + python3-pip \ + protobuf-compiler + +# Install TaPAS +RUN cd /home \ + && git clone https://github.com/google-research/tapas.git \ + && cd tapas \ + && pip3 install --upgrade pip \ + && pip install --upgrade setuptools \ + && pip install --upgrade six \ + && pip install scipy==1.4.1 \ + && pip install oauth2client==4.1.2 \ + && pip install -e . \ + && pip install tox \ + && tox +