Skip to content

Commit

Permalink
feat(contrib): add initial ray support
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Aug 19, 2024
1 parent d9ce8cf commit ae9c051
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 0 deletions.
58 changes: 58 additions & 0 deletions templates/contrib/ray-cluster/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# Copyright (c) 2024 Ho Kim ([email protected]). All rights reserved.
# Use of this source code is governed by a GPL-3-style license that can be
# found in the LICENSE file.

# Prehibit errors
set -e -o pipefail
# Verbose
set -x

###########################################################
# Configuration #
###########################################################

# Configure default environment variables
HELM_CHART_DEFAULT="https://ray-project.github.io/kuberay-helm/"
NAMESPACE_DEFAULT="ai"

# Set environment variables
HELM_CHART="${HELM_CHART:-$HELM_CHART_DEFAULT}"
NAMESPACE="${NAMESPACE:-$NAMESPACE_DEFAULT}"

###########################################################
# Configure Helm Channel #
###########################################################

echo "- Configuring Helm channel ... "

helm repo add "${NAMESPACE}-kuberay" "${HELM_CHART}"

###########################################################
# Checking if Operator is already installed #
###########################################################

echo "- Checking Operator is already installed ... "
if
kubectl get namespace --no-headers "${NAMESPACE}" \
>/dev/null 2>/dev/null
then
IS_FIRST=0
else
IS_FIRST=1
fi

###########################################################
# Install KubeRay Cluster #
###########################################################

echo "- Installing KubeRay Cluster ... "

helm upgrade --install "ray-cluster" \
"${NAMESPACE}-kuberay/ray-cluster" \
--create-namespace \
--namespace "${NAMESPACE}" \
--values "./values-cluster.yaml"

# Finished!
echo "Installed!"
8 changes: 8 additions & 0 deletions templates/contrib/ray-cluster/values-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
head:
headService:
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
ark.ulagbulag.io/is-external: "true"
58 changes: 58 additions & 0 deletions templates/contrib/ray/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# Copyright (c) 2024 Ho Kim ([email protected]). All rights reserved.
# Use of this source code is governed by a GPL-3-style license that can be
# found in the LICENSE file.

# Prehibit errors
set -e -o pipefail
# Verbose
set -x

###########################################################
# Configuration #
###########################################################

# Configure default environment variables
HELM_CHART_DEFAULT="https://ray-project.github.io/kuberay-helm/"
NAMESPACE_DEFAULT="kuberay-operator"

# Set environment variables
HELM_CHART="${HELM_CHART:-$HELM_CHART_DEFAULT}"
NAMESPACE="${NAMESPACE:-$NAMESPACE_DEFAULT}"

###########################################################
# Configure Helm Channel #
###########################################################

echo "- Configuring Helm channel ... "

helm repo add "${NAMESPACE}" "${HELM_CHART}"

###########################################################
# Checking if Operator is already installed #
###########################################################

echo "- Checking Operator is already installed ... "
if
kubectl get namespace --no-headers "${NAMESPACE}" \
>/dev/null 2>/dev/null
then
IS_FIRST=0
else
IS_FIRST=1
fi

###########################################################
# Install Operator #
###########################################################

echo "- Installing Operator ... "

helm upgrade --install "kuberay-operator" \
"${NAMESPACE}/kuberay-operator" \
--create-namespace \
--namespace "${NAMESPACE}" \
--values "./values-operator.yaml"

# Finished!
echo "Installed!"
6 changes: 6 additions & 0 deletions templates/contrib/ray/values-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
env:
# If not set or set to "", kuberay will pick up the default k8s cluster domain `cluster.local`
# Otherwise, kuberay will use your custom domain
- name: CLUSTER_DOMAIN
value: ops.openark

0 comments on commit ae9c051

Please sign in to comment.