Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .buildkite/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,23 @@
- echo "KUBERAY_TEST_OUTPUT_DIR=$$KUBERAY_TEST_OUTPUT_DIR"
- KUBERAY_TEST_TIMEOUT_SHORT=1m KUBERAY_TEST_TIMEOUT_MEDIUM=5m KUBERAY_TEST_TIMEOUT_LONG=10m go test -timeout 30m -v ./test/e2erayjobsubmitter 2>&1 | awk -f ../.buildkite/format.awk | tee $$KUBERAY_TEST_OUTPUT_DIR/gotest.log || (kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay | tee $$KUBERAY_TEST_OUTPUT_DIR/kuberay-operator.log && cd $$KUBERAY_TEST_OUTPUT_DIR && find . -name "*.log" | tar -cf /artifact-mount/e2e-log.tar -T - && exit 1)
- echo "--- END:RayJob Light Weight Submitter E2E (nightly operator) tests finished"

- label: 'Test RayCronJob E2E (nightly operator)'
instance_size: large
image: golang:1.25-bookworm
commands:
- source .buildkite/setup-env.sh
- kind create cluster --wait 900s --config ./ci/kind-config-buildkite.yml
- kubectl config set clusters.kind-kind.server https://docker:6443
# Build nightly KubeRay operator image
- pushd ray-operator
- bash ../.buildkite/build-start-operator.sh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using bash instead of source loses exported variables

Medium Severity

Line 173 uses bash ../.buildkite/build-start-operator.sh while all other tests in this file consistently use source ../.buildkite/build-start-operator.sh. The build-start-operator.sh script exports KUBERAY_TEST_RAY_IMAGE when IS_FROM_RAY_RELEASE_AUTOMATION=1. Using bash instead of source runs the script in a subshell, causing the exported variable to be unavailable to subsequent commands. This breaks the Ray release automation flow.

Fix in Cursor Fix in Web

- kubectl wait --timeout=90s --for=condition=Available=true deployment kuberay-operator
# Run e2e tests and print KubeRay operator logs if tests fail
- echo "--- START:Running e2e (nightly operator) RayCronJob tests"
- if [ -n "${KUBERAY_TEST_RAY_IMAGE}"]; then echo "Using Ray Image ${KUBERAY_TEST_RAY_IMAGE}"; fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell syntax error with missing space before bracket

High Severity

The shell command on line 177 has a bash syntax error: missing space before ] in the test condition. The line reads "${KUBERAY_TEST_RAY_IMAGE}"] but bash's [ command requires a space before the closing ]. Additionally, the variable reference uses ${...} instead of $${...} which is the Buildkite YAML escaping pattern used consistently in all other test definitions (e.g., lines 14, 34, 54, 74, 94).

Fix in Cursor Fix in Web

- set -o pipefail
- mkdir -p "$(pwd)/tmp" && export KUBERAY_TEST_OUTPUT_DIR=$(pwd)/tmp
- echo "KUBERAY_TEST_OUTPUT_DIR=$$KUBERAY_TEST_OUTPUT_DIR"
- KUBERAY_TEST_TIMEOUT_SHORT=1m KUBERAY_TEST_TIMEOUT_MEDIUM=5m KUBERAY_TEST_TIMEOUT_LONG=10m go test -timeout 40m -v ./test/e2eraycronjob 2>&1 | awk -f ../.buildkite/format.awk | tee $$KUBERAY_TEST_OUTPUT_DIR/gotest.log || (kubectl logs --tail -1 -l app.kubernetes.io/name=kuberay | tee $$KUBERAY_TEST_OUTPUT_DIR/kuberay-operator.log && cd $$KUBERAY_TEST_OUTPUT_DIR && find . -name "*.log" | tar -cf /artifact-mount/e2e-raycronjob-log.tar -T - && exit 1)
- echo "--- END:RayCronJob E2E (nightly operator) tests finished"
2 changes: 2 additions & 0 deletions .buildkite/values-kuberay-operator-override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ featureGates:
enabled: true
- name: RayMultiHostIndexing
enabled: true
- name: RayCronJob
enabled: true
2 changes: 2 additions & 0 deletions helm-chart/kuberay-operator/crds/ray.io_raycronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
spec:
group: ray.io
names:
categories:
- all
kind: RayCronJob
listKind: RayCronJobList
plural: raycronjobs
Expand Down
4 changes: 4 additions & 0 deletions ray-operator/apis/ray/v1/raycronjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ type RayCronJobStatus struct {
//+kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp",priority=0
//+kubebuilder:printcolumn:name="suspend",type=boolean,JSONPath=".spec.suspend",priority=0

// +genclient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!
Maybe we can also add the following annotations as well:

// +kubebuilder:storageversion
// +kubebuilder:resource:categories=all

Copy link
Collaborator

@win5923 win5923 Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • // +kubebuilder:storageversion: marker to indicate the GVK that should be used to store data by the API server.
  • // +kubebuilder:resource:categories=all: Puts the CRD into the all category, so it shows up in kubectl get all.

Ref:
https://book.kubebuilder.io/reference/markers/crd
https://book.kubebuilder.io/reference/generating-crd#multiple-versions

Cool!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion~

// +kubebuilder:resource:categories=all
// +kubebuilder:storageversion
//
//nolint:govet // RayCronJob is the Schema for the raycronjobs API
type RayCronJob struct {
metav1.TypeMeta `json:",inline"`
Expand Down
2 changes: 2 additions & 0 deletions ray-operator/config/crd/bases/ray.io_raycronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
spec:
group: ray.io
names:
categories:
- all
kind: RayCronJob
listKind: RayCronJobList
plural: raycronjobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
containers:
- name: kuberay-operator
args:
- --feature-gates=RayClusterStatusConditions=true,RayJobDeletionPolicy=true,RayMultiHostIndexing=true
- --feature-gates=RayClusterStatusConditions=true,RayJobDeletionPolicy=true,RayMultiHostIndexing=true,RayCronJob=true
227 changes: 227 additions & 0 deletions ray-operator/pkg/client/applyconfiguration/ray/v1/raycronjob.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ray-operator/pkg/client/applyconfiguration/utils.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading