Skip to content

Commit a4b3519

Browse files
marco-satalman
andauthored
Add release matrix json for consumption by PyTorch website (#1848)
* 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. * Add all updated files to commit message in update-quick-start-module.yml * Add comment to new function to save json file in gen_quick_start_module.py --------- Co-authored-by: Andrey Talman <[email protected]>
1 parent f6fbed2 commit a4b3519

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/update-quick-start-module.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ jobs:
105105
uses: peter-evans/create-pull-request@v3
106106
with:
107107
token: ${{ secrets.PYTORCHBOT_TOKEN }}
108-
commit-message: Modify published_versions.json file
109-
title: '[Getting Started Page] Modify published_versions.json file'
108+
commit-message: Modify published_versions.json, release_matrix.json and quick-start-module.js
109+
title: '[Getting Started Page] Modify published_versions.json, release_matrix.json and quick-start-module.js'
110110
body: >
111111
This PR is auto-generated. It updates Getting Started page
112112
labels: automated pr

scripts/gen_quick_start_module.py

+8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ def write_published_versions(versions):
8383
with open(BASE_DIR / "published_versions.json", "w") as outfile:
8484
json.dump(versions, outfile, indent=2)
8585

86+
# Create release matrix for PyTorch website.
87+
# It's utilized to populate config data for
88+
# the "Start Locally" installation options table.
89+
def write_release_matrix(matrix):
90+
with open(BASE_DIR / "release_matrix.json", "w") as outfile:
91+
json.dump(matrix, outfile, indent=2)
8692

8793
def read_matrix_for_os(osys: OperatingSystem, channel: str):
8894
jsonfile = load_json_from_basedir(f"{osys.value}_{channel}_matrix.json")
@@ -242,6 +248,8 @@ def main():
242248
for osys in OperatingSystem:
243249
release_matrix[val][osys.value] = read_matrix_for_os(osys, val)
244250

251+
write_release_matrix(release_matrix)
252+
245253
extract_arch_ver_map(release_matrix)
246254
for val in ("nightly", "release"):
247255
update_versions(versions, release_matrix[val], val)

0 commit comments

Comments
 (0)