* feat: enable and generate OpenAPI schemas for SparkOperator APIs Signed-off-by: tariq-hasan <[email protected]> * feat: add tooling to generate and validate OpenAPI spec Signed-off-by: tariq-hasan <[email protected]> * feat: add generated OpenAPI spec for Spark Operator Signed-off-by: tariq-hasan <[email protected]> * feat: add tooling to generate Python client from OpenAPI spec Signed-off-by: tariq-hasan <[email protected]> * feat: add generated Python client for Spark Operator APIs Signed-off-by: tariq-hasan <[email protected]> * fix: align code generation with Trainer patterns Signed-off-by: tariq-hasan <[email protected]> * fix: align Spark swagger naming and Python SDK generation Signed-off-by: tariq-hasan <[email protected]> * docs: recommend isolated Python environments for SDK publishing Signed-off-by: tariq-hasan <[email protected]> * fix: generate Python SDK models for v1alpha1 and v1beta2 APIs Signed-off-by: tariq-hasan <[email protected]> --------- Signed-off-by: tariq-hasan <[email protected]>
5.7 KiB
Releasing the Spark operator
Prerequisites
-
Write permission for the Spark operator repository.
-
Maintainer access to the Kubeflow Spark Operator API Python modules.
-
Create a GitHub Token.
-
Create an isolated Python environment (recommended):
# Using venv python -m venv .venv source .venv/bin/activate # Or using uv (faster dependency management) uv venv source .venv/bin/activate -
Install
PyGithubto generate the Changelog:pip install PyGithub==2.3.0 -
Install
twineandbuildto publish the SDK package:pip install twine>=6.1.0 pip install build>=1.3.0-
Create a PyPI Token to publish Spark Operator SDK.
-
Add the following config to your
~/.pypircfile:[pypi] username = __token__ password = <PYPI_TOKEN>
-
Versioning policy
Spark Operator version format follows Semantic Versioning. Spark Operator versions are in the format of vX.Y.Z, where X is the major version, Y is the minor version, and Z is the patch version. The patch version contains only bug fixes.
Additionally, Spark Operator does pre-releases in this format: vX.Y.Z-rc.N where N is a number of the Nth release candidate (RC) before an upcoming public release named vX.Y.Z.
Release branches and tags
Spark Operator releases are tagged with tags like vX.Y.Z, for example v1.7.2.
Release branches are in the format of release-X.Y, where X.Y stands for the minor release.
vX.Y.Z releases are released from the release-X.Y branch. For example, v1.7.2 release should be on release-1.7 branch.
If you want to push changes to the release-X.Y release branch, you have to cherry pick your changes from the master branch and submit a PR.
Create a new release
Create release branch
-
Depends on what version you want to release,
- Major or Minor version - Use the GitHub UI to create a release branch from
masterand name the release branchrelease-X.Y. - Patch version - You don't need to create a new release branch.
- Major or Minor version - Use the GitHub UI to create a release branch from
-
Fetch the upstream changes into your local directory:
git fetch upstream -
Checkout into the release branch:
git checkout release-X.Y git rebase upstream/release-X.Y
Create GitHub tag
-
Modify
VERSIONfile in the root directory of the project:- For the RC tag as follows:
vX.Y.Z-rc.N- For the official release tag as follows:
vX.Y.Z -
Modify
versionandappVersioninChart.yaml:# Get version and remove the leading 'v' VERSION=$(cat VERSION | sed "s/^v//") # Change the version and appVersion in Chart.yaml # On Linux sed -i "s/^version.*/version: ${VERSION}/" charts/spark-operator-chart/Chart.yaml sed -i "s/^appVersion.*/appVersion: ${VERSION}/" charts/spark-operator-chart/Chart.yaml # On MacOS sed -i '' "s/^version.*/version: ${VERSION}/" charts/spark-operator-chart/Chart.yaml sed -i '' "s/^appVersion.*/appVersion: ${VERSION}/" charts/spark-operator-chart/Chart.yaml -
Update the Helm chart README:
make helm-docs -
Commit the changes:
git add VERSION git add charts/spark-operator-chart/Chart.yaml git add charts/spark-operator-chart/README.md git commit -s -m "Spark Operator Official Release v${VERSION}" git push origin release-X.Y -
Submit a PR to the release branch.
Release Kubeflow Spark Operator API Modules
-
Update the
API_VERSIONin thegen-api.shfile.You must follow this semantic
X.Y.ZrcNfor the RC orX.Y.Zfor the public release.For example:
API_VERSION = "2.1.0rc0" -
Generate and publish the Kubeflow Spark Operator API models:
make python-api cd api/python_api rm -rf dist python -m build twine upload dist/* cd ../..
Release Spark Operator Image
After VERSION file is modified and pushed to the release branch, a release workflow will be triggered to build and push Spark operator docker images to Docker Hub.
Publish release
After VERSION file is modified and pushed to the release branch, a release workflow will be triggered to create a new draft release with the Spark operator Helm chart packaged as an artifact. After modifying the release notes, then publish the release.
Release Spark Operator Helm Chart
After the draft release is published, a release workflow will be triggered to update the Helm chart repo index and publish it to the Helm repository.
Update Changelog
Update the CHANGELOG.md file by running:
python hack/generate-changelog.py \
--token=<github-token> \
--range=<previous-release>..<current-release>
If you are creating the first minor pre-release or the minor release (X.Y), your previous-release is equal to the latest release on the release-X.Y branch.
For example: --range=v1.7.1..v1.8.0.
Otherwise, your previous-release is equal to the latest release on the release-X.Y branch.
For example: --range=v1.7.0..v1.8.0-rc.0
Group PRs in the Changelog into Features, Bug fixes, Documentation, etc.
Finally, submit a PR with the updated Changelog.