Skip to content

Commit a5adbbe

Browse files
andrewsykimrueiankevin85421davidxiaMortalHappiness
authored
Sync release-1.3 with master (#2983)
* [RayService] More envtests that follow the most common scenario in the RayService code path (#2880) Signed-off-by: Rueian <[email protected]> * [RayService] Remove outdated env tests (#2886) Signed-off-by: kaihsun <[email protected]> * [RayService] Refactor envtests (#2888) * [docs][ray-operator] fix typo in Golang version (#2893) Project uses Golang 1.22 not 1.20. Signed-off-by: David Xia <[email protected]> * [Fix][kubectl-plugin] Fix no context nil error SIGSEGV in tests (#2892) Signed-off-by: Chi-Sheng Liu <[email protected]> * [CI] Enable testifylint rule (#2896) Signed-off-by: Chi-Sheng Liu <[email protected]> * [CI] Enable `testifylint` `error-nil` rule (#2907) * [kubectl-plugin][feat] support specifying number of head GPUs (#2895) when creating a RayCluster with `kubectl ray create cluster NAME --head-gpu N`. Similar to the `--worker-gpu` switch. Signed-off-by: David Xia <[email protected]> * Use webhook.CustomValidator instead of deprecated webhook.Validator. (#2803) * Use webhook.CustomValidator instead of deprecated webhook.Validator. * Move RayClusterWebhook to pkg/webhook/v1. * [kubectl-plugin] update context error messages (#2891) to tell user they can use `--context` to set the K8s context. Add tests Signed-off-by: David Xia <[email protected]> Co-authored-by: Chi-Sheng Liu <[email protected]> * [Fix][kubectl-plugin] make tests use a temporary kube config (#2894) file that's not at the default path. Right now tests fail if there's a K8s current context set with a command like `kubectl config use-context my-context`. This change allows tests to pass regardless of current context. Signed-off-by: David Xia <[email protected]> * [CI] Enable testifylint formatter rule (#2915) Signed-off-by: 400Ping <[email protected]> * [CI] Enable `testifylint` `empty` rule (#2908) * [CI] Enable testifylint bool-compare rule (#2911) Signed-off-by: 400Ping <[email protected]> * [CI] Auto download golang tools in pre-commit (#2917) Signed-off-by: Chi-Sheng Liu <[email protected]> * [RayService] a safeguard for preventing overriding the pending cluster during a upgrade (#2887) Signed-off-by: Rueian <[email protected]> * [RayService] Refactor unit tests for ShouldPrepareNewCluster (#2928) Signed-off-by: kaihsun <[email protected]> * [chore][kubectl-plugin] use consistent capitalization (#2922) in comments and console messages. * capitalize "Ray" when used as a proper noun * capitalize Ray K8s CRDs like "RayJob" and "RayCluster" * capitalize acronyms like "YAML" * fix some minor typos No functional changes. Signed-off-by: David Xia <[email protected]> * [CI] Enable `testifylint` `require-error` rule (#2909) * [kubectl-plugin] support general `kubectl` switches like `--context` (#2883) * [CI] Fix lint error (require-error) (#2931) Signed-off-by: Chi-Sheng Liu <[email protected]> * [CI] Enable `testifylint` `float-compare` rule (#2910) * [docs] move pre-commit instructions to main dev docs (#2921) * [CI] Enable `testifylint` `expected-actual` rule (#2914) * [CI] Generate CRD json schema separately in pre-commit (#2930) * [release][1/N] Update YAMLs from Ray 2.9 to Ray 2.41 (#2934) * Delete `[raycluster|rayjob|rayservice]_types_test.go` unnecessary tests (#2935) * [release][2/N] Update RayCluster Helm chart from Ray 2.9 to Ray 2.41 (#2936) Signed-off-by: kaihsun <[email protected]> * [release][3/N] Update RayService e2e tests YAML files from Ray 2.9 to Ray 2.41 (#2937) * [release][4/N] Update Ray images / versions in kubectl plugin (#2938) Signed-off-by: kaihsun <[email protected]> * [release][5/N] Update some RayJob YAMLs from Ray 2.9 to Ray 2.41 (#2941) Signed-off-by: kaihsun <[email protected]> * [release][6/N] Remove unnecessary YAMLs (#2946) Signed-off-by: kaihsun <[email protected]> * [docs][kubectl-plugin] add dev docs (#2912) Signed-off-by: David Xia <[email protected]> Co-authored-by: Chi-Sheng Liu <[email protected]> * [CI] Add shellcheck and fix error of it (#2933) * [chore][kubectl-plugin] use better test assertions (#2955) Fix two places. * use `assert.EqualError()` instead of `assert.Error()` to check the error string is what we expect * use testify assertion instead of string checking for better error output Signed-off-by: David Xia <[email protected]> * [chore] add Markdown linting pre-commit hook (#2953) Ignore most rules we violate for now. Fix these two violations. ``` pre-commit run markdownlint --all-files --show-diff-on-failure ... clients/python-client/README.md:106 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h3; Actual: h4] CHANGELOG.md:420:1 MD030/list-marker-space Spaces after list markers [Expected: 1; Actual: 2] ``` Signed-off-by: David Xia <[email protected]> * [chore][kubectl-plugin] use consistent capitalization (#2950) in comments and console messages. capitalize "Ray" when used as a proper noun. Similar to #2922. Signed-off-by: David Xia <[email protected]> * [Fix][RayJob] Invalid quote for RayJob submitter (#2949) Closes: #2943 Signed-off-by: Chi-Sheng Liu <[email protected]> * [release][7/N] Update RayService YAMLs (#2956) * [CI] Enable testifylint len rule (#2945) Signed-off-by: LeoLiao123 <[email protected]> * [docs][kubectl-plugin] improve help messages (#2952) Signed-off-by: David Xia <[email protected]> * [kubectl-plugin] Fix panic when GPU resource is not set (#2954) Signed-off-by: win5923 <[email protected]> * [release][8/N] Upgrade Stable Diffusion RayService to Ray 2.41 (#2960) * [docs][kubectl-plugin] fix incorrect example commands (#2951) Signed-off-by: David Xia <[email protected]> Co-authored-by: Chi-Sheng Liu <[email protected]> * [fix][kubectl-plugin] set worker group CPU limit (#2958) when creating a new worker group with `kubectl ray create workergroup`. Write a unit test. I noticed we are setting resource limits equal to resource requests everywhere else but in this command. I have a K8s [LimitRange] that prevented the creation of these worker Pods that had CPU limit defaulting to less than their CPU requests. Describing the RayCluster showed this warning event. `Failed to create worker Pod hyperkube/, Pod "dxia-test-other-group-worker-pm2sh" is invalid: spec.containers[0].resources.requests: Invalid value: "2": must be less than or equal to cpu limit of 250m` Signed-off-by: David Xia <[email protected]> [LimitRange]: https://kubernetes.io/docs/concepts/policy/limit-range/ * [RayJob] Deflaky RayJob e2e tests (#2963) Signed-off-by: kaihsun <[email protected]> * [RayService] Deflaky RayService envtest (#2962) Signed-off-by: kaihsun <[email protected]> * [release][9/N] Update text summarizer RayService to Ray 2.41 (#2961) * [RayService] adapter vllm 0.6.1.post2 (#2823) * adapter vllm 0.6.1.post2 * fix var define * Unify the cpu Settings in serve.py in service.yaml, all set to 1 * Maintain the configuration with vllm0.5x * [Release] Upgrade ray-job.batch-inference.yaml image to 2.41 (#2971) Signed-off-by: Chi-Sheng Liu <[email protected]> * [chore][docs] enable Markdownlint rule MD010 (#2975) * [CI] Change Pre-commit-shellcheck-to-shellcheck-py (#2974) Signed-off-by: owenowenisme <[email protected]> * [release] Update Yunikorn YAML file to Ray 2.41 (#2969) Signed-off-by: Cheng-Yeh Chung <[email protected]> * [release] Update YuniKorn YAML files to Ray 2.41 (#2976) Signed-off-by: win5923 <[email protected]> * [chore][docs] enable Markdownlint rule MD004 (#2973) [Unordered list style][1] [1]: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md004---unordered-list-style * [Test] Use GcsFaultToleranceOptions in test and backward compatibility (#2972) * Update samples to use Ray 2.41.0 images (#2964) Signed-off-by: Andrew Sy Kim <[email protected]> * Update TPU Ray CR manifests to use Ray 2.41.0 (#2965) * [Refactor] Use constants for image tag, image repo, and versions in golang to avoid hard-coded strings (#2978) --------- Signed-off-by: Rueian <[email protected]> Signed-off-by: kaihsun <[email protected]> Signed-off-by: David Xia <[email protected]> Signed-off-by: Chi-Sheng Liu <[email protected]> Signed-off-by: 400Ping <[email protected]> Signed-off-by: LeoLiao123 <[email protected]> Signed-off-by: win5923 <[email protected]> Signed-off-by: owenowenisme <[email protected]> Signed-off-by: Cheng-Yeh Chung <[email protected]> Signed-off-by: Andrew Sy Kim <[email protected]> Co-authored-by: Rueian <[email protected]> Co-authored-by: Kai-Hsun Chen <[email protected]> Co-authored-by: David Xia <[email protected]> Co-authored-by: Chi-Sheng Liu <[email protected]> Co-authored-by: David Xia <[email protected]> Co-authored-by: Mykhailo Bobrovskyi <[email protected]> Co-authored-by: Ping <[email protected]> Co-authored-by: Owen Lin <[email protected]> Co-authored-by: Leo Liao <[email protected]> Co-authored-by: Blocka <[email protected]> Co-authored-by: zrant <[email protected]> Co-authored-by: kenchung285 <[email protected]> Co-authored-by: fscnick <[email protected]> Co-authored-by: ryanaoleary <[email protected]>
1 parent 0dc7968 commit a5adbbe

File tree

147 files changed

+1772
-3460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1772
-3460
lines changed

.buildkite/setup-env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ python3 -m venv .venv
3535
# Activate the virtual environment and then execute the subsequent commands
3636
# within the same sub-shell.
3737
(
38+
# shellcheck disable=SC1091 # Ignore: activate script is created by venv
3839
source .venv/bin/activate
3940

4041
# Install requirements

.github/workflows/test-job.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@ jobs:
1212
name: Lint (pre-commit)
1313
runs-on: ubuntu-22.04
1414
steps:
15-
- name: Install golangci-lint
16-
run: |
17-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.60.3
18-
mv ./bin/golangci-lint /usr/local/bin/golangci-lint
19-
shell: bash
20-
21-
- name: Install kubeconform
22-
run: |
23-
curl -L https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz -o kubeconform.tar.gz
24-
tar -xzf kubeconform.tar.gz
25-
mv kubeconform /usr/local/bin/
26-
2715
- uses: actions/checkout@v3
2816
- uses: actions/setup-python@v3
2917
- uses: pre-commit/[email protected]

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@
5050

5151
# Any file with a .log extension
5252
**/*.log
53+
54+
# Ignore generated CRD schema files
55+
schema/

.golangci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,7 @@ linters-settings:
5858
# TODO: Enable all testifylint rules
5959
testifylint:
6060
disable:
61-
- formatter
62-
- float-compare
63-
- require-error
64-
- expected-actual
65-
- bool-compare
66-
- len
6761
- compares
68-
- empty
6962
linters:
7063
enable:
7164
- asciicheck

.pre-commit-config.yaml

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,48 @@ repos:
2727
hooks:
2828
- id: gitleaks
2929

30-
- repo: local
30+
- repo: https://github.com/shellcheck-py/shellcheck-py
31+
rev: v0.10.0.1
3132
hooks:
32-
- id: check-golangci-lint-version
33-
name: golangci-lint version check
34-
entry: bash -c 'version="1.60.3"; [ "$(golangci-lint --version | awk "/version/ {print \$4}" | sed "s/^v//")" = "$version" ] || { echo "golangci-lint version is not $version"; exit 1; }'
35-
language: system
36-
always_run: true
37-
fail_fast: true
38-
pass_filenames: false
33+
- id: shellcheck
3934

4035
- repo: local
4136
hooks:
42-
- id: golangci-lint-ray-operator
43-
name: golangci-lint (ray-operator)
44-
entry: bash -c 'cd ray-operator && golangci-lint run --fix --exclude-files _generated.go --timeout 10m0s; status=$?; cd ..; exit $status'
37+
- id: golangci-lint
38+
name: golangci-lint
39+
entry: ./scripts/lint.sh
4540
types: [ go ]
4641
language: golang
4742
require_serial: true
48-
files: ^ray-operator/
49-
50-
- repo: local
51-
hooks:
52-
- id: golangci-lint-kubectl-plugin
53-
name: golangci-lint (kubectl-plugin)
54-
entry: bash -c 'cd kubectl-plugin && golangci-lint run --fix --timeout 10m0s; status=$?; cd ..; exit $status'
55-
types: [ go ]
56-
language: golang
43+
always_run: true
44+
pass_filenames: false
45+
additional_dependencies:
46+
- github.com/golangci/golangci-lint/cmd/[email protected]
47+
- id: generate-crd-schema
48+
name: generate CRD schemas for use of kubeconform
49+
entry: ./scripts/generate-crd-schema.sh
50+
language: python
5751
require_serial: true
58-
files: ^kubectl-plugin/
59-
60-
- repo: local
61-
hooks:
62-
- id: check-kubeconform-version
63-
name: kubeconform version check
64-
entry: bash -c 'version="0.6.7"; [ "$(kubeconform -v | awk -F"v" "{print \$2}")" = "$version" ] || { echo "kubeconform version is not $version"; exit 1; }'
65-
language: system
6652
always_run: true
67-
fail_fast: true
6853
pass_filenames: false
69-
70-
- repo: local
71-
hooks:
54+
additional_dependencies:
55+
- PyYAML==6.0.1
7256
- id: validate-helm-charts
7357
name: validate helm charts with kubeconform
7458
entry: bash scripts/validate-helm.sh
75-
language: system
59+
language: golang
60+
require_serial: true
61+
always_run: true
7662
pass_filenames: false
63+
additional_dependencies:
64+
- github.com/yannh/kubeconform/cmd/[email protected]
65+
66+
- repo: https://github.com/igorshubovych/markdownlint-cli
67+
rev: v0.44.0
68+
hooks:
69+
- id: markdownlint
70+
name: Markdown linting
71+
args:
72+
- --config
73+
- ci/markdownlint.yaml
74+
- --fix

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ The following individuals contributed to KubeRay 0.5.0. This list is alphabetica
417417
* [Feature][Hotfix] Add observedGeneration to the status of CRDs ([#979](https://github.com/ray-project/kuberay/pull/979), @kevin85421)
418418
* Customize the Prometheus export port ([#954](https://github.com/ray-project/kuberay/pull/954), @Yicheng-Lu-llll)
419419
* [Feature] The default ImagePullPolicy should be IfNotPresent ([#947](https://github.com/ray-project/kuberay/pull/947), @kevin85421)
420-
* Inject the --block option to ray start command automatically ([#932](https://github.com/ray-project/kuberay/pull/932), @Yicheng-Lu-llll)
420+
* Inject the --block option to ray start command automatically ([#932](https://github.com/ray-project/kuberay/pull/932), @Yicheng-Lu-llll)
421421
* Inject cluster name as an environment variable into head and worker pods ([#934](https://github.com/ray-project/kuberay/pull/934), @Yicheng-Lu-llll)
422422
* Ensure container ports without names are also included in the head node service ([#891](https://github.com/ray-project/kuberay/pull/891), @Yicheng-Lu-llll)
423423
* fix: `.status.availableWorkerReplicas` ([#887](https://github.com/ray-project/kuberay/pull/887), @davidxia)

apiserver/hack/update-swagger-ui.bash

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/bin/bash
22
set -e
33
set -x
4-
readonly REPO_ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/../.. &> /dev/null && pwd)
4+
REPO_ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/../.. &> /dev/null && pwd)
5+
readonly REPO_ROOT_DIR
56
readonly TARGET_DIR="${REPO_ROOT_DIR}/third_party/swagger-ui"
67
readonly SWAGGER_UI_VERSION=${1:-"5.4.1"}
78
readonly SWAGGER_UI_TAR_URL="https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_UI_VERSION}.tar.gz"
89

9-
if [ -f ${TARGET_DIR}/swagger-initializer.js ];then
10-
cp -v ${TARGET_DIR}/swagger-initializer.js ${TARGET_DIR}/swagger-initializer.js.backup
10+
if [ -f "${TARGET_DIR}"/swagger-initializer.js ];then
11+
cp -v "${TARGET_DIR}"/swagger-initializer.js "${TARGET_DIR}"/swagger-initializer.js.backup
1112
fi
1213
echo "Downloading '${SWAGGER_UI_TAR_URL}' to update ${TARGET_DIR}"
1314
tmp="$(mktemp -d)"
1415
#pushd .
15-
curl --output-dir ${tmp} --fail --silent --location --remote-header-name --remote-name ${SWAGGER_UI_TAR_URL}
16-
tar -xzvf ${tmp}/swagger-ui-${SWAGGER_UI_VERSION}.tar.gz -C ${tmp}
16+
curl --output-dir "${tmp}" --fail --silent --location --remote-header-name --remote-name "${SWAGGER_UI_TAR_URL}"
17+
tar -xzvf "${tmp}"/swagger-ui-"${SWAGGER_UI_VERSION}".tar.gz -C "${tmp}"
1718
#popd
1819
cp -rv "$tmp/swagger-ui-${SWAGGER_UI_VERSION}/dist/"* "${TARGET_DIR}"
1920
rm -rf "$tmp"

ci/markdownlint.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Default state for all rules
3+
default: true
4+
5+
MD005: false
6+
MD007: false
7+
MD012: false
8+
MD013: false
9+
MD022: false
10+
MD024: false
11+
MD025: false
12+
MD026: false
13+
MD031: false
14+
MD032: false
15+
MD033: false
16+
MD034: false
17+
MD036: false
18+
MD040: false
19+
MD041: false
20+
MD050: false
21+
MD052: false

clients/python-client/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ make sure you have installed setuptool
103103

104104
`pip install -U pip setuptools`
105105

106-
#### run the pip command
106+
### run the pip command
107107

108108
from the directory `path/to/kuberay/clients/python-client`
109109

110110
`pip install -e .`
111111

112-
#### to uninstall the module run
112+
### to uninstall the module run
113113

114114
`pip uninstall python-client`
115115

docs/development/development.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
This guide provides an overview of the different components in the KubeRay project and instructions for developing and testing each component.
44
Most developers will be concerned with the KubeRay Operator; the other components are optional.
55

6+
## Pre-commit Hooks
7+
8+
We use [pre-commit] to lint and format code before each commit.
9+
10+
1. Install [pre-commit]
11+
1. Run `pre-commit install` to install the pre-commit hooks
12+
613
## KubeRay Operator
714

815
The KubeRay Operator is responsible for managing Ray clusters on Kubernetes.
@@ -14,13 +21,21 @@ The KubeRay APIServer is a central component that exposes the KubeRay API for ma
1421
For more information about developing and testing the KubeRay APIServer, please refer to the [APIServer Development Guide](https://github.com/ray-project/kuberay/blob/master/apiserver/DEVELOPMENT.md).
1522

1623
## KubeRay Python client
24+
1725
The KubeRay Python client library provides APIs to handle RayCluster from your Python application. For more information about developing and testing the KubeRay Python client, please refer to the [Python Client](https://github.com/ray-project/kuberay/blob/master/components/pythonclient.md), [Python API Client](https://github.com/ray-project/kuberay/blob/master/components/pythonapiclient.md).
1826

1927
## Proto and OpenAPI
2028

2129
KubeRay uses Protocol Buffers (protobuf) and OpenAPI specifications to define the API and data structures.
2230
For more information about developing and testing proto files and OpenAPI specifications, please refer to the [Proto and OpenAPI Development Guide](https://github.com/ray-project/kuberay/blob/master/proto/README.md).
2331

32+
## KubeRay Kubectl Plugin (beta)
33+
34+
A [kubectl plugin] that simplifies common workflows when deploying Ray on Kubernetes. If
35+
you aren't familiar with Kubernetes, this plugin simplifies running Ray on Kubernetes.
36+
For more information about developing and testing the KubeRay Kubectl Plugin, please refer to the
37+
[Kubectl Plugin Development Guide].
38+
2439
## Deploying Documentation Locally
2540

2641
To preview the KubeRay documentation locally, follow these steps:
@@ -36,3 +51,7 @@ docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
3651
- Open your web browser and navigate to <http://127.0.0.1:8000/kuberay/> to view the documentation.
3752

3853
If you make any changes to the documentation files, the local preview will automatically update to reflect those changes.
54+
55+
[pre-commit]: https://pre-commit.com/
56+
[kubectl plugin]: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
57+
[Kubectl Plugin Development Guide]: ../../kubectl-plugin/DEVELOPMENT.md

0 commit comments

Comments
 (0)