Assuming an AKS cluster already setup and registered in kubectl.
- Install KubeRay Operator
- Deploy a Ray cluster
kubectl apply -f deployment/dev/ray-cluster.yml
-
Port forward the managemend port of the cluster from one bash shell
kubectl port-forward service/graph-raycluster-autoscaler-dev-head-svc 10001:10001
-
Port forward the 8000 port from the cluster head pod from another bash shell
Get name of pod for the cluster head service:
kubectl get pods
Example output:
NAME READY STATUS RESTARTS AGE graph-raycluster-autoscaler-dev-head-m9rdn 2/2 Running 0 45s kuberay-operator-7fb4677468-gdvc7 1/1 Running 0 25h raph-raycluster-autoscaler-dev-worker-small-group-qzsxk 1/1 Running 0 45s
Setup port forwarding on the head pod:
kubectl port-forward pod/graph-raycluster-autoscaler-dev-head-m9rdn 8000:8000
-
Every time you change your code and want to test it, just deploy it directly into the cluster. Run this from the code folder:
If your code is running already in a terminal, Ctrl+C to kill it, then deploy:
See runtime-env.yml for the definition of the code location, ENV variables and pip packages dependencies. From the 'service' folder, in a bash shell:
serve run --address=ray://127.0.0.1:10001 --runtime-env=../deployment/dev/runtime-env.yml graph:deployment_graph
-
Test the Ray Serve deployments using a test client (or PostMan or curl)
From the root folder, in a different bash shell:
python test/graph_client.py
-
When done or need to deploy a change, Ctrl+C into the terminal running the 'serve run' command.
-
Zip up the 'service' folder as service.zip and place it into deployment/prod folder
-
Deploy the Ray Serve service
From the root folder of this project:
kubectl apply -f deployment/prod/ray-service.yml