-
-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash -ex | ||
# The purpose of this script is simplify running scripts inside of our | ||
# dev_env docker container. It mounts the workspace and the | ||
# workspace/../build directory inside of the container, and executes | ||
# any arguments passed to the dev_env.sh | ||
script_link="$( readlink "$BASH_SOURCE" )" || script_link="$BASH_SOURCE" | ||
apparent_sdk_dir="${script_link%/*}" | ||
if [ "$apparent_sdk_dir" == "$script_link" ]; then | ||
apparent_sdk_dir=. | ||
fi | ||
sdk_dir="$( command cd -P "$apparent_sdk_dir" > /dev/null && pwd -P )" | ||
|
||
bash_args=$@ | ||
if [[ -z "$bash_args" ]] ; then | ||
bash_args=bash | ||
fi | ||
|
||
docker_data_volume="-v ${DATA_DIR}:${DATA_DIR}" | ||
if [[ -z "$DATA_DIR" ]] ; then | ||
docker_data_volume="-v $(pwd):$(pwd)" | ||
fi | ||
|
||
docker_command=nvidia-docker | ||
|
||
repo=${ARRAIY_REPO:=arraiy/torchgeometry} | ||
|
||
$docker_command \ | ||
run \ | ||
-it \ | ||
$docker_data_volume \ | ||
-v $sdk_dir:/code/torchgeometry \ | ||
-v $HOME/.Xauthority:/root/.Xauthority \ | ||
--net=host \ | ||
--env="DISPLAY" \ | ||
--env="QT_X11_NO_MITSHM=1" \ | ||
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ | ||
--privileged \ | ||
--device /dev/dri \ | ||
$repo \ | ||
bash -c "cd /code/torchgeometry && $bash_args" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM nvidia/cuda:9.1-cudnn7-devel-ubuntu16.04 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
vim \ | ||
ca-certificates &&\ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
chmod +x ~/miniconda.sh && \ | ||
~/miniconda.sh -b -p /opt/conda && \ | ||
rm ~/miniconda.sh && \ | ||
/opt/conda/bin/conda install -y python=$PYTHON_VERSION numpy pyyaml scipy ipython mkl mkl-include cython typing && \ | ||
/opt/conda/bin/conda install -y -c pytorch magma-cuda90 && \ | ||
/opt/conda/bin/conda clean -ya | ||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
RUN conda install pytorch torchvision cuda91 -c pytorch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash -ex | ||
# This script is useful to build the dev_env container. | ||
script_link="$( readlink "$BASH_SOURCE" )" || script_link="$BASH_SOURCE" | ||
apparent_sdk_dir="${script_link%/*}" | ||
if [ "$apparent_sdk_dir" == "$script_link" ]; then | ||
apparent_sdk_dir=. | ||
fi | ||
|
||
sdk_dir="$( command cd -P "$apparent_sdk_dir/../" > /dev/null && pwd -P )" | ||
|
||
# This builds the docker file, from the root of the workspace | ||
docker build -t arraiy/torchgeometry -f Dockerfile $sdk_dir |