Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply new versioning scheme #398

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Apply new versioning scheme #398

merged 2 commits into from
Oct 31, 2024

Conversation

marbre
Copy link
Collaborator

@marbre marbre commented Oct 31, 2024

Progress on #130 and #294.

With this, every package has its own version_info.json which defaults to a dev build (X.Y.Z.dev). Based on this version information the version identifier for a release candate can be computed (X.Y.ZrcYYYYMMDD) which is written to corresponding version_info_rc.json files. This PR further adapt the build packages workflow to make use of the script and apply the new versioning scheme. Even though sharktank packages are not yet build, the workflow already generates the rc version numbers for sharktank and shortfin.

@marbre marbre requested a review from ScottTodd October 31, 2024 15:11
Progress on nod-ai#130 and nod-ai#294.

With this, every package has its own `version_info.json` which defaults
to a dev build (`X.Y.Z.dev`). Based on this version information the
version identifier for a release candate can be computed
(`X.Y.ZrcYYYYMMDD`) which is written to corresponding
`version_info_rc.json` files. This PR further adapt the build packages
workflow to make use of the script and apply the new versioning scheme.
Even though sharktank packages are not yet build, the workflow already
generates the rc version numbers for sharttank and shortfin.
Copy link
Member

Choose a reason for hiding this comment

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

Did you test this workflow? Should be possible with workflow_dispatch over at https://github.com/marbre/SHARK-Platform/actions/workflows/build_packages.yml

... which reminds me, we may want to disable it in forks somehow. I tested at https://github.com/ScottTodd/SHARK-Platform/actions/workflows/build_packages.yml, generating these: https://github.com/ScottTodd/SHARK-Platform/releases/tag/dev-wheels

I see that several forks are running the action too, which is failing because of the missing token: https://github.com/nithinsubbiah/sharktank/actions/workflows/build_packages.yml but some runs did succeed at one point: https://github.com/nithinsubbiah/sharktank/releases/tag/dev-wheels

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks promising :)
https://github.com/marbre/SHARK-Platform/actions/runs/11615896057/job/32347586648#step:4:1434

******************** BUILD COMPLETE ********************
Generated binaries:
total 2512
-rw-r--r-- 1 root root 2568751 Oct 31 16:31 shortfin-3.0.0rc20241031-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Comment on lines +25 to +29
try:
version_info = load_version_info(VERSION_INFO_RC_FILE)
except FileNotFoundError:
print("version_info_rc.json not found. Default to dev build")
version_info = load_version_info(VERSION_INFO_FILE)
Copy link
Member

Choose a reason for hiding this comment

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

Oh, interesting choice to have two different files. Did you consider other approaches? I can think of a few:

  • Overwrite the file (makes git index dirty for development though)
  • Have setup.py load from version_info.json and do the PACKAGE_RC_VERSION = PACKAGE_BASE_VERSION + "rc" + datetime.today().strftime("%Y%m%d") here

Multiple ways to do it, and what you have works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think there are even more:

  • Read the version from a version_info (text) and override with the updated one.
    • Use the version info file in the pyproject.toml making the setup.py obsolete:
      version = {file = version_info}
    • Drawback: Git gets dirty, limited flexibility.

With regards to the ones you listed:

  • I would like to avoid that the index gets dirty.
  • This introduces a dependency on packaging which isn't strictly needed. Furthermore, with this every builder calculates the version instead of computing this once in the CI.

But I am happy to iterate in a follow up but this one should also be compatible with what we will need for IREE.

@marbre marbre marked this pull request as ready for review October 31, 2024 16:28
@marbre marbre merged commit 3058af9 into nod-ai:main Oct 31, 2024
11 checks passed
@marbre marbre deleted the python-packages branch October 31, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants