3

GCP gives a general overview of what's installed in Deep Learning VMs, but seeing the actual shell scripts would make it easier to determine the exact differences between VM images, debug any deployment issues, and create derivative images.

Someone already asked about the Dockerfiles for Deep Learning Containers, but I figured I'd repeat the question to increase the odds of it getting answered.

skeller88
  • 4,276
  • 1
  • 32
  • 34

2 Answers2

2

You can create and set up a local deep learning container. Have a look at the official documentation Getting started with a local deep learning container, but keep in mind that this product is in a pre-release state and might change or have limited support. Here you can find container images to choose from. Unfortunately, there's no source code.

Meanwhile, you can follow instructions from @John Hanley: "You can pull a container image and show the "history" for the container. This shows you how it is built and what the original starting image. This does not mean that you access the original image. You can add to and remove parts of the image. You can also export an image to a tar archive file, modify and then reimport".

intotecho
  • 4,925
  • 3
  • 39
  • 54
Serhii Rohoza
  • 4,287
  • 2
  • 16
  • 29
0

The instructions from @John Hanely gets you the docker commands to help understand how a container was built.

If the first docker command in the output is a FROM, then you could repeat the process on that base container.

$docker pull gcr.io/deeplearning-platform-release/tf-cpu:m96
...
$ docker history  gcr.io/deeplearning-platform-release/tf-cpu:m96 --format  " {{.CreatedBy}}" --no-trunc

RUN |2 VERSION=1-15 CONTAINER_NAME=tf-cpu/1-15 /bin/sh -c cd /opt/google/licenses &&     chmod +x query_licenses.sh &&     ./query_licenses.sh # buildkit
RUN |2 VERSION=1-15 CONTAINER_NAME=tf-cpu/1-15 /bin/sh -c BAZEL_INSTALLER_URL="https://github.com/bazelbuild/bazel/releases/download/0.19.0/bazel-0.19.0-installer-linux-x86_64.sh" &&     BAZEL_INSTALLER_FILE="bazel_installer.sh" &&     wget -q "${BAZEL_INSTALLER_URL}" -O "${BAZEL_INSTALLER_FILE}" &&     chmod +x "${BAZEL_INSTALLER_FILE}" &&     "./${BAZEL_INSTALLER_FILE}" &&     rm -rf "./${BAZEL_INSTALLER_FILE}" # buildkit
RUN |2 VERSION=1-15 CONTAINER_NAME=tf-cpu/1-15 /bin/sh -c export CONDA_REPOSITORY="/tmp/conda" &&     chmod +x /opt/google/conda/install_to_env.sh &&     ENV_DOCKER=1 /opt/google/conda/install_to_env.sh base dlenv-tf-${VERSION}-cpu-meta # buildkit
ENV KMP_SETTINGS=1
ENV KMP_AFFINITY=granularity=fine,verbose,compact,1,0
ENV KMP_BLOCKTIME=0
ENV CONTAINER_NAME=tf-cpu/1-15
ARG CONTAINER_NAME
LABEL com.google.environment=Container: TensorFlow 1-15
ARG VERSION
CMD ["/run_jupyter.sh"]
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c chmod +x run_jupyter.sh # buildkit
COPY build/container/run_jupyter.sh /run_jupyter.sh # buildkit
ENTRYPOINT ["/entrypoint.sh"]
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c chmod +x entrypoint.sh # buildkit
COPY build/container/entrypoint.sh /entrypoint.sh # buildkit
COPY build/package/conda/channels.json /opt/google/conda/channels.json # buildkit
COPY build/package/packages/jupyter/jupyter_notebook_config.py /opt/jupyter/.jupyter/jupyter_notebook_config.py # buildkit
COPY build/package/packages/jupyter/ipython_kernel_config.py /etc/ipython/ipython_kernel_config.py # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c chown -R "jupyter:jupyter" "/home/jupyter/." # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c adduser --uid 1000 --gid 1001 jupyter # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c addgroup --gid 1001 jupyter # buildkit
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/lib:/usr/local/lib/x86_64-linux-gnu:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:
VOLUME [/home/jupyter]
EXPOSE map[8080/tcp:{}]
ENV SHELL=/bin/bash
ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c chmod +x /opt/google/conda/provision_conda.sh && /opt/google/conda/provision_conda.sh # buildkit
ENV DL_ANACONDA_HOME=/opt/conda
ENV ANACONDA_PYTHON_VERSION=3.7
COPY build/vm/packer/generic/packages /opt/google # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c cd / &&     gsutil cp -r gs://dl-platform-binaries-builds/openmpi-4.0.2/v20191105/openmpi.tar.gz  . &&     tar xf openmpi.tar.gz &&     rm -f openmpi.tar.gz # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c apt update -y &&     apt install -y libnuma-dev # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c if dpkg -s libnccl2; then         echo "deb https://packages.cloud.google.com/apt google-fast-socket main" | tee /etc/apt/sources.list.d/google-fast-socket.list &&         curl -s -L https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - &&         apt-get --allow-releaseinfo-change update && apt install -y google-fast-socket;     fi # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c apt-get --allow-releaseinfo-change update -y &&     apt-get install -y dirmngr &&     apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B57C5C2836F4BEB &&     apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FEEA9169307EA071 &&     apt-get --allow-releaseinfo-change update -y &&     echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list &&     curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - &&     apt-get --allow-releaseinfo-change update -y &&     apt-get install -y apt-transport-https ca-certificates gnupg &&     echo "deb http://packages.cloud.google.com/apt gcsfuse-focal main" | tee /etc/apt/sources.list.d/gcsfuse.list &&     curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - &&     apt-get --allow-releaseinfo-change update -y &&     apt-get install -y google-cloud-sdk && apt-get install -y gcsfuse &&     rm -rf /var/lib/apt/lists/* # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c apt-get --allow-releaseinfo-change -o Acquire::Check-Valid-Until=false update -y &&     apt-get install --no-install-recommends -y -q        $(grep -vE "^\s*#" aptget-requirements.txt | tr "\n" " ") &&     rm -rf /var/lib/apt/lists/* &&     rm -rf aptget-requirements.txt # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c if [ "${BASE_IMAGE}" =~ "^nvidia. *" ]; then       apt update -y || true && apt install -y wget && apt install -yq software-properties-common &&       wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin &&       mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 &&       apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub &&       add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" &&       apt-get --allow-releaseinfo-change update;     fi # buildkit
COPY build/vm/packer/base/aptget-requirements.txt /aptget-requirements.txt # buildkit
RUN |1 DEBIAN_FRONTEND=noninteractive /bin/sh -c apt update --allow-releaseinfo-change -y &&     apt upgrade -y # buildkit
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
LABEL com.google.environment=Container: Minimal
/bin/sh -c #(nop)  CMD ["bash"]
/bin/sh -c #(nop) ADD file:ff6963f777661fb16cc12fb04a97c558bd94768a6e4ab5bd90e01f3086818853 in /
intotecho
  • 4,925
  • 3
  • 39
  • 54