From 38371f693b07a485705119407da2e5dc64cec4eb Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Mon, 14 Jul 2025 15:47:43 -0700 Subject: [PATCH] ci: Switch lintrunner-noclang to use linter image (#158261) This changes the image the lintrunner jobs utilizes to be the base linter image instead of the CUDA image. This is done to reduce the image size and speed up the build time. This was switched in https://github.com/pytorch/pytorch/pull/110502 when clang used to run in the lintrunner jobs but it is now split out so we can use the default image for non-clang jobs. Difference in pull time (from running job): ~5min --> ~1min (80% reduction), this should result in an overall runtime decrease of ~25min --> ~20min (20% reduction) Signed-off-by: Eli Uriegas Pull Request resolved: https://github.com/pytorch/pytorch/pull/158261 Approved by: https://github.com/Camyll, https://github.com/ZainRizvi, https://github.com/atalman, https://github.com/Skylion007 --- .ci/docker/linter/Dockerfile | 2 ++ .github/workflows/lint.yml | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/docker/linter/Dockerfile b/.ci/docker/linter/Dockerfile index 0fdfac678d4..95d08ffea05 100644 --- a/.ci/docker/linter/Dockerfile +++ b/.ci/docker/linter/Dockerfile @@ -27,5 +27,7 @@ COPY ./common/install_linter.sh install_linter.sh RUN bash ./install_linter.sh RUN rm install_linter.sh +RUN chown -R jenkins:jenkins /var/lib/jenkins/ci_env + USER jenkins CMD ["bash"] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d0a2fda509e..0fca3404819 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,6 @@ jobs: triggering_actor: ${{ github.triggering_actor }} issue_owner: ${{ github.event.pull_request.user.login || github.event.issue.user.login }} curr_branch: ${{ github.head_ref || github.ref_name }} - lintrunner-clang: uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main needs: get-label-type @@ -50,7 +49,7 @@ jobs: with: timeout: 120 runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" - docker-image: ci-image:pytorch-linux-jammy-cuda12.8-cudnn9-py3.9-linter + docker-image: ci-image:pytorch-linux-jammy-linter # 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