Skip to content

Commit

Permalink
Migrate all serve tests to byod
Browse files Browse the repository at this point in the history
Signed-off-by: can <can@anyscale.com>
  • Loading branch information
can-anyscale committed Jun 14, 2023
1 parent 28d7501 commit e011ad3
Show file tree
Hide file tree
Showing 9 changed files with 249 additions and 25 deletions.
10 changes: 10 additions & 0 deletions release/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ compile_pip_requirements(
visibility = ["//visibility:private"],
)

compile_pip_requirements(
name = "requirements_ml_byod",
requirements_in = "ray_release/byod/requirements_ml_byod.in",
requirements_txt = "ray_release/byod/requirements_ml_byod.txt",
tags = [
"team:ci",
],
visibility = ["//visibility:private"],
)

test_srcs = glob(["**/*.py"])

####
Expand Down
9 changes: 8 additions & 1 deletion release/ray_release/byod/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
BASE_IMAGE_WAIT_TIMEOUT = 7200
BASE_IMAGE_WAIT_DURATION = 30
RELEASE_BYOD_DIR = os.path.join(RELEASE_PACKAGE_DIR, "ray_release/byod")
REQUIREMENTS_BYOD = "requirements_byod.txt"
REQUIREMENTS_ML_BYOD = "requirements_ml_byod.txt"


def build_anyscale_byod_images(tests: List[Test]) -> None:
Expand All @@ -41,6 +43,11 @@ def build_anyscale_byod_images(tests: List[Test]) -> None:
):
for ray_image, test in to_be_built.items():
byod_image = test.get_anyscale_byod_image()
byod_requirements = (
REQUIREMENTS_BYOD
if test.get_byod_type() == "cpu"
else REQUIREMENTS_ML_BYOD
)
if _byod_image_exist(test):
logger.info(f"Image {byod_image} already exists")
built.add(ray_image)
Expand Down Expand Up @@ -78,7 +85,7 @@ def build_anyscale_byod_images(tests: List[Test]) -> None:
"--build-arg",
f"BASE_IMAGE={byod_image}",
"--build-arg",
"PIP_REQUIREMENTS=requirements_byod.txt",
f"PIP_REQUIREMENTS={byod_requirements}",
"--build-arg",
"DEBIAN_REQUIREMENTS=requirements_debian_byod.txt",
"-t",
Expand Down
7 changes: 6 additions & 1 deletion release/ray_release/byod/byod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ sudo apt-get update -y \
&& sudo apt-get install -y --no-install-recommends $(cat requirements_debian_byod.txt) \
&& sudo apt-get autoclean

rm -rf /tmp/wrk
git clone --branch 4.2.0 https://github.com/wg/wrk.git /tmp/wrk
make -C /tmp/wrk -j
sudo cp /tmp/wrk/wrk /usr/local/bin/wrk

EOF

