-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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] More flexibility on the pipeline #45254
Merged
+103
−20
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
download_ray_wheels_from_s3, | ||
_check_downloaded_wheels, | ||
PYTHON_VERSIONS, | ||
PLATFORMS, | ||
FULL_PLATFORMS, | ||
PARTIAL_PLATFORMS, | ||
RAY_TYPES, | ||
) | ||
|
||
|
@@ -26,9 +27,36 @@ | |
|
||
def test_get_wheel_names(): | ||
ray_version = "1.0.0" | ||
wheel_names = _get_wheel_names(ray_version) | ||
wheel_names = _get_wheel_names(ray_version, full_platform=True) | ||
|
||
assert len(wheel_names) == len(PYTHON_VERSIONS) * len(FULL_PLATFORMS) * len( | ||
RAY_TYPES | ||
) | ||
|
||
for wheel_name in wheel_names: | ||
assert len(wheel_name.split("-")) == 5 | ||
( | ||
ray_type, | ||
ray_version, | ||
python_version, | ||
python_version2, | ||
platform, | ||
) = wheel_name.split("-") | ||
platform = platform.split(".")[0] # Remove the .whl suffix | ||
|
||
assert ray_type in RAY_TYPES | ||
assert ray_version == ray_version | ||
assert f"{python_version}-{python_version2}" in PYTHON_VERSIONS | ||
assert platform in FULL_PLATFORMS | ||
|
||
assert len(wheel_names) == len(PYTHON_VERSIONS) * len(PLATFORMS) * len(RAY_TYPES) | ||
|
||
def test_get_wheel_names_partial_platform(): | ||
ray_version = "1.1.0" | ||
wheel_names = _get_wheel_names(ray_version, full_platform=False) | ||
|
||
assert len(wheel_names) == len(PYTHON_VERSIONS) * len(PARTIAL_PLATFORMS) * len( | ||
RAY_TYPES | ||
) | ||
|
||
for wheel_name in wheel_names: | ||
assert len(wheel_name.split("-")) == 5 | ||
|
@@ -44,7 +72,7 @@ def test_get_wheel_names(): | |
assert ray_type in RAY_TYPES | ||
assert ray_version == ray_version | ||
assert f"{python_version}-{python_version2}" in PYTHON_VERSIONS | ||
assert platform in PLATFORMS | ||
assert platform in PARTIAL_PLATFORMS | ||
|
||
|
||
def test_check_downloaded_wheels(): | ||
|
@@ -134,10 +162,42 @@ def test_download_ray_wheels_from_s3( | |
|
||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
download_ray_wheels_from_s3( | ||
commit_hash=commit_hash, ray_version=ray_version, directory_path=tmp_dir | ||
commit_hash=commit_hash, | ||
ray_version=ray_version, | ||
directory_path=tmp_dir, | ||
) | ||
|
||
mock_get_wheel_names.assert_called_with(ray_version, True) | ||
assert mock_download_wheel.call_count == len(SAMPLE_WHEELS) | ||
for i, call_args in enumerate(mock_download_wheel.call_args_list): | ||
assert ( | ||
call_args[0][0] | ||
== f"releases/{ray_version}/{commit_hash}/{SAMPLE_WHEELS[i]}.whl" | ||
) | ||
assert call_args[0][1] == tmp_dir | ||
|
||
mock_check_wheels.assert_called_with(tmp_dir, SAMPLE_WHEELS) | ||
|
||
|
||
@mock.patch("ci.ray_ci.automation.ray_wheels_lib.download_wheel_from_s3") | ||
@mock.patch("ci.ray_ci.automation.ray_wheels_lib._check_downloaded_wheels") | ||
@mock.patch("ci.ray_ci.automation.ray_wheels_lib._get_wheel_names") | ||
def test_download_ray_wheels_from_s3_partial_platform( | ||
mock_get_wheel_names, mock_check_wheels, mock_download_wheel | ||
): | ||
commit_hash = "1234567" | ||
ray_version = "1.1.0" | ||
|
||
mock_get_wheel_names.return_value = SAMPLE_WHEELS | ||
|
||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
download_ray_wheels_from_s3( | ||
commit_hash=commit_hash, | ||
ray_version=ray_version, | ||
directory_path=tmp_dir, | ||
) | ||
|
||
mock_get_wheel_names.assert_called_with(ray_version) | ||
mock_get_wheel_names.assert_called_with(ray_version, False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: add it is actually often not recommended to use a boolean as an flag arg. a string or an enum is often more readable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
assert mock_download_wheel.call_count == len(SAMPLE_WHEELS) | ||
for i, call_args in enumerate(mock_download_wheel.call_args_list): | ||
assert ( | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might not always be 3 parts , maybe just take 2nd part without assuming it has 3 parts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ya I forgot about cases like
0.0.1.post1
. Updated to just grab the 2nd part