From 179ecab7e75a32435705b51e257077a13796d9fe Mon Sep 17 00:00:00 2001 From: Huy Do Date: Wed, 14 Feb 2024 02:37:54 +0000 Subject: [PATCH] Do full checkout in lint workflow to rebuild new Docker images (#119858) From https://github.com/pytorch/pytorch/pull/119575, using `fetch-depth: 1` didn't work for `calculate-docker-image` when rebuilding a new one. Specifically, doing a full checkout is needed for `git rev-parse HEAD~:.ci/docker` to get the Docker tag. This shows up as a trunk failure after the recent Docker image update https://hud.pytorch.org/pytorch/pytorch/commit/507db1767525653dcf8dba80768198b19bd5e9f9 Pull Request resolved: https://github.com/pytorch/pytorch/pull/119858 Approved by: https://github.com/PaliC, https://github.com/clee2000, https://github.com/malfet --- .github/workflows/lint.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b5661432114..5b395313860 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,9 @@ jobs: timeout: 120 runner: linux.2xlarge docker-image: pytorch-linux-jammy-cuda11.8-cudnn8-py3.9-linter - fetch-depth: 1 + # NB: A shallow checkout won't work here because calculate-docker-image requires a full checkout + # to run git rev-parse HEAD~:.ci/docker when a new image is needed + fetch-depth: 0 submodules: true ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} script: | @@ -35,7 +37,9 @@ jobs: timeout: 120 runner: linux.2xlarge docker-image: pytorch-linux-jammy-cuda11.8-cudnn8-py3.9-linter - fetch-depth: 1 + # NB: A shallow checkout won't work here because calculate-docker-image requires a full checkout + # to run git rev-parse HEAD~:.ci/docker when a new image is needed + fetch-depth: 0 submodules: true ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} script: |