forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] os-specific tester container (ray-project#41635)
Create Linux and Windows tester container. Test via unit tests. Will run e2e test on the top of this stack. Signed-off-by: can <can@anyscale.com>
- Loading branch information
1 parent
959a48b
commit 4eb27f6
Showing
8 changed files
with
125 additions
and
35 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
from typing import List, Optional | ||
|
||
from ci.ray_ci.linux_container import LinuxContainer | ||
from ci.ray_ci.tester_container import TesterContainer | ||
|
||
|
||
class LinuxTesterContainer(TesterContainer, LinuxContainer): | ||
def __init__( | ||
self, | ||
docker_tag: str, | ||
shard_count: int = 1, | ||
gpus: int = 0, | ||
test_envs: Optional[List[str]] = None, | ||
shard_ids: Optional[List[int]] = None, | ||
skip_ray_installation: bool = False, | ||
build_type: Optional[str] = None, | ||
) -> None: | ||
LinuxContainer.__init__( | ||
self, | ||
docker_tag, | ||
envs=test_envs, | ||
volumes=[ | ||
f"{os.environ.get('RAYCI_CHECKOUT_DIR')}:/ray-mount", | ||
"/var/run/docker.sock:/var/run/docker.sock", | ||
], | ||
) | ||
TesterContainer.__init__( | ||
self, | ||
shard_count, | ||
gpus, | ||
test_envs=test_envs, | ||
shard_ids=shard_ids, | ||
skip_ray_installation=skip_ray_installation, | ||
build_type=build_type, | ||
) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from unittest import mock | ||
from typing import List | ||
|
||
from ci.ray_ci.windows_tester_container import WindowsTesterContainer | ||
|
||
|
||
def test_init() -> None: | ||
install_ray_cmds = [] | ||
|
||
def _mock_subprocess(inputs: List[str], stdout, stderr) -> None: | ||
install_ray_cmds.append(inputs) | ||
|
||
with mock.patch("subprocess.check_call", side_effect=_mock_subprocess): | ||
WindowsTesterContainer("hi") | ||
assert install_ray_cmds[-1] == [ | ||
"docker", | ||
"build", | ||
"-t", | ||
"029272617770.dkr.ecr.us-west-2.amazonaws.com/rayproject/citemp:unknown-hi", | ||
"-f", | ||
"c:\\workdir\\ci\\ray_ci\\windows\\tests.env.Dockerfile", | ||
"c:\\workdir", | ||
] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from typing import List, Optional | ||
|
||
from ci.ray_ci.windows_container import WindowsContainer | ||
from ci.ray_ci.tester_container import TesterContainer | ||
|
||
|
||
class WindowsTesterContainer(TesterContainer, WindowsContainer): | ||
def __init__( | ||
self, | ||
docker_tag: str, | ||
shard_count: int = 1, | ||
test_envs: Optional[List[str]] = None, | ||
shard_ids: Optional[List[int]] = None, | ||
skip_ray_installation: bool = False, | ||
) -> None: | ||
WindowsContainer.__init__(self, docker_tag) | ||
TesterContainer.__init__( | ||
self, | ||
shard_count, | ||
gpus=0, # We don't support GPU tests on Windows yet. | ||
test_envs=test_envs, | ||
shard_ids=shard_ids, | ||
skip_ray_installation=skip_ray_installation, | ||
build_type=None, | ||
) |