COPY "$PIP_REQUIREMENTS" .
RUN "$HOME"/anaconda3/bin/pip install --no-cache-dir https://ray-ci-deps-wheels.s3.us-west-2.amazonaws.com/AutoROM.accept_rom_license-0.5.4-py3-none-any.whl
RUN "$HOME"/anaconda3/bin/pip install --no-cache-dir -r requirements_byod.txt
RUN "$HOME"/anaconda3/bin/pip install --no-cache-dir -r "${PIP_REQUIREMENTS}"
2 changes: 1 addition & 1 deletion release/ray_release/byod/requirements_byod.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Python requirements to run release tests from anyscale byod
# Python requirements to run release tests from anyscale byod (cpu type)
ale-py
anyscale
boto3
Expand Down
8 changes: 8 additions & 0 deletions release/ray_release/byod/requirements_ml_byod.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Python requirements to run release tests from anyscale byod (gpu type)
boto3
cmake
numpy
pyarrow
pytest
tqdm
validators
143 changes: 143 additions & 0 deletions release/ray_release/byod/requirements_ml_byod.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#
# This file is autogenerated by pip-compile with python 3.11
# To update, run:
#
# bazel run //release:requirements_ml_byod.update
#
boto3==1.26.152 \
--hash=sha256:a2778c5729d3dc0b3688c9f0d103543d7ec5ff44a4fd0e84d0d542e2dff05e62 \
--hash=sha256:ee0b8f8d238d4e1cf50fa6a185e4e066955b6105e9838a80b1b6582cd327dfdf
# via -r release/ray_release/byod/requirements_ml_byod.in
botocore==1.29.152 \
--hash=sha256:02a3205cc8579d4be6d537e63d72aebbf3f70f3aedcf40b3cae9dc2e24c774d0 \
--hash=sha256:f6319ecdbe3d325878f837cac2874e461b4d90691bb2d2186f980bce3b3cfcc8
# via
# boto3
# s3transfer
cmake==3.26.4 \
--hash=sha256:05cfd76c637eb22058c95e2dc383cadd4e0615e2643e637bb498a6cc24825790 \
--hash=sha256:1b92f9f59f48c803106dbdd6750b0f571a0500e25d3a62c42ba84bb7a9240d10 \
--hash=sha256:1d887be5f1a3f17559a78707a6bc0560f4f8cb93cebb9d823d90a63e68bae09b \
--hash=sha256:230227bf99f36614de84cdc92ffce3a50eb2803020e946f8da945a08fcf766bf \
--hash=sha256:235d8eac93a28dcce5a1cd7130412885a2aa53d5735cb2230e0f26f589347b65 \
--hash=sha256:24110035aff586a04a6a6fcf4609270642e4f503c0620c962dff75b653f81414 \
--hash=sha256:248a90816abfc10ff6e1109b54b8235c3e62f0ac92da16541753deb3b5ae063d \
--hash=sha256:3175442985558d5415b97f264a6a1bb0af5ecfe10e3f7510257b1ea66bd33848 \
--hash=sha256:3e280e81713408987b7053f5b922c9f94e45668ca6efff1f02846309ca0b5b0f \
--hash=sha256:432837364aa6cab2826a72e8a4cdd3586f5ac9ce495217ccd59aa70f2bba8120 \
--hash=sha256:93015da6f1c0e1e5f2debf752f1803ea52d742d915ad674043d36e471f937507 \
--hash=sha256:93a03bad17b9741acaff4a8651f8596496506602fa123e70fe67142f1b21ee2e \
--hash=sha256:b7a6946c345497c14064e0c9585b30f5aaebbefdfc0b245b6bb5a978eb4fc85f \
--hash=sha256:c3b0e72750c0f6c0373242c1299bc4ffdbebdd5004966ae6df0b2e9845aa6990 \
--hash=sha256:d45b30b9ce7280829888c78650177ab525df2b6785e1a5b3d82b4c147d828c0e \
--hash=sha256:d726671ae7ae4aa6989e73d26b9f8f8e6af45163a26ea243949d72246566fdd8 \
--hash=sha256:e058e59154a1e490fb9425b420f87e28144292397607638d73e323509f7efae6
# via -r release/ray_release/byod/requirements_ml_byod.in
decorator==5.1.1 \
--hash=sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330 \
--hash=sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186
# via validators
iniconfig==2.0.0 \
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
# via pytest
jmespath==1.0.1 \
--hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \
--hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe
# via
# boto3
# botocore
numpy==1.24.3 \
--hash=sha256:0ec87a7084caa559c36e0a2309e4ecb1baa03b687201d0a847c8b0ed476a7187 \
--hash=sha256:1a7d6acc2e7524c9955e5c903160aa4ea083736fde7e91276b0e5d98e6332812 \
--hash=sha256:202de8f38fc4a45a3eea4b63e2f376e5f2dc64ef0fa692838e31a808520efaf7 \
--hash=sha256:210461d87fb02a84ef243cac5e814aad2b7f4be953b32cb53327bb49fd77fbb4 \
--hash=sha256:2d926b52ba1367f9acb76b0df6ed21f0b16a1ad87c6720a1121674e5cf63e2b6 \
--hash=sha256:352ee00c7f8387b44d19f4cada524586f07379c0d49270f87233983bc5087ca0 \
--hash=sha256:35400e6a8d102fd07c71ed7dcadd9eb62ee9a6e84ec159bd48c28235bbb0f8e4 \
--hash=sha256:3c1104d3c036fb81ab923f507536daedc718d0ad5a8707c6061cdfd6d184e570 \
--hash=sha256:4719d5aefb5189f50887773699eaf94e7d1e02bf36c1a9d353d9f46703758ca4 \
--hash=sha256:4749e053a29364d3452c034827102ee100986903263e89884922ef01a0a6fd2f \
--hash=sha256:5342cf6aad47943286afa6f1609cad9b4266a05e7f2ec408e2cf7aea7ff69d80 \
--hash=sha256:56e48aec79ae238f6e4395886b5eaed058abb7231fb3361ddd7bfdf4eed54289 \
--hash=sha256:76e3f4e85fc5d4fd311f6e9b794d0c00e7002ec122be271f2019d63376f1d385 \
--hash=sha256:7776ea65423ca6a15255ba1872d82d207bd1e09f6d0894ee4a64678dd2204078 \
--hash=sha256:784c6da1a07818491b0ffd63c6bbe5a33deaa0e25a20e1b3ea20cf0e43f8046c \
--hash=sha256:8535303847b89aa6b0f00aa1dc62867b5a32923e4d1681a35b5eef2d9591a463 \
--hash=sha256:9a7721ec204d3a237225db3e194c25268faf92e19338a35f3a224469cb6039a3 \
--hash=sha256:a1d3c026f57ceaad42f8231305d4653d5f05dc6332a730ae5c0bea3513de0950 \
--hash=sha256:ab344f1bf21f140adab8e47fdbc7c35a477dc01408791f8ba00d018dd0bc5155 \
--hash=sha256:ab5f23af8c16022663a652d3b25dcdc272ac3f83c3af4c02eb8b824e6b3ab9d7 \
--hash=sha256:ae8d0be48d1b6ed82588934aaaa179875e7dc4f3d84da18d7eae6eb3f06c242c \
--hash=sha256:c91c4afd8abc3908e00a44b2672718905b8611503f7ff87390cc0ac3423fb096 \
--hash=sha256:d5036197ecae68d7f491fcdb4df90082b0d4960ca6599ba2659957aafced7c17 \
--hash=sha256:d6cc757de514c00b24ae8cf5c876af2a7c3df189028d68c0cb4eaa9cd5afc2bf \
--hash=sha256:d933fabd8f6a319e8530d0de4fcc2e6a61917e0b0c271fded460032db42a0fe4 \
--hash=sha256:ea8282b9bcfe2b5e7d491d0bf7f3e2da29700cec05b49e64d6246923329f2b02 \
--hash=sha256:ecde0f8adef7dfdec993fd54b0f78183051b6580f606111a6d789cd14c61ea0c \
--hash=sha256:f21c442fdd2805e91799fbe044a7b999b8571bb0ab0f7850d0cb9641a687092b
# via
# -r release/ray_release/byod/requirements_ml_byod.in
# pyarrow
packaging==23.1 \
--hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \
--hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f
# via pytest
pluggy==1.0.0 \
--hash=sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159 \
--hash=sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3
# via pytest
pyarrow==12.0.1 \
--hash=sha256:051f9f5ccf585f12d7de836e50965b3c235542cc896959320d9776ab93f3b33d \
--hash=sha256:1887bdae17ec3b4c046fcf19951e71b6a619f39fa674f9881216173566c8f718 \
--hash=sha256:2d3c4cbbf81e6dd23fe921bc91dc4619ea3b79bc58ef10bce0f49bdafb103daf \
--hash=sha256:345e1828efdbd9aa4d4de7d5676778aba384a2c3add896d995b23d368e60e5af \
--hash=sha256:3de26da901216149ce086920547dfff5cd22818c9eab67ebc41e863a5883bac7 \
--hash=sha256:43364daec02f69fec89d2315f7fbfbeec956e0d991cbbef471681bd77875c40f \
--hash=sha256:459a1c0ed2d68671188b2118c63bac91eaef6fc150c77ddd8a583e3c795737bf \
--hash=sha256:6251e38470da97a5b2e00de5c6a049149f7b2bd62f12fa5dbb9ac674119ba71a \
--hash=sha256:6895b5fb74289d055c43db3af0de6e16b07586c45763cb5e558d38b86a91e3a7 \
--hash=sha256:6d288029a94a9bb5407ceebdd7110ba398a00412c5b0155ee9813a40d246c5df \
--hash=sha256:749be7fd2ff260683f9cc739cb862fb11be376de965a2a8ccbf2693b098db6c7 \
--hash=sha256:85e705e33eaf666bbe508a16fd5ba27ca061e177916b7a317ba5a51bee43384c \
--hash=sha256:8d6009fdf8986332b2169314da482baed47ac053311c8934ac6651e614deacd6 \
--hash=sha256:9120c3eb2b1f6f516a3b7a9714ed860882d9ef98c4b17edcdc91d95b7528db60 \
--hash=sha256:a3c63124fc26bf5f95f508f5d04e1ece8cc23a8b0af2a1e6ab2b1ec3fdc91b24 \
--hash=sha256:b13329f79fa4472324f8d32dc1b1216616d09bd1e77cfb13104dec5463632c36 \
--hash=sha256:bb656150d3d12ec1396f6dde542db1675a95c0cc8366d507347b0beed96e87ca \
--hash=sha256:be2757e9275875d2a9c6e6052ac7957fbbfc7bc7370e4a036a9b893e96fedaba \
--hash=sha256:c780f4dc40460015d80fcd6a6140de80b615349ed68ef9adb653fe351778c9b3 \
--hash=sha256:cce317fc96e5b71107bf1f9f184d5e54e2bd14bbf3f9a3d62819961f0af86fec \
--hash=sha256:cdacf515ec276709ac8042c7d9bd5be83b4f5f39c6c037a17a60d7ebfd92c890 \
--hash=sha256:ce4aebdf412bd0eeb800d8e47db854f9f9f7e2f5a0220440acf219ddfddd4f63 \
--hash=sha256:cf812306d66f40f69e684300f7af5111c11f6e0d89d6b733e05a3de44961529d \
--hash=sha256:e0d8730c7f6e893f6db5d5b86eda42c0a130842d101992b581e2138e4d5663d3 \
--hash=sha256:e2c9cb8eeabbadf5fcfc3d1ddea616c7ce893db2ce4dcef0ac13b099ad7ca082
# via -r release/ray_release/byod/requirements_ml_byod.in
pytest==7.3.2 \
--hash=sha256:cdcbd012c9312258922f8cd3f1b62a6580fdced17db6014896053d47cddf9295 \
--hash=sha256:ee990a3cc55ba808b80795a79944756f315c67c12b56abd3ac993a7b8c17030b
# via -r release/ray_release/byod/requirements_ml_byod.in
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
# via botocore
s3transfer==0.6.1 \
--hash=sha256:3c0da2d074bf35d6870ef157158641178a4204a6e689e82546083e31e0311346 \
--hash=sha256:640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9
# via boto3
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
# via python-dateutil
tqdm==4.65.0 \
--hash=sha256:1871fb68a86b8fb3b59ca4cdd3dcccbc7e6d613eeed31f4c332531977b89beb5 \
--hash=sha256:c4f53a17fe37e132815abceec022631be8ffe1b9381c2e6e30aa70edc99e9671
# via -r release/ray_release/byod/requirements_ml_byod.in
urllib3==1.26.16 \
--hash=sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f \
--hash=sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14
# via botocore
validators==0.20.0 \
--hash=sha256:24148ce4e64100a2d5e267233e23e7afeb55316b47d30faae7eb6e7292bc226a
# via -r release/ray_release/byod/requirements_ml_byod.in
18 changes: 13 additions & 5 deletions release/ray_release/cluster_manager/cluster_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,19 @@ def set_cluster_env(self, cluster_env: Dict[str, Any]):
"RAY_USAGE_STATS_EXTRA_TAGS"
] = f"test_name={self.test.get_name()};smoke_test={self.smoke_test}"

