Skip to content

Commit

Permalink
add new 8000 port forwarding in kind
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonwang371 committed Jul 28, 2022
1 parent a1c2be9 commit 5d80e02
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
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

0 comments on commit 5d80e02

Please sign in to comment.