From 77bbf7f3804dee0d9f7e4cf4a4a1e0ba226dea65 Mon Sep 17 00:00:00 2001 From: Will Cromar Date: Tue, 30 Apr 2024 13:30:50 -0700 Subject: [PATCH] Tag CI build with git hash (#7003) --- .github/workflows/_build_torch_xla.yml | 2 +- infra/ansible/config/env.yaml | 2 +- infra/ansible/config/vars.yaml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_build_torch_xla.yml b/.github/workflows/_build_torch_xla.yml index 7614242fd7a..58a783216e4 100644 --- a/.github/workflows/_build_torch_xla.yml +++ b/.github/workflows/_build_torch_xla.yml @@ -46,7 +46,7 @@ jobs: shell: bash run: | cd pytorch/xla/infra/ansible - ansible-playbook playbook.yaml -vvv -e "stage=build arch=amd64 accelerator=tpu src_root=${GITHUB_WORKSPACE} bundle_libtpu=0 build_cpp_tests=1 cache_suffix=-ci" --skip-tags=fetch_srcs,install_deps + ansible-playbook playbook.yaml -vvv -e "stage=build arch=amd64 accelerator=tpu src_root=${GITHUB_WORKSPACE} bundle_libtpu=0 build_cpp_tests=1 git_versioned_xla_build=1 cache_suffix=-ci" --skip-tags=fetch_srcs,install_deps - name: Upload wheel uses: actions/upload-artifact@v4 with: diff --git a/infra/ansible/config/env.yaml b/infra/ansible/config/env.yaml index ea785519bae..9e2fe7270cc 100644 --- a/infra/ansible/config/env.yaml +++ b/infra/ansible/config/env.yaml @@ -33,7 +33,7 @@ build_env: BAZEL_REMOTE_CACHE: 1 SILO_NAME: "cache-silo-{{ arch }}-{{ accelerator }}-{{ clang_version }}{{ cache_suffix }}" _GLIBCXX_USE_CXX11_ABI: 0 - GIT_VERSIONED_XLA_BUILD: "{{ nightly_release }}" + GIT_VERSIONED_XLA_BUILD: "{{ nightly_release or git_versioned_xla_build }}" amd64: ARCH: amd64 diff --git a/infra/ansible/config/vars.yaml b/infra/ansible/config/vars.yaml index 1ab00087b60..e5851d0cc77 100644 --- a/infra/ansible/config/vars.yaml +++ b/infra/ansible/config/vars.yaml @@ -16,3 +16,5 @@ bundle_libtpu: 1 cache_suffix: "" # Whether to build C++ tests with `torch_xla` wheel build_cpp_tests: 0 +# Whether to tag wheels with git hash, e.g. X.Y.Z+git123abc +git_versioned_xla_build: false