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

Refactor mechanisms of building TF wheel and storing TF project version. #496

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

Refactor mechanisms of building TF wheel and storing TF project version.

A new repository rule python_wheel_version_suffix_repository provides information about project and wheel version suffixes. The final value depends on environment variables passed to Bazel command: _ML_WHEEL_WHEEL_TYPE, _ML_WHEEL_BUILD_DATE, _ML_WHEEL_GIT_HASH, _ML_WHEEL_VERSION_SUFFIX

tf_version.bzl defines the TF project version and loads the version suffix information calculated by python_wheel_version_suffix_repository.

The targets //tensorflow/core/public:release_version, //tensorflow:tensorflow_bzl //tensorflow/tools/pip_package:setup_py use the version chunks defined above.

The version of the wheel in the build rule output depends on the environment variables.

Environment variables combinations for creating wheels with different versions:

  • snapshot: default build rule behavior (--repo-env=ML_WHEEL_TYPE=snapshot)
  • release: --repo-env=ML_WHEEL_TYPE=release
  • nightly build with date as version suffix: --repo-env=ML_WHEEL_TYPE=nightly --repo-env=ML_WHEEL_BUILD_DATE=<YYYYmmdd>
  • build with git data as version suffix: --repo-env=ML_WHEEL_TYPE=custom --repo-env=ML_WHEEL_BUILD_DATE=$(git show -s --format=%as HEAD) --repo-env=ML_WHEEL_GIT_HASH=$(git rev-parse HEAD)
  • build with git data and additional custom version suffix: --repo-env=ML_WHEEL_TYPE=custom --repo-env=ML_WHEEL_BUILD_DATE=$(git show -s --format=%as HEAD) --repo-env=ML_WHEEL_GIT_HASH=$(git rev-parse HEAD) --repo-env=ML_WHEEL_VERSION_SUFFIX=-rc1

@copybara-service copybara-service bot force-pushed the test_716296989 branch 4 times, most recently from f3bedb5 to 5a3d57d Compare January 17, 2025 16:15
A new repository rule `python_wheel_version_suffix_repository` provides information about project and wheel version suffixes. The final value depends on environment variables passed to Bazel command: `_ML_WHEEL_WHEEL_TYPE, _ML_WHEEL_BUILD_DATE, _ML_WHEEL_GIT_HASH, _ML_WHEEL_VERSION_SUFFIX`

`tf_version.bzl` defines the TF project version and loads the version suffix information calculated by `python_wheel_version_suffix_repository`.

The targets `//tensorflow/core/public:release_version, //tensorflow:tensorflow_bzl //tensorflow/tools/pip_package:setup_py` use the version chunks defined above.

The version of the wheel in the build rule output depends on the environment variables.

Environment variables combinations for creating wheels with different versions:
  * snapshot: default build rule behavior (`--repo-env=ML_WHEEL_TYPE=snapshot`)
  * release: `--repo-env=ML_WHEEL_TYPE=release`
  * nightly build with date as version suffix: `--repo-env=ML_WHEEL_TYPE=nightly --repo-env=ML_WHEEL_BUILD_DATE=<YYYYmmdd>`
  * build with git data as version suffix: `--repo-env=ML_WHEEL_TYPE=custom --repo-env=ML_WHEEL_BUILD_DATE=$(git show -s --format=%as HEAD) --repo-env=ML_WHEEL_GIT_HASH=$(git rev-parse HEAD)`
  * build with git data and additional custom version suffix: `--repo-env=ML_WHEEL_TYPE=custom --repo-env=ML_WHEEL_BUILD_DATE=$(git show -s --format=%as HEAD) --repo-env=ML_WHEEL_GIT_HASH=$(git rev-parse HEAD) --repo-env=ML_WHEEL_VERSION_SUFFIX=-rc1`

PiperOrigin-RevId: 716296989
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.

1 participant