Skip to content

Commit cc47683

Browse files
atheo89jiridanek
andauthored
Enhance Pipfile.lock GitHub Action: Multi-version Matrix Support (#1397)
* Comment out runtime-rocm-tensorflow on the makefile as it is not ready yet * Update piplock renewal to run for both recent python versions * Consolidate the logic on matric.python-version * Remove last \ on the all-images recipe --------- Co-authored-by: Jiri Daněk <[email protected]>
1 parent 6b2d9ca commit cc47683

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

.github/workflows/piplock-renewal.yaml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ on: # yamllint disable-line rule:truthy
1313
required: false
1414
default: 'main'
1515
python_version:
16-
description: 'Select Python version to update Pipfile.lock'
16+
description: 'Select a Python version to update Pipfile.lock'
1717
required: false
18-
default: '3.11'
18+
default: '["3.11", "3.12"]'
1919
type: choice
2020
options:
21-
- '3.12'
22-
- '3.11'
23-
- '3.9'
24-
- '3.8'
21+
- '["3.11", "3.12"]'
22+
- '["3.12"]'
23+
- '["3.11"]'
24+
- '["3.9"]'
25+
- '["3.8"]'
2526
update_optional_dirs:
2627
description: 'Include optional directories in update'
2728
required: false
@@ -32,42 +33,46 @@ on: # yamllint disable-line rule:truthy
3233
- 'false'
3334

3435
jobs:
35-
build:
36+
refresh-pipfile-locks:
3637
runs-on: ubuntu-latest
38+
concurrency:
39+
group: refresh-pipfile-locks-${{ github.ref }}
40+
cancel-in-progress: false
41+
strategy:
42+
fail-fast: false
43+
max-parallel: 1
44+
matrix:
45+
python-version: >-
46+
${{ fromJSON( github.event.inputs.python_version || '["3.11", "3.12"]' ) }}
3747
permissions:
3848
contents: write
3949
env:
4050
BRANCH: ${{ github.event.inputs.branch || 'main' }}
41-
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11' }}
4251
INCLUDE_OPT_DIRS: ${{ github.event.inputs.update_optional_dirs || 'false' }}
52+
4353
steps:
44-
# Checkout the specified branch from the specified organization
45-
- name: Checkout code from the specified branch
54+
- name: Checkout code
4655
uses: actions/checkout@v4
4756
with:
4857
ref: ${{ env.BRANCH }}
4958
token: ${{ secrets.GH_ACCESS_TOKEN }}
5059

51-
# Configure Git
5260
- name: Configure Git
5361
run: |
54-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
55-
git config --global user.name "GitHub Actions"
62+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
63+
git config --global user.name "GitHub Actions"
5664
57-
# Setup Python environment with the specified version (or default to '3.11')
58-
- name: Setup Python environment
65+
- name: Set up Python ${{ matrix.python-version }}
5966
uses: actions/setup-python@v5
6067
with:
61-
python-version: ${{ env.PYTHON_VERSION }}
68+
python-version: ${{ matrix.python-version }}
6269

63-
# Install pipenv
6470
- name: Install pipenv
6571
run: pip install pipenv
6672

67-
# Run makefile recipe to refresh Pipfile.lock and push changes back to the branch
68-
- name: Run `make refresh-pipfilelock-files`
73+
- name: Run make refresh-pipfilelock-files
6974
run: |
70-
make refresh-pipfilelock-files PYTHON_VERSION=${{ env.PYTHON_VERSION }} INCLUDE_OPT_DIRS=${{ env.INCLUDE_OPT_DIRS }}
75+
make refresh-pipfilelock-files PYTHON_VERSION=${{ matrix.python-version }} INCLUDE_OPT_DIRS=${{ env.INCLUDE_OPT_DIRS }}
7176
7277
- name: Push the changes back to the branch
7378
run: |

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ else ifeq ($(PYTHON_VERSION), 3.12)
423423
runtimes/datascience/ubi9-python-$(PYTHON_VERSION) \
424424
runtimes/pytorch/ubi9-python-$(PYTHON_VERSION) \
425425
runtimes/tensorflow/ubi9-python-$(PYTHON_VERSION) \
426-
runtimes/rocm-pytorch/ubi9-python-$(PYTHON_VERSION) \
427-
runtimes/rocm-tensorflow/ubi9-python-$(PYTHON_VERSION)
426+
runtimes/rocm-pytorch/ubi9-python-$(PYTHON_VERSION)
427+
# runtimes/rocm-tensorflow/ubi9-python-$(PYTHON_VERSION)
428428
# jupyter/rocm/tensorflow/ubi9-python-$(PYTHON_VERSION)
429429
# rstudio/rhel9-python-$(PYTHON_VERSION)
430430
# rstudio/c9s-python-$(PYTHON_VERSION)
@@ -514,8 +514,8 @@ all-images: \
514514
runtime-cuda-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION) \
515515
rocm-jupyter-minimal-ubi9-python-$(RELEASE_PYTHON_VERSION) \
516516
rocm-jupyter-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
517-
rocm-runtime-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION) \
518-
rocm-runtime-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)
517+
rocm-runtime-pytorch-ubi9-python-$(RELEASE_PYTHON_VERSION)
518+
# rocm-runtime-tensorflow-ubi9-python-$(RELEASE_PYTHON_VERSION)
519519
# rstudio-c9s-python-$(RELEASE_PYTHON_VERSION)
520520
# cuda-rstudio-c9s-python-$(RELEASE_PYTHON_VERSION)
521521
# rstudio-rhel9-python-$(RELEASE_PYTHON_VERSION)

0 commit comments

Comments
 (0)