Skip to content

Commit 7bdd888

Browse files
committed
Add retry logic for torchvision git clone (handles GitHub 503 errors)
PyTorch 2.8.0 compiled successfully in ~4 hours! Adding retry for torchvision to handle transient GitHub API issues.
1 parent 6c0345e commit 7bdd888

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docker/dockerfiles/Dockerfile.onnx.jetson.6.2.0

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ RUN git clone --recursive --branch v${PYTORCH_VERSION} https://github.com/pytorc
9090
python3 setup.py bdist_wheel && \
9191
python3 -m pip install dist/torch-*.whl
9292

93-
# Compile torchvision from source
93+
# Compile torchvision from source (with retry for transient GitHub issues)
9494
WORKDIR /build/torchvision
95-
RUN git clone --branch v${TORCHVISION_VERSION} https://github.com/pytorch/vision && \
95+
RUN for i in 1 2 3; do \
96+
git clone --branch v${TORCHVISION_VERSION} https://github.com/pytorch/vision && break || sleep 60; \
97+
done && \
9698
cd vision && \
9799
export BUILD_VERSION=${TORCHVISION_VERSION} TORCH_CUDA_ARCH_LIST="8.7" && \
98100
export FORCE_CUDA=1 MAX_JOBS=${MAX_JOBS} && \

0 commit comments

Comments
 (0)