Skip to content

Commit

Permalink
Support pin pr number in new .torch_pin (pytorch#6998)
Browse files Browse the repository at this point in the history
Co-authored-by: Will Cromar <wcromar@google.com>
  • Loading branch information
JackCaoG and will-cromar authored May 1, 2024
1 parent 400bd0c commit cbbefa2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions infra/ansible/roles/build_srcs/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@
# ansible.builtin.git wants to fetch the entire history, so check out the pin manually
ansible.builtin.shell:
cmd: |
git fetch origin {{ torch_pin.stdout }}
git checkout --recurse-submodules {{ torch_pin.stdout }}
set -xe
PIN="{{ torch_pin.stdout }}"
if [[ $PIN = \#* ]]; then
PRNUM="${PIN//[!0-9]/}"
git fetch origin "pull/$PRNUM/head"
else
git fetch origin {{ torch_pin.stdout }}
fi
git checkout --recurse-submodules FETCH_HEAD
chdir: "{{ (src_root, 'pytorch') | path_join }}"
args:
executable: /bin/bash
when: torch_pin is succeeded

- name: Build PyTorch
Expand Down

0 comments on commit cbbefa2

Please sign in to comment.