Skip to content
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

add new 8000 port forwarding in kind #424

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions tests/compatibility-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def create_kuberay_service(template_name):

time.sleep(20)

shell_assert_success('kubectl apply -f {}'.format(raycluster_service_file))

wait_for_condition(
lambda: shell_run('kubectl get service rayservice-sample-serve-svc -o jsonpath="{.status}"') == 0,
timeout=900,
Expand Down Expand Up @@ -518,12 +520,11 @@ def setUp(self):
raise unittest.SkipTest("ray service is not supported")

def test_ray_serve_work(self):
port_forwarding_proc = subprocess.Popen('kubectl port-forward service/rayservice-sample-serve-svc 8000', shell=True)
time.sleep(5)
curl_cmd = 'curl -X POST -H \'Content-Type: application/json\' localhost:8000 -d \'["MANGO", 2]\''
wait_for_condition(
lambda: shell_run(curl_cmd) == 0,
timeout=5,
timeout=15,
)
create_kuberay_service(RayServiceTestCase.service_serve_update_template_file)
curl_cmd = 'curl -X POST -H \'Content-Type: application/json\' localhost:8000 -d \'["MANGO", 2]\''
Expand All @@ -534,17 +535,11 @@ def test_ray_serve_work(self):
)
create_kuberay_service(RayServiceTestCase.service_cluster_update_template_file)
time.sleep(5)
port_forwarding_proc.kill()
time.sleep(5)
port_forwarding_proc = subprocess.Popen('kubectl port-forward service/rayservice-sample-serve-svc 8000', shell=True)
time.sleep(5)
curl_cmd = 'curl -X POST -H \'Content-Type: application/json\' localhost:8000 -d \'["MANGO", 2]\''

wait_for_condition(
lambda: shell_run(curl_cmd) == 0,
timeout=180,
)
port_forwarding_proc.kill()

def parse_environment():
global ray_version, ray_image, kuberay_sha
Expand Down
4 changes: 4 additions & 0 deletions tests/config/cluster-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ nodes:
hostPort: 52365
listenAddress: "0.0.0.0"
protocol: tcp
- containerPort: 30800
hostPort: 8000
listenAddress: "0.0.0.0"
protocol: tcp
2 changes: 1 addition & 1 deletion tests/config/ray-service-cluster-update.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
labels:
# custom labels. NOTE: do not define custom labels start with `raycluster.`, they may be used in controller.
# Refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
rayCluster: raycluster-sample # will be injected if missing
rayCluster: raycluster-compatibility-test # will be injected if missing
rayNodeType: head # will be injected if missing, must be head or wroker
groupName: headgroup # will be injected if missing
# annotations for pod
Expand Down
2 changes: 1 addition & 1 deletion tests/config/ray-service-serve-update.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
labels:
# custom labels. NOTE: do not define custom labels start with `raycluster.`, they may be used in controller.
# Refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
rayCluster: raycluster-sample # will be injected if missing
rayCluster: raycluster-compatibility-test # will be injected if missing
rayNodeType: head # will be injected if missing, must be head or wroker
groupName: headgroup # will be injected if missing
# annotations for pod
Expand Down
2 changes: 1 addition & 1 deletion tests/config/ray-service.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
labels:
# custom labels. NOTE: do not define custom labels start with `raycluster.`, they may be used in controller.
# Refer to https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
rayCluster: raycluster-sample # will be injected if missing
rayCluster: raycluster-compatibility-test # will be injected if missing
rayNodeType: head # will be injected if missing, must be head or wroker
groupName: headgroup # will be injected if missing
# annotations for pod
Expand Down
4 changes: 4 additions & 0 deletions tests/config/raycluster-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ spec:
port: 52365
targetPort: 52365
nodePort: 32365
- name: rayservice
port: 8000
targetPort: 8000
nodePort: 30800