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

Conversation

khluu
Copy link
Contributor

@khluu khluu commented May 15, 2024

  • This is to use for automation from product repo
  • Builds update_version binary into a python zip file and upload it as an artifact in release-automation pipeline
  • Have root_dir as an arg for update_version since automation is using this on a cloned Ray repo

khluu added 9 commits May 15, 2024 02:51
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
@khluu khluu requested a review from a team as a code owner May 15, 2024 20:36
@khluu
Copy link
Contributor Author

khluu commented May 15, 2024

Tested locally with this artifact: https://buildkite.com/ray-project/release-automation/builds/486#018f7df0-673e-493d-a03d-b8534431c7b8 and running script worked (files were changed)

Copy link
Collaborator

@can-anyscale can-anyscale left a comment

Choose a reason for hiding this comment

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

looking good, but a few questions for context


@click.command()
@click.option("--root_dir", 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.

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)

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.

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

Comment on lines -10 to -11
bazel_workspace_dir = os.environ.get("BUILD_WORKSPACE_DIRECTORY", "")

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

khluu added 2 commits May 16, 2024 00:45
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
Copy link
Collaborator

@can-anyscale can-anyscale left a comment

Choose a reason for hiding this comment

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

"""
Update the version in the files to the specified version.
"""
main_version, java_version = get_current_version(bazel_workspace_dir)
if not root_dir:
root_dir = os.environ.get("BUILD_WORKSPACE_DIRECTORY", "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: don't need the ""

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

if not root_dir:
root_dir = os.environ.get("BUILD_WORKSPACE_DIRECTORY", "")
if not root_dir:
raise Exception("Argument root_dir is not found.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe say: "please specify --root_dir when not using bazelisk run" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

p
Signed-off-by: khluu <51931015+khluu@users.noreply.github.com>
@aslonnie aslonnie added the go Trigger full test run on premerge label May 20, 2024
@aslonnie aslonnie enabled auto-merge (squash) May 20, 2024 17:11
@aslonnie aslonnie merged commit 4c1519b into master May 20, 2024
8 checks passed
@aslonnie aslonnie deleted the khluu/build_update_ver branch May 20, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Trigger full test run on premerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants