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

[release-automation] Step to build update version binary into zip and store as artifact #45363

Merged
merged 12 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .buildkite/release-automation/pre_release.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ steps:
allow_dependency_failure: true
commands:
- bash .buildkite/release-automation/check-commit-hash.sh

- label: "Build update version binary"
key: build-update-version-zip
instance_type: default
job_env: forge
commands:
- bazel build --build_python_zip --incompatible_use_python_toolchains=false --python_path=python //ci/ray_ci/automation:update_version
- cp bazel-bin/ci/ray_ci/automation/update_version.zip /artifact-mount/
Copy link
Collaborator

Choose a reason for hiding this comment

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

will you upload the binaries somewhere after this step? if so do you plan to automate that step too?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the bot will just use buildkite API to download this from the pipeline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The binaries would not be uploaded anywhere else besides the build artifacts. And yes the automation bot would download this artifact using the Buildkite API (we already have a helper function just for that)


- label: "Trigger Postmerge test"
if: build.env("RAYCI_WEEKLY_RELEASE_NIGHTLY") != "1"
Expand Down
11 changes: 4 additions & 7 deletions ci/ray_ci/automation/update_version.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import os

import click

from ci.ray_ci.automation.update_version_lib import (
get_current_version,
update_file_version,
)

bazel_workspace_dir = os.environ.get("BUILD_WORKSPACE_DIRECTORY", "")


Comment on lines -10 to -11
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we also make this still working? like can we use this as the default value, and errors when it is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes that should be the default behavior for running locally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to use bazel workspace dir as default when root_dir. If bazel workspace dir is empty, raise exception

@click.command()
@click.option("--root_dir", required=True, type=str)
@click.option("--new_version", required=True, type=str)
Copy link
Collaborator

Choose a reason for hiding this comment

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

what should be the root_dir values provided by the users? is this script used somewhere and need to be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

root_dir would be the path to Ray repository that user would want the changes to be on. For automation bot, it would clone Ray repo now and pass the path to the repo as root_dir here. If user ran the script locally, root_dir would be their Bazel workspace path.

def main(new_version: str):
def main(root_dir: str, new_version: str):
"""
Update the version in the files to the specified version.
"""
main_version, java_version = get_current_version(bazel_workspace_dir)
main_version, java_version = get_current_version(root_dir)

update_file_version(
main_version,
java_version,
new_version,
bazel_workspace_dir,
root_dir,
)


Expand Down
Loading