2019-12-06 14:45:03 +08:00
|
|
|
apiVersion: ray.io/v1alpha1
|
|
|
|
kind: RayCluster
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
controller-tools.k8s.io: "1.0"
|
|
|
|
# An unique identifier for the head node and workers of this cluster.
|
|
|
|
name: raycluster-sample
|
|
|
|
spec:
|
|
|
|
# An unique identifier for the head node and workers of this cluster.
|
|
|
|
clusterName: raycluster-sample
|
|
|
|
images:
|
2020-03-05 10:57:56 -08:00
|
|
|
defaultImage: rayproject/autoscaler
|
2019-12-06 14:45:03 +08:00
|
|
|
imagePullPolicy: "Always"
|
|
|
|
|
|
|
|
extensions:
|
|
|
|
# the pod replicas in this group typed worker
|
|
|
|
- replicas: 1
|
|
|
|
# logical group name, for this called small-group, also can be functional
|
|
|
|
groupName: small-group
|
|
|
|
# pod type
|
|
|
|
type: worker
|
|
|
|
|
|
|
|
# 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/
|
|
|
|
labels:
|
|
|
|
raycluster.group.name: small-group
|
|
|
|
|
|
|
|
# Command to start ray
|
2020-03-09 11:23:46 -07:00
|
|
|
command: ray start --block --node-ip-address=$MY_POD_IP --address=$RAYCLUSTER_SAMPLE_SERVICE_HOST:$RAYCLUSTER_SAMPLE_SERVICE_PORT_REDIS --object-manager-port=12345 --node-manager-port=12346 --object-store-memory=100000000 --num-cpus=1
|
2019-12-06 14:45:03 +08:00
|
|
|
|
|
|
|
# resource requirements
|
|
|
|
# Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: 1000m
|
|
|
|
memory: 2Gi
|
|
|
|
ephemeral-storage: 2Gi
|
|
|
|
requests:
|
|
|
|
cpu: 1000m
|
|
|
|
memory: 2Gi
|
|
|
|
ephemeral-storage: 2Gi
|
|
|
|
|
|
|
|
# environment variables to set in the container.Optional
|
|
|
|
# Refer to https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
|
|
|
|
containerEnv:
|
|
|
|
- name: CLUSTER_NAME
|
|
|
|
value: raycluster-sample
|
|
|
|
- name: MY_POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: MY_POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
|
|
|
|
# head service suffix: {namespace}.svc , follows Kubernetes standard
|
|
|
|
headServiceSuffix: "ray-operator.svc"
|
|
|
|
|
|
|
|
# the pod replicas in this group typed worker
|
|
|
|
- replicas: 1
|
|
|
|
# logical group name, for this called medium-group, also can be functional
|
|
|
|
groupName: medium-group
|
|
|
|
# pod type
|
|
|
|
type: worker
|
|
|
|
|
|
|
|
# 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/
|
|
|
|
labels:
|
|
|
|
raycluster.group.name: medium-group
|
|
|
|
|
|
|
|
# Command to start ray
|
2020-03-09 11:23:46 -07:00
|
|
|
command: ray start --block --node-ip-address=$MY_POD_IP --address=$RAYCLUSTER_SAMPLE_SERVICE_HOST:$RAYCLUSTER_SAMPLE_SERVICE_PORT_REDIS --object-manager-port=12345 --node-manager-port=12346 --object-store-memory=100000000 --num-cpus=1
|
2019-12-06 14:45:03 +08:00
|
|
|
|
|
|
|
# resource requirements
|
|
|
|
# Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: 2000m
|
|
|
|
memory: 4Gi
|
|
|
|
ephemeral-storage: 4Gi
|
|
|
|
requests:
|
|
|
|
cpu: 2000m
|
|
|
|
memory: 4Gi
|
|
|
|
ephemeral-storage: 4Gi
|
|
|
|
|
|
|
|
# environment variables to set in the container.Optional
|
|
|
|
# Refer to https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
|
|
|
|
containerEnv:
|
|
|
|
- name: CLUSTER_NAME
|
|
|
|
value: raycluster-sample
|
|
|
|
- name: MY_POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: MY_POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
|
|
|
|
# head service suffix: {namespace}.svc , follows Kubernetes standard
|
|
|
|
headServiceSuffix: "ray-operator.svc"
|
|
|
|
|
|
|
|
# the pod replicas in this group typed head
|
|
|
|
- replicas: 1
|
|
|
|
# logical group name, also can be functional
|
|
|
|
groupName: head-group
|
|
|
|
# pod type
|
|
|
|
type: head
|
|
|
|
|
|
|
|
# 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/
|
|
|
|
labels:
|
|
|
|
raycluster.group.name: head-group
|
|
|
|
|
|
|
|
# Command to start ray
|
2020-03-09 11:23:46 -07:00
|
|
|
command: ray start --head --block --redis-port=6379 --node-ip-address=$MY_POD_IP --object-manager-port=12345 --node-manager-port=12346 --object-store-memory=100000000 --num-cpus=1
|
2019-12-06 14:45:03 +08:00
|
|
|
|
|
|
|
# resource requirements
|
|
|
|
# Refer to https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: 2000m
|
|
|
|
memory: 4Gi
|
|
|
|
ephemeral-storage: 4Gi
|
|
|
|
requests:
|
|
|
|
cpu: 2000m
|
|
|
|
memory: 4Gi
|
|
|
|
ephemeral-storage: 4Gi
|
|
|
|
|
|
|
|
# environment variables to set in the container.Optional
|
|
|
|
# Refer to https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
|
|
|
|
containerEnv:
|
|
|
|
- name: CLUSTER_NAME
|
|
|
|
value: raycluster-sample
|
|
|
|
- name: MY_POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: MY_POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
|
|
|
|
# head service suffix: {namespace}.svc , follows Kubernetes standard
|
|
|
|
headServiceSuffix: "ray-operator.svc"
|