From 9c240aefee342ff1d6d3827c250bd60788e17ffe Mon Sep 17 00:00:00 2001 From: Marco Schmoecker Date: Thu, 19 Dec 2024 17:09:41 -0800 Subject: [PATCH 1/3] Add creation of release_matrix.json to gen_quick_start_module.py The PyTorch website needs access to the "release matrix" in the same way it can access published_version.json to generate the config needed for the "Start Locally" page. --- scripts/gen_quick_start_module.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/gen_quick_start_module.py b/scripts/gen_quick_start_module.py index 687afc8bfa02..d43d8620ddc2 100755 --- a/scripts/gen_quick_start_module.py +++ b/scripts/gen_quick_start_module.py @@ -83,6 +83,9 @@ def write_published_versions(versions): with open(BASE_DIR / "published_versions.json", "w") as outfile: json.dump(versions, outfile, indent=2) +def write_release_matrix(matrix): + with open(BASE_DIR / "release_matrix.json", "w") as outfile: + json.dump(matrix, outfile, indent=2) def read_matrix_for_os(osys: OperatingSystem, channel: str): jsonfile = load_json_from_basedir(f"{osys.value}_{channel}_matrix.json") @@ -242,6 +245,8 @@ def main(): for osys in OperatingSystem: release_matrix[val][osys.value] = read_matrix_for_os(osys, val) + write_release_matrix(release_matrix) + extract_arch_ver_map(release_matrix) for val in ("nightly", "release"): update_versions(versions, release_matrix[val], val) From c64bb4fecbced1f418026e2a5b320dae5c8c62c4 Mon Sep 17 00:00:00 2001 From: Marco Schmoecker Date: Thu, 19 Dec 2024 17:27:08 -0800 Subject: [PATCH 2/3] Add all updated files to commit message in update-quick-start-module.yml --- .github/workflows/update-quick-start-module.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-quick-start-module.yml b/.github/workflows/update-quick-start-module.yml index d0af9eb7a4ca..86d925e7ba96 100644 --- a/.github/workflows/update-quick-start-module.yml +++ b/.github/workflows/update-quick-start-module.yml @@ -103,8 +103,8 @@ jobs: uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.PYTORCHBOT_TOKEN }} - commit-message: Modify published_versions.json file - title: '[Getting Started Page] Modify published_versions.json file' + commit-message: Modify published_versions.json, release_matrix.json and quick-start-module.js + title: '[Getting Started Page] Modify published_versions.json, release_matrix.json and quick-start-module.js' body: > This PR is auto-generated. It updates Getting Started page labels: automated pr From 1ca7573a7c131c34f3a030ef0d92ff44e98cfb30 Mon Sep 17 00:00:00 2001 From: Marco Schmoecker Date: Fri, 20 Dec 2024 12:04:35 -0800 Subject: [PATCH 3/3] Add comment to new function to save json file in gen_quick_start_module.py --- scripts/gen_quick_start_module.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/gen_quick_start_module.py b/scripts/gen_quick_start_module.py index d43d8620ddc2..5bd8b2be1e47 100755 --- a/scripts/gen_quick_start_module.py +++ b/scripts/gen_quick_start_module.py @@ -83,6 +83,9 @@ def write_published_versions(versions): with open(BASE_DIR / "published_versions.json", "w") as outfile: json.dump(versions, outfile, indent=2) +# Create release matrix for PyTorch website. +# It's utilized to populate config data for +# the "Start Locally" installation options table. def write_release_matrix(matrix): with open(BASE_DIR / "release_matrix.json", "w") as outfile: json.dump(matrix, outfile, indent=2)