mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
docker: add environment variable PYTORCH_VERSION (#50154)
Summary: The aim is being able to inspect a container image and determine immediately which version of pytorch it contains. Closes https://github.com/pytorch/pytorch/issues/48324 Signed-off-by: Felix Abecassis <fabecassis@nvidia.com> seemethere PTAL. As you requested in https://github.com/pytorch/pytorch/issues/48324#issuecomment-754237156, I'm submitting the patch. But I could only do limited testing as I'm not sure these Makefile/Dockerfile are used for pushing the Docker Hub images (since the Makefile tags the image with a `v` prefix for the version, as in: `pytorch:v1.7.1`, but Docker Hub images don't have this prefix). Also on the master branch we currently have the following: ``` $ git describe --tags v1.4.0a0-11171-g68a6e46379 ``` So it's a little off, but it behaves as expected on the `release/1.7` branch. Pull Request resolved: https://github.com/pytorch/pytorch/pull/50154 Reviewed By: walterddr Differential Revision: D25828491 Pulled By: seemethere fbshipit-source-id: 500ec96cb5f5da1321610002d5e3678f4b0b94b5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e12008d110
commit
0c3bae6a89
@ -59,6 +59,7 @@ RUN /opt/conda/bin/conda install -c "${INSTALL_CHANNEL}" -y python=${PYTHON_VERS
|
||||
RUN /opt/conda/bin/pip install torchelastic
|
||||
|
||||
FROM ${BASE_IMAGE} as official
|
||||
ARG PYTORCH_VERSION
|
||||
LABEL com.nvidia.volumes.needed="nvidia_driver"
|
||||
RUN --mount=type=cache,id=apt-final,target=/var/cache/apt \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
@ -71,6 +72,7 @@ ENV PATH /opt/conda/bin:$PATH
|
||||
ENV NVIDIA_VISIBLE_DEVICES all
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
|
||||
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
|
||||
ENV PYTORCH_VERSION ${PYTORCH_VERSION}
|
||||
WORKDIR /workspace
|
||||
|
||||
FROM official as dev
|
||||
|
Reference in New Issue
Block a user