diff --git a/.github/workflows/update-versions.yaml b/.github/workflows/update-versions.yaml index 82d1170de..39f0fa53e 100644 --- a/.github/workflows/update-versions.yaml +++ b/.github/workflows/update-versions.yaml @@ -1,35 +1,45 @@ -name: Update SDK, Ray, and CUDA Versions & Runtime Image SHAs +name: Update SDK, Ray, and Runtime Image Versions on: workflow_dispatch: inputs: new_sdk_version: - description: 'New SDK version (e.g., 0.32.0)' + description: 'New SDK version (e.g., 0.33.0)' required: false type: string default: '' new_ray_version: - description: 'New Ray version (e.g., 2.48.0)' + description: 'New Ray version (e.g., 2.54.1) -- updates RAY_VERSION and pyproject.toml' required: false type: string default: '' - new_cuda_py311_sha: - description: 'New CUDA Python 3.11 runtime image SHA (e.g., abc123...)' + new_py312_cuda_sha: + description: 'New py312 CUDA runtime image SHA for constants.py (e.g., 42fbc5d...)' required: false type: string default: '' - new_cuda_py312_sha: - description: 'New CUDA Python 3.12 runtime image SHA (e.g., def456...)' + new_py311_cuda_sha: + description: 'New py311 CUDA runtime image SHA for constants.py (e.g., abc123...)' required: false type: string default: '' - new_cuda_version_py311: - description: 'New CUDA version for Python 3.11 (e.g., cu121)' + py312_cuda_tag: + description: 'Full py312 CUDA image tag (e.g., 2.54.1-py312-cu128) -- replaces old tag in notebooks, docs, comments' required: false type: string default: '' - new_cuda_version_py312: - description: 'New CUDA version for Python 3.12 (e.g., cu128)' + py312_rocm_tag: + description: 'Full py312 ROCm image tag (e.g., 2.54.1-py312-rocm62) -- replaces old tag in docs' + required: false + type: string + default: '' + py311_cuda_tag: + description: 'Full py311 CUDA image tag (e.g., 2.52.1-py311-cu121) -- replaces old tag in notebooks, docs, comments' + required: false + type: string + default: '' + py311_rocm_tag: + description: 'Full py311 ROCm image tag (e.g., 2.52.1-py311-rocm62) -- replaces old tag in docs' required: false type: string default: '' @@ -40,7 +50,7 @@ on: default: 'main' env: - PR_BRANCH_NAME: ray-version-update-${{ github.run_id }} + PR_BRANCH_NAME: version-update-${{ github.run_id }} jobs: update-versions: @@ -60,6 +70,8 @@ jobs: with: python-version: '3.12' + - name: Install Poetry + run: pip install poetry - name: Configure git and create branch run: | @@ -69,146 +81,186 @@ jobs: git pull origin ${{ github.event.inputs.target-branch }} git checkout -b ${{ env.PR_BRANCH_NAME }} - - name: Update constants.py + - name: Capture current versions + id: current run: | - # Update Ray version if provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then - sed -i "s/RAY_VERSION = \"[^\"]*\"/RAY_VERSION = \"${{ github.event.inputs.new_ray_version }}\"/" src/codeflare_sdk/common/utils/constants.py + echo "ray_version=$(grep 'RAY_VERSION = ' src/codeflare_sdk/common/utils/constants.py | sed 's/.*"\(.*\)".*/\1/')" >> $GITHUB_OUTPUT + echo "sdk_version=$(grep -E '^version = ' pyproject.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')" >> $GITHUB_OUTPUT - # Update comments with new Ray version and CUDA versions if both are provided - if [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ]; then - sed -i "s/\* For python 3.11:ray:[^\"]*/\* For python 3.11:ray:${{ github.event.inputs.new_ray_version }}-py311-${{ github.event.inputs.new_cuda_version_py311 }}/" src/codeflare_sdk/common/utils/constants.py - fi - if [ -n "${{ github.event.inputs.new_cuda_version_py312 }}" ]; then - sed -i "s/\* For python 3.12:ray:[^\"]*/\* For python 3.12:ray:${{ github.event.inputs.new_ray_version }}-py312-${{ github.event.inputs.new_cuda_version_py312 }}/" src/codeflare_sdk/common/utils/constants.py - fi + - name: Update version constants + run: | + # Update RAY_VERSION in constants.py + if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then + sed -i 's/RAY_VERSION = "[^"]*"/RAY_VERSION = "${{ github.event.inputs.new_ray_version }}"/' src/codeflare_sdk/common/utils/constants.py + echo "Updated RAY_VERSION to ${{ github.event.inputs.new_ray_version }}" fi - # Update runtime image SHAs if provided - if [ -n "${{ github.event.inputs.new_cuda_py311_sha }}" ]; then - sed -i "s/CUDA_PY311_RUNTIME_IMAGE = \"quay\.io\/modh\/ray@sha256:[^\"]*\"/CUDA_PY311_RUNTIME_IMAGE = \"quay.io\/modh\/ray@sha256:${{ github.event.inputs.new_cuda_py311_sha }}\"/" src/codeflare_sdk/common/utils/constants.py + # Update ray dependency in pyproject.toml + if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then + sed -i 's/ray = {version = "[^"]*"/ray = {version = "${{ github.event.inputs.new_ray_version }}"/' pyproject.toml + echo "Updated ray dependency to ${{ github.event.inputs.new_ray_version }}" fi - if [ -n "${{ github.event.inputs.new_cuda_py312_sha }}" ]; then - sed -i "s/CUDA_PY312_RUNTIME_IMAGE = \"quay\.io\/modh\/ray@sha256:[^\"]*\"/CUDA_PY312_RUNTIME_IMAGE = \"quay.io\/modh\/ray@sha256:${{ github.event.inputs.new_cuda_py312_sha }}\"/" src/codeflare_sdk/common/utils/constants.py + # Update SDK version in pyproject.toml + if [ -n "${{ github.event.inputs.new_sdk_version }}" ]; then + sed -i 's/^version = "[^"]*"/version = "${{ github.event.inputs.new_sdk_version }}"/' pyproject.toml + echo "Updated SDK version to ${{ github.event.inputs.new_sdk_version }}" fi - - name: Update pyproject.toml + - name: Regenerate poetry.lock + if: inputs.new_ray_version != '' || inputs.new_sdk_version != '' run: | - # Update Ray dependency version in pyproject.toml if Ray version is provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then - sed -i "s/ray = {version = \"[^\"]*\", extras = \[\"data\", \"default\"\]}/ray = {version = \"${{ github.event.inputs.new_ray_version }}\", extras = [\"data\", \"default\"]}/" pyproject.toml + poetry lock --no-update + echo "Regenerated poetry.lock" + + - name: Update runtime image SHAs + run: | + # Update py312 CUDA SHA in constants.py + if [ -n "${{ github.event.inputs.new_py312_cuda_sha }}" ]; then + sed -i "s|CUDA_PY312_RUNTIME_IMAGE = \"quay\.io/modh/ray@sha256:[^\"]*\"|CUDA_PY312_RUNTIME_IMAGE = \"quay.io/modh/ray@sha256:${{ github.event.inputs.new_py312_cuda_sha }}\"|" src/codeflare_sdk/common/utils/constants.py + echo "Updated CUDA_PY312_RUNTIME_IMAGE SHA" fi - # Update SDK version in pyproject.toml if SDK version is provided - if [ -n "${{ github.event.inputs.new_sdk_version }}" ]; then - # Update both [project] and [tool.poetry] version fields - sed -i "s/^version = \"[^\"]*\"/version = \"${{ github.event.inputs.new_sdk_version }}\"/" pyproject.toml + # Update py311 CUDA SHA in constants.py + if [ -n "${{ github.event.inputs.new_py311_cuda_sha }}" ]; then + sed -i "s|CUDA_PY311_RUNTIME_IMAGE = \"quay\.io/modh/ray@sha256:[^\"]*\"|CUDA_PY311_RUNTIME_IMAGE = \"quay.io/modh/ray@sha256:${{ github.event.inputs.new_py311_cuda_sha }}\"|" src/codeflare_sdk/common/utils/constants.py + echo "Updated CUDA_PY311_RUNTIME_IMAGE SHA" fi - - name: Update documentation files + - name: Update py312 CUDA image tags + if: inputs.py312_cuda_tag != '' run: | - # Update documentation files with new Ray version and image tags if provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ]; then - find docs/ -name "*.rst" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py311-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py311-${{ github.event.inputs.new_cuda_version_py311 }}/g" {} \; - find docs/ -name "*.rst" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py311-rocm[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py311-rocm62/g" {} \; - fi + NEW_TAG="${{ github.event.inputs.py312_cuda_tag }}" + PATTERN='[0-9]\+\.[0-9]\+\.[0-9]\+-py312-cu[0-9]\+' - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -n "${{ github.event.inputs.new_cuda_version_py312 }}" ]; then - find docs/ -name "*.rst" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py312-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py312-${{ github.event.inputs.new_cuda_version_py312 }}/g" {} \; - fi + echo "Replacing all py312 CUDA tags with: ${NEW_TAG}" - - name: Update notebook files + sed -i "s|${PATTERN}|${NEW_TAG}|g" src/codeflare_sdk/common/utils/constants.py + find demo-notebooks/ -name "*.ipynb" -exec sed -i "s|${PATTERN}|${NEW_TAG}|g" {} \; + find docs/ -name "*.rst" -exec sed -i "s|${PATTERN}|${NEW_TAG}|g" {} \; + + - name: Update py312 ROCm image tags + if: inputs.py312_rocm_tag != '' run: | - # Update notebook files with new Ray version and image tags if provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ]; then - find demo-notebooks/ -name "*.ipynb" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py311-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py311-${{ github.event.inputs.new_cuda_version_py311 }}/g" {} \; - fi + NEW_TAG="${{ github.event.inputs.py312_rocm_tag }}" + PATTERN='[0-9]\+\.[0-9]\+\.[0-9]\+-py312-rocm[0-9]\+' - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -n "${{ github.event.inputs.new_cuda_version_py312 }}" ]; then - find demo-notebooks/ -name "*.ipynb" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py312-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py312-${{ github.event.inputs.new_cuda_version_py312 }}/g" {} \; - fi + echo "Replacing all py312 ROCm tags with: ${NEW_TAG}" - # Update notebook files with new Ray version only (for cases where CUDA version isn't specified) - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -z "${{ github.event.inputs.new_cuda_version_py311 }}" ] && [ -z "${{ github.event.inputs.new_cuda_version_py312 }}" ]; then - # Update Ray version in image tags while preserving existing CUDA versions - find demo-notebooks/ -name "*.ipynb" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py311-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py311-cu121/g" {} \; - find demo-notebooks/ -name "*.ipynb" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py312-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py312-cu128/g" {} \; - fi + find docs/ -name "*.rst" -exec sed -i "s|${PATTERN}|${NEW_TAG}|g" {} \; - - name: Update YAML test files + - name: Update py311 CUDA image tags + if: inputs.py311_cuda_tag != '' run: | - # Update YAML files with new Ray version if provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then - find tests/ -name "*.yaml" -exec sed -i "s/rayVersion: [0-9]\+\.[0-9]\+\.[0-9]\+/rayVersion: ${{ github.event.inputs.new_ray_version }}/g" {} \; - fi + NEW_TAG="${{ github.event.inputs.py311_cuda_tag }}" + PATTERN='[0-9]\+\.[0-9]\+\.[0-9]\+-py311-cu[0-9]\+' - # Update image tags in YAML files if Ray version and CUDA versions are provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ]; then - find tests/ -name "*.yaml" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py311-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py311-${{ github.event.inputs.new_cuda_version_py311 }}/g" {} \; - fi + echo "Replacing all py311 CUDA tags with: ${NEW_TAG}" - - name: Update output YAML files + sed -i "s|${PATTERN}|${NEW_TAG}|g" src/codeflare_sdk/common/utils/constants.py + find demo-notebooks/ -name "*.ipynb" -exec sed -i "s|${PATTERN}|${NEW_TAG}|g" {} \; + find docs/ -name "*.rst" -exec sed -i "s|${PATTERN}|${NEW_TAG}|g" {} \; + + - name: Update py311 ROCm image tags + if: inputs.py311_rocm_tag != '' run: | - # Update output YAML files in demo-notebooks if Ray version and CUDA version are provided - if [ -n "${{ github.event.inputs.new_ray_version }}" ] && [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ]; then - find demo-notebooks/ -name "*.yaml" -exec sed -i "s/quay\.io\/modh\/ray:[0-9]\+\.[0-9]\+\.[0-9]\+-py311-cu[0-9]\+/quay.io\/modh\/ray:${{ github.event.inputs.new_ray_version }}-py311-${{ github.event.inputs.new_cuda_version_py311 }}/g" {} \; - fi + NEW_TAG="${{ github.event.inputs.py311_rocm_tag }}" + PATTERN='[0-9]\+\.[0-9]\+\.[0-9]\+-py311-rocm[0-9]\+' + + echo "Replacing all py311 ROCm tags with: ${NEW_TAG}" + + find docs/ -name "*.rst" -exec sed -i "s|${PATTERN}|${NEW_TAG}|g" {} \; - name: Validate updates run: | - # Check if constants.py was updated correctly (only if Ray version was provided) + FAILED=0 + if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then - if ! grep -q "RAY_VERSION = \"${{ github.event.inputs.new_ray_version }}\"" src/codeflare_sdk/common/utils/constants.py; then - echo "✗ Ray version not found in constants.py" - echo "Expected: RAY_VERSION = \"${{ github.event.inputs.new_ray_version }}\"" - echo "Found:" - grep "RAY_VERSION" src/codeflare_sdk/common/utils/constants.py || echo " (not found)" - exit 1 + if grep -q 'RAY_VERSION = "${{ github.event.inputs.new_ray_version }}"' src/codeflare_sdk/common/utils/constants.py; then + echo "✓ RAY_VERSION updated in constants.py" + else + echo "✗ RAY_VERSION not found in constants.py" + FAILED=1 fi - # Check if pyproject.toml was updated correctly - if ! grep -q "ray = {version = \"${{ github.event.inputs.new_ray_version }}\"" pyproject.toml; then - echo "✗ Ray version not found in pyproject.toml" - echo "Expected: ray = {version = \"${{ github.event.inputs.new_ray_version }}\"" - echo "Found:" - grep "ray = " pyproject.toml || echo " (not found)" - exit 1 + if grep -q 'ray = {version = "${{ github.event.inputs.new_ray_version }}"' pyproject.toml; then + echo "✓ Ray dependency updated in pyproject.toml" + else + echo "✗ Ray dependency not found in pyproject.toml" + FAILED=1 fi fi - # Check if SDK version was updated correctly (only if SDK version was provided) if [ -n "${{ github.event.inputs.new_sdk_version }}" ]; then - if ! grep -q "version = \"${{ github.event.inputs.new_sdk_version }}\"" pyproject.toml; then + if grep -q '^version = "${{ github.event.inputs.new_sdk_version }}"' pyproject.toml; then + echo "✓ SDK version updated in pyproject.toml" + else echo "✗ SDK version not found in pyproject.toml" - echo "Expected: version = \"${{ github.event.inputs.new_sdk_version }}\"" - echo "Found:" - grep "version = " pyproject.toml || echo " (not found)" - exit 1 + FAILED=1 + fi + fi + + if [ -n "${{ github.event.inputs.new_py312_cuda_sha }}" ]; then + if grep -q "quay.io/modh/ray@sha256:${{ github.event.inputs.new_py312_cuda_sha }}" src/codeflare_sdk/common/utils/constants.py; then + echo "✓ py312 CUDA SHA updated in constants.py" + else + echo "✗ py312 CUDA SHA not found in constants.py" + FAILED=1 + fi + fi + + if [ -n "${{ github.event.inputs.new_py311_cuda_sha }}" ]; then + if grep -q "quay.io/modh/ray@sha256:${{ github.event.inputs.new_py311_cuda_sha }}" src/codeflare_sdk/common/utils/constants.py; then + echo "✓ py311 CUDA SHA updated in constants.py" + else + echo "✗ py311 CUDA SHA not found in constants.py" + FAILED=1 fi fi - # Check if runtime images were updated (only if SHAs were provided) - if [ -n "${{ github.event.inputs.new_cuda_py311_sha }}" ]; then - if ! grep -q "quay.io/modh/ray@sha256:${{ github.event.inputs.new_cuda_py311_sha }}" src/codeflare_sdk/common/utils/constants.py; then - echo "✗ Python 3.11 runtime image not found" - echo "Expected: quay.io/modh/ray@sha256:${{ github.event.inputs.new_cuda_py311_sha }}" - echo "Found:" - grep "CUDA_PY311_RUNTIME_IMAGE" src/codeflare_sdk/common/utils/constants.py || echo " (not found)" - exit 1 + if [ -n "${{ github.event.inputs.py312_cuda_tag }}" ]; then + if grep -rq "${{ github.event.inputs.py312_cuda_tag }}" src/codeflare_sdk/common/utils/constants.py demo-notebooks/ docs/; then + echo "✓ py312 CUDA tag updated" + else + echo "✗ py312 CUDA tag not found in expected files" + FAILED=1 fi fi - if [ -n "${{ github.event.inputs.new_cuda_py312_sha }}" ]; then - if ! grep -q "quay.io/modh/ray@sha256:${{ github.event.inputs.new_cuda_py312_sha }}" src/codeflare_sdk/common/utils/constants.py; then - echo "✗ Python 3.12 runtime image not found" - echo "Expected: quay.io/modh/ray@sha256:${{ github.event.inputs.new_cuda_py312_sha }}" - echo "Found:" - grep "CUDA_PY312_RUNTIME_IMAGE" src/codeflare_sdk/common/utils/constants.py || echo " (not found)" - exit 1 + if [ -n "${{ github.event.inputs.py311_cuda_tag }}" ]; then + if grep -rq "${{ github.event.inputs.py311_cuda_tag }}" src/codeflare_sdk/common/utils/constants.py demo-notebooks/ docs/; then + echo "✓ py311 CUDA tag updated" + else + echo "✗ py311 CUDA tag not found in expected files" + FAILED=1 fi fi + if [ -n "${{ github.event.inputs.py312_rocm_tag }}" ]; then + if grep -rq "${{ github.event.inputs.py312_rocm_tag }}" docs/; then + echo "✓ py312 ROCm tag updated" + else + echo "⚠ py312 ROCm tag not found in docs (no existing py312 ROCm references to replace)" + fi + fi + + if [ -n "${{ github.event.inputs.py311_rocm_tag }}" ]; then + if grep -rq "${{ github.event.inputs.py311_rocm_tag }}" docs/; then + echo "✓ py311 ROCm tag updated" + else + echo "⚠ py311 ROCm tag not found in docs (no existing py311 ROCm references to replace)" + fi + fi + + if [ "${FAILED}" -eq 1 ]; then + echo "" + echo "::error::Validation failed -- see above for details" + exit 1 + fi + + echo "" + echo "All validations passed." + - name: Check for changes id: check-changes run: | @@ -223,46 +275,42 @@ jobs: run: | git add . - # Build commit message based on what was updated - COMMIT_MSG="Update Ray configuration" + COMMIT_MSG="Update version configuration" if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then - COMMIT_MSG="$COMMIT_MSG - - - Updated Ray version to ${{ github.event.inputs.new_ray_version }} in constants.py and pyproject.toml" + COMMIT_MSG="${COMMIT_MSG} + - Ray version: ${{ steps.current.outputs.ray_version }} -> ${{ github.event.inputs.new_ray_version }}" fi - if [ -n "${{ github.event.inputs.new_sdk_version }}" ]; then - COMMIT_MSG="$COMMIT_MSG - - Updated SDK version to ${{ github.event.inputs.new_sdk_version }} in pyproject.toml" + COMMIT_MSG="${COMMIT_MSG} + - SDK version: ${{ steps.current.outputs.sdk_version }} -> ${{ github.event.inputs.new_sdk_version }}" fi - - if [ -n "${{ github.event.inputs.new_cuda_py311_sha }}" ]; then - COMMIT_MSG="$COMMIT_MSG - - Updated Python 3.11 CUDA runtime image SHA" + if [ -n "${{ github.event.inputs.new_py312_cuda_sha }}" ]; then + COMMIT_MSG="${COMMIT_MSG} + - Updated py312 CUDA runtime image SHA" fi - - if [ -n "${{ github.event.inputs.new_cuda_py312_sha }}" ]; then - COMMIT_MSG="$COMMIT_MSG - - Updated Python 3.12 CUDA runtime image SHA" + if [ -n "${{ github.event.inputs.new_py311_cuda_sha }}" ]; then + COMMIT_MSG="${COMMIT_MSG} + - Updated py311 CUDA runtime image SHA" fi - - if [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ] || [ -n "${{ github.event.inputs.new_cuda_version_py312 }}" ]; then - COMMIT_MSG="$COMMIT_MSG - - Updated documentation and notebook files with new CUDA versions" + if [ -n "${{ github.event.inputs.py312_cuda_tag }}" ]; then + COMMIT_MSG="${COMMIT_MSG} + - py312 CUDA tag -> ${{ github.event.inputs.py312_cuda_tag }}" + fi + if [ -n "${{ github.event.inputs.py312_rocm_tag }}" ]; then + COMMIT_MSG="${COMMIT_MSG} + - py312 ROCm tag -> ${{ github.event.inputs.py312_rocm_tag }}" + fi + if [ -n "${{ github.event.inputs.py311_cuda_tag }}" ]; then + COMMIT_MSG="${COMMIT_MSG} + - py311 CUDA tag -> ${{ github.event.inputs.py311_cuda_tag }}" + fi + if [ -n "${{ github.event.inputs.py311_rocm_tag }}" ]; then + COMMIT_MSG="${COMMIT_MSG} + - py311 ROCm tag -> ${{ github.event.inputs.py311_rocm_tag }}" fi - COMMIT_MSG="$COMMIT_MSG - - Parameters provided: - - Ray version: ${{ github.event.inputs.new_ray_version }} - - SDK version: ${{ github.event.inputs.new_sdk_version }} - - Python 3.11 CUDA version: ${{ github.event.inputs.new_cuda_version_py311 }} - - Python 3.12 CUDA version: ${{ github.event.inputs.new_cuda_version_py312 }} - - Python 3.11 runtime SHA: ${{ github.event.inputs.new_cuda_py311_sha }} - - Python 3.12 runtime SHA: ${{ github.event.inputs.new_cuda_py312_sha }}" - - git commit -m "$COMMIT_MSG" + git commit -m "${COMMIT_MSG}" - name: Push changes if: steps.check-changes.outputs.has-changes == 'true' @@ -272,68 +320,82 @@ jobs: - name: Create Pull Request if: steps.check-changes.outputs.has-changes == 'true' run: | - # Get current versions for comparison - CURRENT_SDK_VERSION=$(grep -E "^version = " pyproject.toml | head -1 | sed 's/version = "\([^"]*\)"/\1/') - CURRENT_RAY_VERSION=$(grep "RAY_VERSION = " src/codeflare_sdk/common/utils/constants.py | sed 's/RAY_VERSION = "\([^"]*\)"/\1/') - PR_TITLE="Pre-Release Version Updates" - PR_BODY="## Pre-Release Version Updates + CHANGES="" - This PR contains automated version updates for the upcoming release. - - ### Changes Made:" + if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then + CHANGES="${CHANGES} + - **Ray**: \`v${{ steps.current.outputs.ray_version }}\` → \`v${{ github.event.inputs.new_ray_version }}\`" + fi if [ -n "${{ github.event.inputs.new_sdk_version }}" ]; then - PR_BODY="$PR_BODY - - **CodeFlare SDK**: Bumped from \`v${CURRENT_SDK_VERSION}\` to \`v${{ github.event.inputs.new_sdk_version }}\`" + CHANGES="${CHANGES} + - **CodeFlare SDK**: \`v${{ steps.current.outputs.sdk_version }}\` → \`v${{ github.event.inputs.new_sdk_version }}\`" fi - if [ -n "${{ github.event.inputs.new_ray_version }}" ]; then - PR_BODY="$PR_BODY - - **Ray**: Bumped from \`v${CURRENT_RAY_VERSION}\` to \`v${{ github.event.inputs.new_ray_version }}\`" + if [ -n "${{ github.event.inputs.new_py312_cuda_sha }}" ]; then + SHA312_SHORT=$(echo "${{ github.event.inputs.new_py312_cuda_sha }}" | cut -c1-12) + CHANGES="${CHANGES} + - **py312 CUDA Runtime SHA**: Updated to [\`${SHA312_SHORT}...\`](https://quay.io/repository/modh/ray/manifest/sha256:${{ github.event.inputs.new_py312_cuda_sha }})" fi - if [ -n "${{ github.event.inputs.new_cuda_py311_sha }}" ]; then - PR_BODY="$PR_BODY - - **Python 3.11 CUDA Runtime**: Updated to [\`${{ github.event.inputs.new_cuda_py311_sha }}\`](https://quay.io/repository/modh/ray/manifest/sha256:${{ github.event.inputs.new_cuda_py311_sha }})" - if [ -n "${{ github.event.inputs.new_cuda_version_py311 }}" ]; then - PR_BODY="$PR_BODY (CUDA \`${{ github.event.inputs.new_cuda_version_py311 }}\`)" - fi + if [ -n "${{ github.event.inputs.new_py311_cuda_sha }}" ]; then + SHA311_SHORT=$(echo "${{ github.event.inputs.new_py311_cuda_sha }}" | cut -c1-12) + CHANGES="${CHANGES} + - **py311 CUDA Runtime SHA**: Updated to [\`${SHA311_SHORT}...\`](https://quay.io/repository/modh/ray/manifest/sha256:${{ github.event.inputs.new_py311_cuda_sha }})" fi - if [ -n "${{ github.event.inputs.new_cuda_py312_sha }}" ]; then - PR_BODY="$PR_BODY - - **Python 3.12 CUDA Runtime**: Updated to [\`${{ github.event.inputs.new_cuda_py312_sha }}\`](https://quay.io/repository/modh/ray/manifest/sha256:${{ github.event.inputs.new_cuda_py312_sha }})" - if [ -n "${{ github.event.inputs.new_cuda_version_py312 }}" ]; then - PR_BODY="$PR_BODY (CUDA \`${{ github.event.inputs.new_cuda_version_py312 }}\`)" - fi + if [ -n "${{ github.event.inputs.py312_cuda_tag }}" ]; then + CHANGES="${CHANGES} + - **py312 CUDA tag**: → \`${{ github.event.inputs.py312_cuda_tag }}\`" fi - PR_BODY="$PR_BODY + if [ -n "${{ github.event.inputs.py312_rocm_tag }}" ]; then + CHANGES="${CHANGES} + - **py312 ROCm tag**: → \`${{ github.event.inputs.py312_rocm_tag }}\`" + fi + + if [ -n "${{ github.event.inputs.py311_cuda_tag }}" ]; then + CHANGES="${CHANGES} + - **py311 CUDA tag**: → \`${{ github.event.inputs.py311_cuda_tag }}\`" + fi + + if [ -n "${{ github.event.inputs.py311_rocm_tag }}" ]; then + CHANGES="${CHANGES} + - **py311 ROCm tag**: → \`${{ github.event.inputs.py311_rocm_tag }}\`" + fi + + PR_BODY=$(cat <