Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Distributed Ray Job on Kubernetes

This project demonstrates how to run a distributed Python task using the Ray framework on a Kubernetes cluster. It uses a Helm chart to deploy a Ray Head node, Worker nodes, and a Job submitter.

Project Structure

  • app/: Contains the Python application code (main.py) which calculates Pi using the Monte Carlo method.
  • chart/: A Helm chart to deploy the Ray cluster and the job.
  • Dockerfile: Defines the container image for the application.

Prerequisites

  • Docker
  • Kubernetes Cluster (Minikube, Kind, or Cloud Provider)
  • kubectl
  • helm

Deployment Instructions

One Shot Handling

Build docker image, and push to ACR

./push_img.sh <tag>

Deploy chart

./deploy_chart.sh <tag> [--local]

Cloud Kubernetes

For cloud clusters, push the image to a container registry.

# Replace with your registry
docker build -t <your-registry>/ray-distributed-job:latest .
docker push <your-registry>/ray-distributed-job:latest

2. Install with Helm

Local Deployment

RELEASE_NAME=ray-distributed-job
helm install $RELEASE_NAME ./chart \
  --set image.repository=ray-distributed-job \
  --set image.tag=latest \
  --set image.pullPolicy=IfNotPresent

Cloud Deployment

RELEASE_NAME=ray-distributed-job
helm install $RELEASE_NAME ./chart \
  --set image.repository=<your-registry>/ray-distributed-job \
  --set image.tag=latest \
  --set image.pullPolicy=Always

Verifying the Job

  1. Check Pods: Ensure the head, workers, and submitter pods are running.

    Expected output:

    Connecting to Ray at ...
    Starting Monte Carlo Pi estimation ...
    Estimated Pi: 3.14159...

Cleanup

To remove the deployment:

helm uninstall $RELEASE_NAME

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages