Skip to content

Instantly share code, notes, and snippets.

@bartbroere
Last active November 23, 2020 14:20
Show Gist options
  • Save bartbroere/7fbde1ac7a5dcd844c094aecff1ee3ab to your computer and use it in GitHub Desktop.
Save bartbroere/7fbde1ac7a5dcd844c094aecff1ee3ab to your computer and use it in GitHub Desktop.

Revisions

  1. bartbroere renamed this gist Nov 23, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. bartbroere created this gist Nov 23, 2020.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # ``nvidia-docker`` compatible ``Dockerfile`` for ``ray``

    Work in progress Dockerfile to create a GPU enabled Ray runtime with Nvidia Docker.

    Uses the environment variable ``RAY_CLUSTER`` to connect to an existing Ray cluster (given its Redis location).
    28 changes: 28 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04

    # At build time we might require a proxy, depending on our network configuration
    ARG http_proxy
    ARG https_proxy
    ENV http_proxy=$http_proxy
    ENV https_proxy=$https_proxy
    ENV HTTP_PROXY=$http_proxy
    ENV HTTPS_PROXY=$https_proxy

    ENV DEBIAN_FRONTEND noninteractive
    ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-10.0/compat/

    RUN apt-get update && apt-get install -y --fix-missing \
    nano \
    wget \
    python3.7 \
    python3-distutils \
    python3-dev

    RUN wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py';
    RUN python3.7 get-pip.py \
    --disable-pip-version-check \
    --no-cache-dir

    RUN python3.7 -m pip install ray

    CMD python3.7 -c "import os; import ray; ray.init(redis_address=os.environ.get('RAY_CLUSTER') or None)"