Skip to content

Commit a545ebf

Browse files
authored
[releng] Docker release, Change docker tag. Refactor Push nightly tags step. Move cuda and cudnn version to docker tag rather then name (pytorch#116098)
* [releng] Docker Official release make sure cuda version is part of image name (pytorch#116070) Follow up on pytorch#115949 Change docker build image name: ``pytorch:2.1.2-devel``-> ``2.1.2-cuda12.1-cudnn8-devel and 2.1.2-cuda11.8-cudnn8-devel`` Ref: https://github.com/orgs/pytorch/packages/container/package/pytorch-nightly Naming will be same as in https://hub.docker.com/r/pytorch/pytorch/tags Pull Request resolved: pytorch#116070 Approved by: https://github.com/huydhn, https://github.com/seemethere * [releng] Docker release Refactor Push nightly tags step. Move cuda and cudnn version to docker tag rather then name (pytorch#116097) Follow up after : pytorch#116070 This PR does 2 things. 1. Refactor Push nightly tags step, don't need to extract CUDA_VERSION anymore. New tag should be in this format: ``${PYTORCH_VERSION}-cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION)-runtime`` 2. Move cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION) from docker name to tag Pull Request resolved: pytorch#116097 Approved by: https://github.com/jeanschmidt * [release only change] hardcode pytorch 2.1.2 version
1 parent 590a9c2 commit a545ebf

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/docker-release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
BUILD_PLATFORMS: ${{ matrix.platform }}
7272
CHANNEL: ${{ inputs.channel }}
7373
CUDA_VERSION: ${{ matrix.cuda_full_version }}
74+
CUDA_VERSION_SHORT: ${{ matrix.cuda }}
7475
CUDNN_VERSION: ${{ matrix.cudnn_version }}
7576
steps:
7677
- name: Setup SSH (Click me for login details)
@@ -108,7 +109,7 @@ jobs:
108109
# To get QEMU binaries in our PATH
109110
echo "${RUNNER_TEMP}/bin" >> "${GITHUB_PATH}"
110111
# Generate PyTorch version to use without suffix
111-
echo "PYTORCH_VERSION=$(python3 .github/scripts/generate_pytorch_version.py --no-build-suffix)" >> "${GITHUB_ENV}"
112+
echo "PYTORCH_VERSION=2.1.2" >> "${GITHUB_ENV}"
112113
113114
- name: Setup release specific variables
114115
run: |
@@ -126,10 +127,11 @@ jobs:
126127
- name: Push nightly tags
127128
if: ${{ github.event.ref == 'refs/heads/nightly' && matrix.image_type == 'runtime' }}
128129
run: |
129-
PYTORCH_DOCKER_TAG="${PYTORCH_VERSION}-runtime"
130-
CUDA_VERSION=$(python3 -c "import re;print(re.search('CUDA_VERSION\s+=\s+([0-9\.]+)',open('docker.Makefile').read())[1],end='')")
130+
PYTORCH_DOCKER_TAG="${PYTORCH_VERSION}-cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION)-runtime"
131+
131132
PYTORCH_NIGHTLY_COMMIT=$(docker run ghcr.io/pytorch/pytorch-nightly:"${PYTORCH_DOCKER_TAG}" \
132133
python -c 'import torch; print(torch.version.git_version[:7],end="")')
134+
133135
docker tag ghcr.io/pytorch/pytorch-nightly:"${PYTORCH_DOCKER_TAG}" \
134136
ghcr.io/pytorch/pytorch-nightly:"${PYTORCH_NIGHTLY_COMMIT}-cu${CUDA_VERSION}"
135137
docker push ghcr.io/pytorch/pytorch-nightly:"${PYTORCH_NIGHTLY_COMMIT}-cu${CUDA_VERSION}"

docker.Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ $(warning WARNING: No docker user found using results from whoami)
88
DOCKER_ORG = $(shell whoami)
99
endif
1010

11-
CUDA_VERSION ?= 12.1.1
12-
CUDNN_VERSION ?= 8
11+
CUDA_VERSION_SHORT ?= 12.1
12+
CUDA_VERSION ?= 12.1.1
13+
CUDNN_VERSION ?= 8
1314
BASE_RUNTIME = ubuntu:20.04
1415
BASE_DEVEL = nvidia/cuda:$(CUDA_VERSION)-cudnn$(CUDNN_VERSION)-devel-ubuntu20.04
1516
CMAKE_VARS ?=
@@ -71,25 +72,25 @@ all: devel-image
7172

7273
.PHONY: devel-image
7374
devel-image: BASE_IMAGE := $(BASE_DEVEL)
74-
devel-image: DOCKER_TAG := $(PYTORCH_VERSION)-devel
75+
devel-image: DOCKER_TAG := $(PYTORCH_VERSION)-cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION)-devel
7576
devel-image:
7677
$(DOCKER_BUILD)
7778

7879
.PHONY: devel-push
7980
devel-push: BASE_IMAGE := $(BASE_DEVEL)
80-
devel-push: DOCKER_TAG := $(PYTORCH_VERSION)-devel
81+
devel-push: DOCKER_TAG := $(PYTORCH_VERSION)-cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION)-devel
8182
devel-push:
8283
$(DOCKER_PUSH)
8384

8485
.PHONY: runtime-image
8586
runtime-image: BASE_IMAGE := $(BASE_RUNTIME)
86-
runtime-image: DOCKER_TAG := $(PYTORCH_VERSION)-runtime
87+
runtime-image: DOCKER_TAG := $(PYTORCH_VERSION)-cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION)-runtime
8788
runtime-image:
8889
$(DOCKER_BUILD)
8990

9091
.PHONY: runtime-push
9192
runtime-push: BASE_IMAGE := $(BASE_RUNTIME)
92-
runtime-push: DOCKER_TAG := $(PYTORCH_VERSION)-runtime
93+
runtime-push: DOCKER_TAG := $(PYTORCH_VERSION)-cuda$(CUDA_VERSION_SHORT)-cudnn$(CUDNN_VERSION)-runtime
9394
runtime-push:
9495
$(DOCKER_PUSH)
9596

0 commit comments

Comments
 (0)