Skip to content

Conversation

@kramaranya
Copy link
Contributor

@kramaranya kramaranya commented Aug 21, 2025

I added a CI job for release process automation:

The Prepare Release GitHub Action automatically:

  • Detects the version change in kubeflow/__init__.py
  • Creates or updates the release-X.Y branch
  • Cherry-picks the version bump commit from main

The Release GitHub Action automatically:

  • Runs tests and builds the package
  • Creates and pushes the release tag
  • Publishes to PyPI (requires manual approval)
  • Creates GitHub Release (requires manual approval)

I also added the script to generate CHANGELOG and update the version.
And added Release README

I've tested this workflow on my branch - https://github.com/kramaranya/sdk/actions/runs/17457296258
PyPI project - https://pypi.org/project/kubeflow-test/
GitHub release - https://github.com/kramaranya/sdk/releases/tag/v0.8.1

@coveralls
Copy link

Pull Request Test Coverage Report for Build 17137367339

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 64.877%

Totals Coverage Status
Change from base Build 17059769083: 0.3%
Covered Lines: 290
Relevant Lines: 447

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 17137367339

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 64.877%

Totals Coverage Status
Change from base Build 17059769083: 0.3%
Covered Lines: 290
Relevant Lines: 447

💛 - Coveralls

@coveralls
Copy link

coveralls commented Aug 21, 2025

Pull Request Test Coverage Report for Build 17781819255

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 74 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.7%) to 71.739%

Files with Coverage Reduction New Missed Lines %
kubeflow/trainer/backends/kubernetes/backend.py 28 79.23%
kubeflow/trainer/utils/utils.py 46 64.25%
Totals Coverage Status
Change from base Build 17583649779: 0.7%
Covered Lines: 297
Relevant Lines: 414

💛 - Coveralls

@szaher
Copy link
Member

szaher commented Aug 21, 2025

@kramaranya You can convert it to draft till it's ready :)

@kramaranya kramaranya marked this pull request as draft August 22, 2025 09:12
@kramaranya kramaranya mentioned this pull request Aug 26, 2025
12 tasks
@kramaranya kramaranya marked this pull request as ready for review August 27, 2025 07:27
@kramaranya
Copy link
Contributor Author

/milestone v0.1

@google-oss-prow google-oss-prow bot added this to the v0.1 milestone Sep 1, 2025
@kramaranya kramaranya changed the title WIP: feat(ci): Add automated release CI job feat(ci): Add automated release CI job Sep 4, 2025
@kramaranya
Copy link
Contributor Author

@kubeflow/kubeflow-sdk-team CI for automated release process should be ready, I would appreciate your reviews!

shell: bash
run: |
if git ls-remote --tags origin "${{ steps.vars.outputs.version }}" | grep -q "refs/tags/${{ steps.vars.outputs.version }}"; then
echo "Tag ${{ steps.vars.outputs.version }} already exists. Skipping CI."; exit 0; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intention here to continue to the cherry pick even if the tag exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes initially, but now I think it makes sense to skip the cherry pick as well if the tag already exists
Let me update it!

echo "Using existing branch: $BRANCH"
git fetch origin "$BRANCH":"$BRANCH"
git checkout "$BRANCH"
if ! git cherry-pick -x "$MAIN_SHA"; then
Copy link
Contributor

@briangallagher briangallagher Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion: Add a check for the SHA before cherry-pick:
something like:

if git merge-base --is-ancestor "$MAIN_SHA" "$BRANCH"; then
  echo "Commit already present in $BRANCH"
else
  git cherry-pick -x "$MAIN_SHA"
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thank you!

Makefile Outdated
release: uv-venv
@if [ -z "$(VERSION)" ]; then echo "Usage: make release VERSION=v0.1.0"; exit 1; fi
@VERSION_NUM=$$(echo "$(VERSION)" | sed 's/^v//'); \
sed -i '' "s/__version__ = \".*\"/__version__ = \"$$VERSION_NUM\"/" kubeflow/__init__.py; \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work on non Mac?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I created a small python script instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kramaranya FYI, if we want to make sed command align between Mac and Linux, we can install gnu-sed, like in Kueue: https://github.com/kubernetes-sigs/kueue/blob/main/Makefile#L72-L81

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you! I think sed -i.bak works as well, shall we just keep as it is right now and don't introduce any extra dependency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kramaranya sed -i.bak will work for MacOS and Linux ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@briangallagher briangallagher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few minor comments but overall this looks great.

@kramaranya
Copy link
Contributor Author

@briangallagher I've addressed your comments, thank you for review!

/assign @briangallagher @andreyvelich @Electronic-Waste @astefanutti

@kramaranya
Copy link
Contributor Author

I've tested this workflow on different scenarios and everything works:

  • RC - 0.9.0rc1
  • Minor release - 0.9.0
  • Patch release (on release-0.9 branch to test the case when we want to update patch release for previous releases) - 0.9.1

Signed-off-by: kramaranya <kramaranya15@gmail.com>
@google-oss-prow google-oss-prow bot removed the lgtm label Sep 15, 2025
Signed-off-by: kramaranya <kramaranya15@gmail.com>
@andreyvelich
Copy link
Member

