Skip to content

Commit

Permalink
Validate ray wheel (ray-project#36794)
Browse files Browse the repository at this point in the history
Signed-off-by: can <can@anyscale.com>
Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
  • Loading branch information
can-anyscale authored and arvind-chandra committed Aug 31, 2023
1 parent a9bf41d commit bd3cb8c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
49 changes: 39 additions & 10 deletions release/ray_release/byod/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ def build_anyscale_custom_byod_image(test: Test) -> None:
stdout=sys.stderr,
env=env,
)
# push the image to ecr, the image will have a tag in this format
# {commit_sha}-py{version}-gpu-{custom_information_dict_hash}
subprocess.check_call(
["docker", "push", byod_image],
stdout=sys.stderr,
)
_validate_and_push(byod_image)


def build_anyscale_base_byod_images(tests: List[Test]) -> None:
Expand Down Expand Up @@ -134,13 +129,47 @@ def build_anyscale_base_byod_images(tests: List[Test]) -> None:
stdout=sys.stderr,
env=env,
)
subprocess.check_call(
["docker", "push", byod_image],
stdout=sys.stderr,
)
_validate_and_push(byod_image)
built.add(ray_image)


def _validate_and_push(byod_image: str) -> None:
"""
Validates the given image and pushes it to ECR.
"""
docker_ray_commit = (
subprocess.check_output(
[
"docker",
"run",
"-ti",
"--entrypoint",
"python",
byod_image,
"-c",
"import ray; print(ray.__commit__)",
],
)
.decode("utf-8")
.strip()
)
expected_ray_commit = _get_ray_commit()
assert (
docker_ray_commit == expected_ray_commit
), f"Expected ray commit {expected_ray_commit}, found {docker_ray_commit}"
subprocess.check_call(
["docker", "push", byod_image],
stdout=sys.stderr,
)


def _get_ray_commit() -> str:
return os.environ.get(
"COMMIT_TO_TEST",
os.environ["BUILDKITE_COMMIT"],
)


def _download_dataplane_build_file() -> None:
"""
Downloads the dataplane build file from S3.
Expand Down
3 changes: 3 additions & 0 deletions release/ray_release/tests/test_byod_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def _mock_check_call(
), patch(
"subprocess.check_call",
side_effect=_mock_check_call,
), patch(
"subprocess.check_output",
return_value=b"abc123",
):
test = Test(
name="name",
Expand Down

0 comments on commit bd3cb8c

Please sign in to comment.