-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for ephemeral volumes and ingress creation support #1312
Closed
blublinsky
wants to merge
58
commits into
ray-project:master
from
blublinsky:api_server_volumes_ingress
Closed
Changes from 16 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
8bc85a9
Added support for ephemeral volumes and ingress creation support
blublinsky 949b927
Fixed formatting
blublinsky 2170b96
Downgrade `kind` from to `v0.20.0` to `v0.11.1` (#1313)
architkulkarni 44c0cec
Do not update pod labels if they haven't changed (#1304)
JoshKarpel c3a0285
[CI] Run sample job YAML tests in buildkite (#1315)
architkulkarni 9bd1a50
Api server makefile (#1301)
z103cb c8045cc
Upgrade to Go 1.19 (#1325)
kevin85421 55341f8
Fix release actions (#1323)
anishasthana 3b0e26a
Added support for ephemeral volumes and ingress creation support
blublinsky c667e89
Fixed formatting
blublinsky ff17794
Fixed formatting
blublinsky 16d72cb
[Benchmark] KubeRay memory / scalability benchmark (#1324)
kevin85421 b1420ca
Added support for ephemeral volumes and ingress creation support
blublinsky ba8bb56
rebased to current
blublinsky 262b3f4
restoring PB numbers
blublinsky c19fde0
Merge branch 'master' into api_server_volumes_ingress
blublinsky 06ccd09
Bump the golangci-lint version in the api server makefile (#1342)
z103cb 1cbac51
Documentation and example for running simple NLP service on kuberay (…
gvspraveen 8be0a21
Removed use of the of BUILD_FLAGS in apiserver makefile (#1336)
z103cb e79e0b9
[GCS FT][Refactor] Redefine the behavior for deleting Pods and stop l…
kevin85421 d6e4a59
Added support for ephemeral volumes and ingress creation support
blublinsky c2a5efc
minor fixes
blublinsky 81b4187
minor fixes
blublinsky 405fddb
minor fixes
blublinsky 5de4a42
[RayJob] Add runtime env YAML field (#1338)
architkulkarni 3a7a17f
Delete ray_v1alpha1_rayjob.batch-inference.yaml (#1360)
architkulkarni de8bc26
[Feature] Allow RayCluster Helm chart to specify different images for…
Darren221 106490e
Bump the golangci-lint version in the api server makefile (#1342)
z103cb 0d3d696
Documentation and example for running simple NLP service on kuberay (…
gvspraveen 1e93a67
Removed use of the of BUILD_FLAGS in apiserver makefile (#1336)
z103cb 40fe9d4
[GCS FT][Refactor] Redefine the behavior for deleting Pods and stop l…
kevin85421 ed370ba
[RayJob] Add runtime env YAML field (#1338)
architkulkarni 6613d21
Delete ray_v1alpha1_rayjob.batch-inference.yaml (#1360)
architkulkarni 4438d40
[Feature] Allow RayCluster Helm chart to specify different images for…
Darren221 140e595
Added support for ephemeral volumes and ingress creation support
blublinsky 5d8c341
Fixed error handling
blublinsky b512c40
Fixed error handling
blublinsky 1a2674d
Fixed error handling
blublinsky 34b5135
Fixed error handling
blublinsky e208f06
Added support for ephemeral volumes and ingress creation support
blublinsky 1348800
Fixed formatting
blublinsky c933c37
Added support for ephemeral volumes and ingress creation support
blublinsky c6dc652
Fixed formatting
blublinsky 522ac3e
Fixed formatting
blublinsky e42042d
Added support for ephemeral volumes and ingress creation support
blublinsky 6557b59
rebased to current
blublinsky 06b2992
restoring PB numbers
blublinsky cd4690d
Added support for ephemeral volumes and ingress creation support
blublinsky c6195bd
minor fixes
blublinsky 402f252
minor fixes
blublinsky e0910fc
minor fixes
blublinsky bda0809
Added support for ephemeral volumes and ingress creation support
blublinsky 52bac98
Fixed error handling
blublinsky 300844e
Fixed error handling
blublinsky 8434ea9
Fixed error handling
blublinsky 806d66d
Fixed error handling
blublinsky ca1d7a3
Fixed error handling
blublinsky e0aecb2
Merge remote-tracking branch 'origin/api_server_volumes_ingress' into…
blublinsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
- label: Test RayJob Sample YAMLs | ||
instance_size: large | ||
image: golang:1.19 | ||
commands: | ||
# Install Go | ||
- export PATH=$PATH:/usr/local/go/bin | ||
|
||
# Install kind | ||
- curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 | ||
- chmod +x ./kind | ||
- mv ./kind /usr/local/bin/kind | ||
|
||
# Install Docker | ||
- bash scripts/install-docker.sh | ||
|
||
# Delete dangling clusters | ||
- kind delete clusters --all | ||
|
||
# Install kubectl. | ||
- curl -LO https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl | ||
- curl -LO "https://dl.k8s.io/release/v1.27.3/bin/linux/amd64/kubectl.sha256" | ||
- echo "$(cat kubectl.sha256) kubectl" | sha256sum --check | ||
- install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | ||
|
||
# Create the cluster | ||
- time kind create cluster --wait 120s --config tests/framework/config/kind-config-buildkite.yml | ||
- docker ps | ||
|
||
# Now the kind node is running, it exposes port 6443 in the dind-daemon network. | ||
- kubectl config set clusters.kind-kind.server https://docker:6443 | ||
|
||
# Verify that kubectl works | ||
- kubectl version | ||
- kubectl cluster-info | ||
- kubectl get nodes | ||
- kubectl get pods --all-namespaces | ||
|
||
# Install Helm | ||
- curl -Lo helm.tar.gz https://get.helm.sh/helm-v3.12.2-linux-amd64.tar.gz | ||
- tar -zxvf helm.tar.gz | ||
- mv linux-amd64/helm /usr/local/bin/helm | ||
- helm repo add kuberay https://ray-project.github.io/kuberay-helm/ | ||
- helm repo update | ||
|
||
# Install KubeRay operator | ||
- pushd ray-operator | ||
- IMG=kuberay/operator:nightly make docker-image | ||
- kind load docker-image kuberay/operator:nightly | ||
- popd | ||
|
||
- pushd helm-chart/kuberay-operator | ||
# Use helm --wait instead of kubectl wait to prevent flakiness. See #618 | ||
- helm install kuberay-operator --set image.repository=kuberay/operator --set image.tag=nightly --wait --timeout=5m0s . | ||
- popd | ||
|
||
- echo "Kuberay operator successfully installed." | ||
|
||
# Delete kind clusters | ||
- kind delete clusters --all | ||
|
||
# Install python 3.10 and pip | ||
- apt-get update | ||
- apt-get install -y python3.11 python3.11-venv | ||
- python3 -m venv .venv | ||
- source .venv/bin/activate | ||
|
||
# Install requirements | ||
- pip install -r tests/framework/config/requirements.txt | ||
|
||
# Run test | ||
- BUILDKITE_ENV=true python3 tests/test_sample_rayjob_yamls.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package model | ||
|
||
import ( | ||
api "github.com/ray-project/kuberay/proto/go_client" | ||
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
func PopulateVolumes(podTemplate *v1.PodTemplateSpec) []*api.Volume { | ||
if len(podTemplate.Spec.Volumes) == 0 { | ||
return nil | ||
} | ||
var volumes []*api.Volume | ||
for _, vol := range podTemplate.Spec.Volumes { | ||
mount := GetVolumeMount(podTemplate, vol.Name) | ||
if vol.VolumeSource.HostPath != nil { | ||
// Host Path | ||
volumes = append(volumes, &api.Volume{ | ||
Name: vol.Name, | ||
MountPath: mount.MountPath, | ||
Source: vol.VolumeSource.HostPath.Path, | ||
MountPropagationMode: GetVolumeMountPropagation(mount), | ||
VolumeType: api.Volume_VolumeType(api.Volume_HOSTTOCONTAINER), | ||
HostPathType: GetVolumeHostPathType(&vol), | ||
}) | ||
continue | ||
|
||
} | ||
if vol.VolumeSource.PersistentVolumeClaim != nil { | ||
// PVC | ||
volumes = append(volumes, &api.Volume{ | ||
Name: vol.Name, | ||
MountPath: mount.MountPath, | ||
MountPropagationMode: GetVolumeMountPropagation(mount), | ||
VolumeType: api.Volume_PERSISTENT_VOLUME_CLAIM, | ||
ReadOnly: vol.VolumeSource.PersistentVolumeClaim.ReadOnly, | ||
}) | ||
continue | ||
} | ||
if vol.VolumeSource.Ephemeral != nil { | ||
// Ephimeral | ||
request := vol.VolumeSource.Ephemeral.VolumeClaimTemplate.Spec.Resources.Requests[v1.ResourceStorage] | ||
volume := api.Volume{ | ||
Name: vol.Name, | ||
MountPath: mount.MountPath, | ||
MountPropagationMode: GetVolumeMountPropagation(mount), | ||
VolumeType: api.Volume_EPHEMERAL, | ||
AccessMode: GetAccessMode(&vol), | ||
Storage: request.String(), | ||
} | ||
if vol.VolumeSource.Ephemeral.VolumeClaimTemplate.Spec.StorageClassName != nil { | ||
volume.StorageClassName = *vol.VolumeSource.Ephemeral.VolumeClaimTemplate.Spec.StorageClassName | ||
} | ||
volumes = append(volumes, &volume) | ||
continue | ||
} | ||
} | ||
return volumes | ||
} | ||
|
||
func GetVolumeMount(podTemplate *v1.PodTemplateSpec, vol string) *v1.VolumeMount { | ||
for _, container := range podTemplate.Spec.Containers { | ||
for _, mount := range container.VolumeMounts { | ||
if mount.Name == vol { | ||
return &mount | ||
} | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
func GetVolumeMountPropagation(mount *v1.VolumeMount) api.Volume_MountPropagationMode { | ||
if mount.MountPropagation == nil { | ||
return api.Volume_NONE | ||
} | ||
if *mount.MountPropagation == v1.MountPropagationHostToContainer { | ||
return api.Volume_HOSTTOCONTAINER | ||
} | ||
if *mount.MountPropagation == v1.MountPropagationBidirectional { | ||
return api.Volume_BIDIRECTIONAL | ||
} | ||
return api.Volume_NONE | ||
} | ||
|
||
func GetVolumeHostPathType(vol *v1.Volume) api.Volume_HostPathType { | ||
if *vol.VolumeSource.HostPath.Type == v1.HostPathFile { | ||
return api.Volume_FILE | ||
} | ||
return api.Volume_DIRECTORY | ||
} | ||
|
||
func GetAccessMode(vol *v1.Volume) api.Volume_AccessMode { | ||
modes := vol.VolumeSource.Ephemeral.VolumeClaimTemplate.Spec.AccessModes | ||
if len(modes) == 0 { | ||
return api.Volume_RWO | ||
} | ||
if modes[0] == v1.ReadOnlyMany { | ||
return api.Volume_ROX | ||
} | ||
if modes[0] == v1.ReadWriteMany { | ||
return api.Volume_RWX | ||
} | ||
return api.Volume_RWO | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If enableIngress is missing, server crashes with
panic: runtime error: invalid memory address or nil pointer dereference
error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think it's better to implement 1 feature per PR. It would be easier to review and merge. For example, here I am testing storage but encountered enabledIngress error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, sorry, was in a rush