self.cluster_env_name = (
f"{self.project_name}_{self.project_id[4:8]}"
f"__env__{self.test.get_name().replace('.', '_')}__"
f"{dict_hash(self.cluster_env)}"
)
if self.test.is_byod_cluster():
self.cluster_env_name = (
self.test.get_anyscale_byod_image()
.replace("/", "_")
.replace(":", "_")
.replace(".", "_")
)
else:
self.cluster_env_name = (
f"{self.project_name}_{self.project_id[4:8]}"
f"__env__{self.test.get_name().replace('.', '_')}__"
f"{dict_hash(self.cluster_env)}"
)

def set_cluster_compute(
self,
Expand Down
4 changes: 2 additions & 2 deletions release/ray_release/tests/test_cluster_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def testSetClusterEnv(self):
sdk.returns["get_project"] = APIDict(result=APIDict(name="release_unit_tests"))
sdk.returns["get_cloud"] = APIDict(result=APIDict(provider="AWS"))
cluster_manager = self.cls(
test=Test({"name": "test"}),
test=Test({"name": "test", "cluster": {}}),
project_id=UNIT_TEST_PROJECT_ID,
smoke_test=False,
sdk=sdk,
Expand All @@ -142,7 +142,7 @@ def testSetClusterEnv(self):
"test_name=test;smoke_test=False",
)
cluster_manager = self.cls(
test=Test({"name": "Test"}),
test=Test({"name": "Test", "cluster": {}}),
project_id=UNIT_TEST_PROJECT_ID,
smoke_test=True,
sdk=sdk,
Expand Down
Loading

0 comments on commit e011ad3

Please sign in to comment.