From 8aec28caa27c033ba4da2297948ee8a9cbc04cbb Mon Sep 17 00:00:00 2001 From: chantu Date: Wed, 8 Nov 2023 18:07:10 +0800 Subject: [PATCH 01/10] use env instead of cv --- addons/llm-cluster/templates/cluster.yaml | 15 ++++++++++++++- addons/llm-cluster/values.schema.json | 16 ++++++++++++++++ addons/llm-cluster/values.yaml | 6 +++++- addons/llm/templates/clusterversion.yaml | 19 +++++++++++++++++-- addons/xinference-cluster/values.yaml | 4 ++-- 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/addons/llm-cluster/templates/cluster.yaml b/addons/llm-cluster/templates/cluster.yaml index 92695623e..c00adc0f4 100644 --- a/addons/llm-cluster/templates/cluster.yaml +++ b/addons/llm-cluster/templates/cluster.yaml @@ -1,4 +1,17 @@ -{{- include "kblib.clusterCommon" . }} +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: Cluster +metadata: + name: {{ include "kblib.clusterName" . }} + namespace: {{ .Release.Namespace }} + labels: {{ include "kblib.clusterLabels" . | nindent 4 }} + {{ if not .Values.cpuMode }} + annotations: + "kubeblocks.io/extra-env": "{\"MODEL_NAME\":\"{{ .Values.model }}\", \"EXTRA_ARGS\":\"{{ .Values.extraArgs }}\"}" + {{ end }} +spec: + clusterVersionRef: {{ .Values.version }} + terminationPolicy: {{ .Values.extra.terminationPolicy }} + {{- include "kblib.affinity" . | indent 2 }} {{ if .Values.cpuMode }} clusterDefinitionRef: ggml # ref clusterDefinition.name componentSpecs: diff --git a/addons/llm-cluster/values.schema.json b/addons/llm-cluster/values.schema.json index 18042f209..f517bd0e6 100644 --- a/addons/llm-cluster/values.schema.json +++ b/addons/llm-cluster/values.schema.json @@ -56,6 +56,22 @@ "minimum": 0, "maximum": 64, "multipleOf": 1 + }, + "model": { + "title": "Model", + "description": "Model name", + "type": [ + "string" + ], + "default": "facebook/opt-125m" + }, + "extraArgs": { + "title": "extra arguments", + "description": "extra arguments that will be passed to run model", + "type": [ + "string" + ], + "default": "--trust-remote-code" } } } diff --git a/addons/llm-cluster/values.yaml b/addons/llm-cluster/values.yaml index aabbb4c3d..901979373 100644 --- a/addons/llm-cluster/values.yaml +++ b/addons/llm-cluster/values.yaml @@ -22,4 +22,8 @@ memory: 6 ## gpu: 1 -cpuMode: false \ No newline at end of file +cpuMode: false + +model: "facebook/opt-125m" + +extraArgs: "--trust-remote-code" \ No newline at end of file diff --git a/addons/llm/templates/clusterversion.yaml b/addons/llm/templates/clusterversion.yaml index 73b247665..4dca51c18 100644 --- a/addons/llm/templates/clusterversion.yaml +++ b/addons/llm/templates/clusterversion.yaml @@ -1,5 +1,22 @@ apiVersion: apps.kubeblocks.io/v1alpha1 kind: ClusterVersion +metadata: + name: vllm-latest + annotations: + kubeblocks.io/is-default-cluster-version: "true" + labels: + {{- include "llm.labels" . | nindent 4 }} +spec: + clusterDefinitionRef: vllm + componentVersions: + - componentDefRef: vllm + versionsContext: + containers: + - name: vllm + image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} +--- +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: ClusterVersion metadata: name: vllm-baichuan-13b labels: @@ -22,8 +39,6 @@ apiVersion: apps.kubeblocks.io/v1alpha1 kind: ClusterVersion metadata: name: vllm-baichuan2-13b - annotations: - kubeblocks.io/is-default-cluster-version: "true" labels: {{- include "llm.labels" . | nindent 4 }} spec: diff --git a/addons/xinference-cluster/values.yaml b/addons/xinference-cluster/values.yaml index 9e73b075a..f2aa9e2c0 100644 --- a/addons/xinference-cluster/values.yaml +++ b/addons/xinference-cluster/values.yaml @@ -14,11 +14,11 @@ replicas: 1 ## @param cpu ## -cpu: 3 +cpu: 2 ## @param memory, the unit is Gi ## -memory: 7 +memory: 6 ## @param gpu ## From 3605fc0d0f484d6d253c1292709047ecddea8dd5 Mon Sep 17 00:00:00 2001 From: chantu Date: Wed, 8 Nov 2023 18:08:12 +0800 Subject: [PATCH 02/10] remove unused cv --- addons/llm/templates/clusterversion.yaml | 140 ----------------------- 1 file changed, 140 deletions(-) diff --git a/addons/llm/templates/clusterversion.yaml b/addons/llm/templates/clusterversion.yaml index 4dca51c18..400f6eb34 100644 --- a/addons/llm/templates/clusterversion.yaml +++ b/addons/llm/templates/clusterversion.yaml @@ -17,146 +17,6 @@ spec: --- apiVersion: apps.kubeblocks.io/v1alpha1 kind: ClusterVersion -metadata: - name: vllm-baichuan-13b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: baichuan-inc/Baichuan-13B-Chat - - name: EXTRA_ARGS - value: "--trust-remote-code" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion -metadata: - name: vllm-baichuan2-13b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: baichuan-inc/Baichuan2-13B-Chat - - name: EXTRA_ARGS - value: "--trust-remote-code" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion -metadata: - name: vllm-baichuan-7b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: baichuan-inc/Baichuan-7B - - name: EXTRA_ARGS - value: "--trust-remote-code" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion -metadata: - name: vllm-baichuan2-7b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: baichuan-inc/Baichuan2-7B-Chat - - name: EXTRA_ARGS - value: "--trust-remote-code" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion -metadata: - name: vllm-vicuna-13b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: lmsys/vicuna-13b-v1.3 - - name: EXTRA_ARGS - value: "--trust-remote-code" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion -metadata: - name: vllm-vicuna-7b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: lmsys/vicuna-7b-v1.5 - - name: EXTRA_ARGS - value: "--trust-remote-code" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion -metadata: - name: vllm-llama-70b - labels: - {{- include "llm.labels" . | nindent 4 }} -spec: - clusterDefinitionRef: vllm - componentVersions: - - componentDefRef: vllm - versionsContext: - containers: - - name: vllm - image: {{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }} - env: - - name: MODEL_NAME - value: upstage/SOLAR-0-70b-16bit - - name: EXTRA_ARGS - value: "--trust-remote-code --swap-space 1" ---- -apiVersion: apps.kubeblocks.io/v1alpha1 -kind: ClusterVersion metadata: name: ggml-baichuan-7b-q4 annotations: From fd71022778ebc0a8d8ff735f5406dd46f31043d3 Mon Sep 17 00:00:00 2001 From: chantu Date: Wed, 8 Nov 2023 18:41:42 +0800 Subject: [PATCH 03/10] config dependencies for qwen --- addons/llm/templates/scripts.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/llm/templates/scripts.yaml b/addons/llm/templates/scripts.yaml index 11217e13a..02f37eb5b 100644 --- a/addons/llm/templates/scripts.yaml +++ b/addons/llm/templates/scripts.yaml @@ -8,6 +8,12 @@ data: start.sh: | #!/bin/bash echo "model=${MODEL_NAME}" + domain=${MODEL_NAME%%/*} + echo "domain=${domain}" + if [[ "${domain,,}" == "qwen" ]]; then + # install dependencies for qwen + pip install tiktoken + fi country=`curl https://ifconfig.io/country_code` if [ "$country" == "CN" ]; then CLONE_MODEL_SCRIPT="git lfs install; git clone https://www.modelscope.cn/${MODEL_NAME}.git" From 79809b6dcf56bbeb80cee61862ebbd43e9a62280 Mon Sep 17 00:00:00 2001 From: chantu Date: Wed, 8 Nov 2023 19:01:30 +0800 Subject: [PATCH 04/10] update --- addons/llm/templates/scripts.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/llm/templates/scripts.yaml b/addons/llm/templates/scripts.yaml index 02f37eb5b..6560b76c8 100644 --- a/addons/llm/templates/scripts.yaml +++ b/addons/llm/templates/scripts.yaml @@ -45,6 +45,8 @@ data: echo "EXTRA_ARGS=${EXTRA_ARGS}" cd vllm echo "model=${MODEL_NAME}" > log + # wait for ray start + sleep 3 while true; do node_num=`ray status | grep "1 node" | wc -l` # continue waiting if ray status not ok From 8d62843eb22158a0d0a351e814997a24c5f72aa5 Mon Sep 17 00:00:00 2001 From: chantu Date: Thu, 9 Nov 2023 12:24:38 +0800 Subject: [PATCH 05/10] remove max_num_batched_tokens --- addons/llm/templates/scripts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/llm/templates/scripts.yaml b/addons/llm/templates/scripts.yaml index 6560b76c8..c1685f43a 100644 --- a/addons/llm/templates/scripts.yaml +++ b/addons/llm/templates/scripts.yaml @@ -54,7 +54,7 @@ data: sleep 1 continue fi - python -m vllm.entrypoints.api_server --host 0.0.0.0 --port 8000 --model ${MODEL_NAME} --gpu-memory-utilization 0.95 --max-num-seqs 512 --max-num-batched-tokens 8192 --tensor-parallel-size ${KB_VLLM_N} ${EXTRA_ARGS} 2>&1 > log + python -m vllm.entrypoints.api_server --host 0.0.0.0 --port 8000 --model ${MODEL_NAME} --gpu-memory-utilization 0.95 --max-num-seqs 512 --tensor-parallel-size ${KB_VLLM_N} ${EXTRA_ARGS} 2>&1 > log code=$? if [ $code -eq 0 ]; then break From 674180a7591ab8c07b0bdcf991d491ca1ec24569 Mon Sep 17 00:00:00 2001 From: chantu Date: Thu, 9 Nov 2023 14:45:32 +0800 Subject: [PATCH 06/10] ggml cv for zephyr-7b-beta --- addons/llm/templates/clusterversion.yaml | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/addons/llm/templates/clusterversion.yaml b/addons/llm/templates/clusterversion.yaml index 400f6eb34..e885bdab3 100644 --- a/addons/llm/templates/clusterversion.yaml +++ b/addons/llm/templates/clusterversion.yaml @@ -156,3 +156,31 @@ spec: volumeMounts: - name: models mountPath: /models +--- +apiVersion: apps.kubeblocks.io/v1alpha1 +kind: ClusterVersion +metadata: + name: ggml-zephyr-beta-7b-q4 + labels: + {{- include "llm.labels" . | nindent 4 }} +spec: + clusterDefinitionRef: ggml + componentVersions: + - componentDefRef: ggml + versionsContext: + initContainers: + - name: download + image: {{ .Values.imageDev.registry | default "docker.io" }}/apecloud/zephyr-7b-beta-gguf:q4_0 + command: ["sh", "-c", "cp /models/ggml-model-q4.gguf /models-target/"] + volumeMounts: + - name: models + mountPath: /models-target + containers: + - name: ggml + image: {{ .Values.imageDev.registry | default "docker.io" }}/{{ .Values.imageDev.repository}}:{{ default .Chart.AppVersion .Values.imageDev.tagNew }} + env: + - name: MODEL + value: /models/ggml-model-q4.gguf + volumeMounts: + - name: models + mountPath: /models From 8466efc4029e851ff437c4832e23ceb3fbb4073d Mon Sep 17 00:00:00 2001 From: huangzhangshu Date: Fri, 10 Nov 2023 00:37:48 +0800 Subject: [PATCH 07/10] chore: add release version workflow --- .github/workflows/release-version.yml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release-version.yml diff --git a/.github/workflows/release-version.yml b/.github/workflows/release-version.yml new file mode 100644 index 000000000..46e6c8a8f --- /dev/null +++ b/.github/workflows/release-version.yml @@ -0,0 +1,34 @@ +name: Release Version + +on: + workflow_dispatch: + inputs: + release_version: + description: 'The version of release' + required: true + default: '' + release_branch: + description: 'The branch of release' + required: true + default: 'main' + +run-name: ref_name:${{ inputs.release_branch }} release_version:${{ inputs.release_version }} + +env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + +jobs: + release-version: + runs-on: ubuntu-latest + steps: + - name: checkout branch ${{ inputs.release_branch }} + uses: actions/checkout@v4 + with: + ref: ${{ inputs.release_branch }} + + - name: push tag + uses: mathieudutour/github-tag-action@v6.1 + with: + custom_tag: ${{ inputs.release_version }} + github_token: ${{ env.GITHUB_TOKEN }} + tag_prefix: "" From 9f92db23942dad12a9eabd364ca94754881b60d0 Mon Sep 17 00:00:00 2001 From: huangzhangshu Date: Fri, 10 Nov 2023 00:52:07 +0800 Subject: [PATCH 08/10] chore: push tag by ref_name --- .github/workflows/release-version.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-version.yml b/.github/workflows/release-version.yml index 46e6c8a8f..837e35466 100644 --- a/.github/workflows/release-version.yml +++ b/.github/workflows/release-version.yml @@ -3,16 +3,12 @@ name: Release Version on: workflow_dispatch: inputs: - release_version: + VERSION: description: 'The version of release' required: true default: '' - release_branch: - description: 'The branch of release' - required: true - default: 'main' -run-name: ref_name:${{ inputs.release_branch }} release_version:${{ inputs.release_version }} +run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.VERSION }} env: GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} @@ -21,14 +17,11 @@ jobs: release-version: runs-on: ubuntu-latest steps: - - name: checkout branch ${{ inputs.release_branch }} + - name: checkout branch ${{ github.ref_name }} uses: actions/checkout@v4 - with: - ref: ${{ inputs.release_branch }} - - name: push tag uses: mathieudutour/github-tag-action@v6.1 with: - custom_tag: ${{ inputs.release_version }} + custom_tag: ${{ inputs.VERSION }} github_token: ${{ env.GITHUB_TOKEN }} tag_prefix: "" From 6f555643a591f0a98a72947f6ff33ecaf0d2cc9a Mon Sep 17 00:00:00 2001 From: free6om Date: Fri, 10 Nov 2023 15:14:34 +0800 Subject: [PATCH 09/10] chore: add name and instance labels to kafka and pulsar (#6) --- addons/kafka/templates/_helpers.tpl | 9 +++++++++ addons/pulsar/templates/_helpers.tpl | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/addons/kafka/templates/_helpers.tpl b/addons/kafka/templates/_helpers.tpl index 7d662b279..a5cf9b877 100644 --- a/addons/kafka/templates/_helpers.tpl +++ b/addons/kafka/templates/_helpers.tpl @@ -35,8 +35,17 @@ Common labels */}} {{- define "kafka.labels" -}} helm.sh/chart: {{ include "kafka.chart" . }} +{{ include "kafka.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} + +{{/* +Selector labels +*/}} +{{- define "kafka.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kafka.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/addons/pulsar/templates/_helpers.tpl b/addons/pulsar/templates/_helpers.tpl index f2a48f9df..90630678f 100644 --- a/addons/pulsar/templates/_helpers.tpl +++ b/addons/pulsar/templates/_helpers.tpl @@ -35,12 +35,21 @@ Common labels */}} {{- define "pulsar.labels" -}} helm.sh/chart: {{ include "pulsar.chart" . }} +{{ include "pulsar.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{/* +Selector labels +*/}} +{{- define "pulsar.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pulsar.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + {{/* Create full image name */}} From 360d5aad527f745b38451c84ef27ced6c213f672 Mon Sep 17 00:00:00 2001 From: free6om Date: Fri, 10 Nov 2023 16:09:43 +0800 Subject: [PATCH 10/10] chore: bump polardbx to 2.3 (#7) --- addons/polardbx-cluster/Chart.yaml | 2 +- addons/polardbx/Chart.yaml | 2 +- addons/polardbx/values.yaml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/polardbx-cluster/Chart.yaml b/addons/polardbx-cluster/Chart.yaml index 0b732a670..e35a72333 100644 --- a/addons/polardbx-cluster/Chart.yaml +++ b/addons/polardbx-cluster/Chart.yaml @@ -4,7 +4,7 @@ description: PolarDB-X Cluster Helm Chart for KubeBlocks. type: application version: 0.1.0 -appVersion: v1.4.1 +appVersion: v2.3 keywords: - polardbx diff --git a/addons/polardbx/Chart.yaml b/addons/polardbx/Chart.yaml index e78eb94f5..6482baa02 100644 --- a/addons/polardbx/Chart.yaml +++ b/addons/polardbx/Chart.yaml @@ -4,7 +4,7 @@ description: PolarDB-X Cluster Helm Chart for KubeBlocks. type: application version: 0.1.0 -appVersion: v1.4.1 +appVersion: v2.3 keywords: - polardbx diff --git a/addons/polardbx/values.yaml b/addons/polardbx/values.yaml index d16bade01..7de3e9f9e 100644 --- a/addons/polardbx/values.yaml +++ b/addons/polardbx/values.yaml @@ -19,32 +19,32 @@ images: # Images for xstore(DN) tools updater. toolsUpdater: name: xstore-tools - tag: latest + tag: v1.5.0 # Image for DN engine dn: name: polardbx-engine-2.0 - tag: latest + tag: 80-8.0.18-20231101115000 # Image for CN engine cn: name: polardbx-sql - tag: latest + tag: 5.4.18-20231101115000 # Image for CN initialization init: name: polardbx-init - tag: latest + tag: v1.5.0 # Image for CN engine cdc: name: polardbx-cdc - tag: latest + tag: 5.4.18-20231101115000 # Image for CN&CDC exporter exporter: name: polardbx-exporter - tag: latest + tag: v1.5.0 # Tool image settings for gms initialization mysql: