Skip to content

Commit

Permalink
[ci] post-wheel tests (ray-project#40460)
Browse files Browse the repository at this point in the history
Migrate post-wheel tests to civ2:
- Simply build the wheel before running tests

Signed-off-by: can <can@anyscale.com>
  • Loading branch information
can-anyscale authored Nov 4, 2023
1 parent 8711328 commit d48be7a
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 31 deletions.
14 changes: 14 additions & 0 deletions .buildkite/core.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ steps:
depends_on: corebuild
job_env: forge

- label: ":ray: core: wheel tests"
tags: linux_wheels
instance_type: medium
commands:
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/tests/... //doc/... core
--build-type wheel
--parallelism-per-worker 3
--only-tags post_wheel_build
--test-env=RAY_CI_POST_WHEEL_TESTS=True
depends_on:
- manylinux
- corebuild
job_env: forge

- label: ":ray: core: minimal tests {{matrix}}"
tags: python
instance_type: medium
Expand Down
19 changes: 0 additions & 19 deletions .buildkite/pipeline.build_release.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .buildkite/pipeline.ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
# (see https://github.com/ray-project/ray/pull/38432/)
- pip install "transformers==4.30.2" "datasets==2.14.0"
- ./ci/env/env_info.sh
- bazel test --config=ci $(./ci/run/bazel_export_options) --build_tests_only
--test_tag_filters=-timeseries_libs,-external,-ray_air,-gpu,-post_wheel_build,-doctest,-datasets_train,-highly_parallel,-team:core
doc/...
- bazel test --config=ci $(./scripts/bazel_export_options)
--test_tag_filters=xcommit,-gpu
doc/...
Expand Down
14 changes: 14 additions & 0 deletions .buildkite/serve.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ steps:
depends_on: servebuild
job_env: forge

- label: ":ray-serve: serve: wheel tests"
tags: linux_wheels
instance_type: medium
commands:
- bazel run //ci/ray_ci:test_in_docker -- //python/ray/serve/... //doc/... serve
--build-type wheel
--parallelism-per-worker 3
--only-tags post_wheel_build
--test-env=RAY_CI_POST_WHEEL_TESTS=True
depends_on:
- manylinux
- servebuild
job_env: forge

- label: ":ray-serve: serve: default minimal"
tags: python
instance_type: small
Expand Down
4 changes: 2 additions & 2 deletions ci/ray_ci/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import click

from ci.ray_ci.builder_container import PYTHON_VERSIONS, BUILD_TYPE, BuilderContainer
from ci.ray_ci.builder_container import PYTHON_VERSIONS, BUILD_TYPES, BuilderContainer
from ci.ray_ci.doc_builder_container import DocBuilderContainer
from ci.ray_ci.forge_container import ForgeContainer
from ci.ray_ci.docker_container import PLATFORM
Expand All @@ -26,7 +26,7 @@
@click.option(
"--build-type",
default="optimized",
type=click.Choice(BUILD_TYPE),
type=click.Choice(BUILD_TYPES),
)
@click.option(
"--python-version",
Expand Down
13 changes: 7 additions & 6 deletions ci/ray_ci/builder_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@

from ci.ray_ci.container import Container

BUILD_TYPE = [
"optimized",
"debug",
]


class PythonVersionInfo(TypedDict):
bin_path: str
numpy_version: str


BUILD_TYPES = [
"optimized",
"debug",
]
PYTHON_VERSIONS = {
"3.8": PythonVersionInfo(bin_path="cp38-cp38", numpy_version="1.19.3"),
"3.9": PythonVersionInfo(bin_path="cp39-cp39", numpy_version="1.19.3"),
"3.10": PythonVersionInfo(bin_path="cp310-cp310", numpy_version="1.22.0"),
"3.11": PythonVersionInfo(bin_path="cp311-cp311", numpy_version="1.22.0"),
}
DEFAULT_PYTHON_VERSION = "3.8"
DEFAULT_BUILD_TYPE = "optimized"


class BuilderContainer(Container):
Expand All @@ -29,7 +30,7 @@ def __init__(self, python_version: str, build_type: str) -> None:
volumes=[f"{os.environ.get('RAYCI_CHECKOUT_DIR')}:/rayci"],
)
python_version_info = PYTHON_VERSIONS.get(python_version)
assert build_type in BUILD_TYPE, f"build_type must be one of {BUILD_TYPE}"
assert build_type in BUILD_TYPES, f"build_type must be one of {BUILD_TYPES}"
self.build_type = build_type
self.bin_path = python_version_info["bin_path"]
self.numpy_version = python_version_info["numpy_version"]
Expand Down
10 changes: 9 additions & 1 deletion ci/ray_ci/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
import click

from ci.ray_ci.container import _DOCKER_ECR_REPO
from ci.ray_ci.builder_container import (
BuilderContainer,
DEFAULT_BUILD_TYPE,
DEFAULT_PYTHON_VERSION,
)
from ci.ray_ci.tester_container import TesterContainer
from ci.ray_ci.utils import docker_login

Expand Down Expand Up @@ -100,7 +105,7 @@
)
@click.option(
"--build-type",
type=click.Choice(["optimized", "debug", "asan", "java"]),
type=click.Choice(["optimized", "debug", "asan", "java", "wheel"]),
default="optimized",
)
def main(
Expand All @@ -124,6 +129,9 @@ def main(
os.chdir(bazel_workspace_dir)
docker_login(_DOCKER_ECR_REPO.split("/")[0])

if build_type == "wheel":
# for wheel testing, we first build the wheel and then use it for running tests
BuilderContainer(DEFAULT_PYTHON_VERSION, DEFAULT_BUILD_TYPE).run()
container = _get_container(
team,
workers,
Expand Down

0 comments on commit d48be7a

Please sign in to comment.