andreyvelich commented Sep 15, 2025

This is awesome, thanks @kramaranya!
Just maybe one suggestion, shall we keep names of contributions without links, so they will get tagged in the GitHub release ?

feat: Implement TrainerClient Backends & Local Process ([#33](https://github.com/kubeflow/sdk/pull/33)) by [@szaher](https://github.com/szaher)

change to


feat: Implement TrainerClient Backends & Local Process ([#33](https://github.com/kubeflow/sdk/pull/33)) by @szaher

Example: https://github.com/kubeflow/trainer/releases/tag/v2.0.0

@kramaranya
Copy link
Contributor Author

This is awesome, thanks @kramaranya! Just maybe one suggestion, shall we keep names of contributions without links, so they will get tagged in the GitHub release ?

feat: Implement TrainerClient Backends & Local Process ([#33](https://github.com/kubeflow/sdk/pull/33)) by [@szaher](https://github.com/szaher)

change to


feat: Implement TrainerClient Backends & Local Process ([#33](https://github.com/kubeflow/sdk/pull/33)) by @szaher

Example: https://github.com/kubeflow/trainer/releases/tag/v2.0.0

I've being trying to find the reason for that and wasn't sure since Trainer includes links in CHANGELOG.md. But sure, I'll update it, thank you!

@andreyvelich
Copy link
Member

I've being trying to find the reason for that and wasn't sure since Trainer includes links in CHANGELOG.md

Yes, I think I've done this because usernames with @ are not clickable in the GitHub Markdown: https://github.com/kubeflow/trainer/blob/master/docs/release/changelog.py#L43

But I think this is fine, k8s changelog CLI also doesn't add links: https://github.com/kubernetes-sigs/kueue/blob/main/CHANGELOG/CHANGELOG-0.11.md

Signed-off-by: kramaranya <kramaranya15@gmail.com>
@kramaranya
Copy link
Contributor Author

I've being trying to find the reason for that and wasn't sure since Trainer includes links in CHANGELOG.md

Yes, I think I've done this because usernames with @ are not clickable in the GitHub Markdown: https://github.com/kubeflow/trainer/blob/master/docs/release/changelog.py#L43

But I think this is fine, k8s changelog CLI also doesn't add links: https://github.com/kubernetes-sigs/kueue/blob/main/CHANGELOG/CHANGELOG-0.11.md

I see! Did you need to manually remove the links for every release?

@andreyvelich
Copy link
Member

I see! Did you need to manually remove the links for every release?

Yes, we have this perl command to replace it: https://github.com/kubeflow/trainer/tree/c6997fcc36a7a771071a3f127fe192225a2f48b9/docs/release#create-github-release

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kramaranya!
I think, we can move forward with this.
/lgtm
/assign @szaher @astefanutti @Electronic-Waste

@google-oss-prow google-oss-prow bot added the lgtm label Sep 15, 2025
Signed-off-by: kramaranya <kramaranya15@gmail.com>
@google-oss-prow google-oss-prow bot removed the lgtm label Sep 16, 2025
@andreyvelich
Copy link
Member

/approve
/hold
@kramaranya Feel free to un-hold this.

@kramaranya
Copy link
Contributor Author

Thank you!
/unhold

@kramaranya
Copy link
Contributor Author

/lgtm

@google-oss-prow
Copy link

@kramaranya: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@Electronic-Waste Electronic-Waste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kramaranya Thanks for this great contribution!
/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Sep 17, 2025
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich, Electronic-Waste

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Electronic-Waste,andreyvelich]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit ba22c64 into kubeflow:main Sep 17, 2025
10 checks passed
accorvin pushed a commit to opendatahub-io/kubeflow-sdk that referenced this pull request Oct 8, 2025
* feat(ci): Add release CI job

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* feat(ci): Add GitHub Release to CI

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Change kubeflow sdk PyPI package name

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add kubeflow sdk version verification to CI

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add proper changelog extraction

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Allow to reuse test-python workflow

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add changelog generation script

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Update uv.lock

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Remove blank lines in changelog script

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add make release in Makefile

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Refactor gen_changelog

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Delete CHANGELOG.md

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add prepare-release CI

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Allow manual trigger of release CI

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add release readme

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Update chnagelog parser in CI

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* skip and check cherry pick for new release

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* add script to update the version

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Update make release script

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Use make test-python in release CI

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Move prepare release CI to one a single workflow

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Remove uv.sync from RELEASE.md

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Upload artifacts to GitHub Release

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Run release CI against release-* branch

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Use X.Y.Z versioning in Kubeflow SDK

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Use single workflow for release

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Remove Release types from RELEASE.md

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Add a note about older minor series patch release

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Directly checkout release branch with ref input

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Checkout release branch with ref input

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Update extract changelog job

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Update the name of github release

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Remove full changelog line

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Fix ruff issue

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Don't use link for authors in changelog

Signed-off-by: kramaranya <kramaranya15@gmail.com>

* Remove chnagelog for RCs

Signed-off-by: kramaranya <kramaranya15@gmail.com>

---------

Signed-off-by: kramaranya <kramaranya15@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants