-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry-pick from 0e19ca8 and update xinference cpu image version
- Loading branch information
1 parent
ad54cd6
commit 41c3850
Showing
26 changed files
with
399 additions
and
7 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,30 @@ | ||
apiVersion: extensions.kubeblocks.io/v1alpha1 | ||
kind: Addon | ||
metadata: | ||
name: xinference | ||
labels: | ||
{{- include "kubeblocks.labels" . | nindent 4 }} | ||
"kubeblocks.io/provider": community | ||
{{- if .Values.keepAddons }} | ||
annotations: | ||
helm.sh/resource-policy: keep | ||
{{- end }} | ||
spec: | ||
description: 'xinference' | ||
|
||
type: Helm | ||
|
||
helm: | ||
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "xinference" "version" (default .Chart.Version .Values.versionOverride) "values" .Values) | indent 4 }} | ||
{{- include "kubeblocks.addonChartsImage" . | indent 4 }} | ||
|
||
installOptions: | ||
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }} | ||
version: {{ default .Chart.Version .Values.versionOverride }} | ||
{{- end }} | ||
|
||
installable: | ||
autoInstall: false | ||
|
||
defaultInstallValues: | ||
- enabled: false |
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,24 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
*.lock |
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,27 @@ | ||
annotations: | ||
category: Database | ||
apiVersion: v2 | ||
name: xinference-cluster | ||
type: application | ||
version: 0.7.0-alpha.0 | ||
description: A vxinference Cluster Helm chart for KubeBlocks. | ||
dependencies: | ||
- name: kblib | ||
version: 0.1.0 | ||
repository: file://../kblib | ||
alias: extra | ||
|
||
appVersion: "7.0.6" | ||
|
||
keywords: | ||
- xinference | ||
|
||
home: https://github.com/apecloud/kubeblocks/tree/main/deploy/xinference-cluster | ||
icon: https://kubeblocks.io/img/logo.png | ||
|
||
maintainers: | ||
- name: ApeCloud | ||
url: https://kubeblocks.io/ | ||
|
||
sources: | ||
- https://github.com/apecloud/kubeblocks/ |
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,2 @@ | ||
1. Get the application URL by running these commands: | ||
|
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,3 @@ | ||
{{/* | ||
Define xinference cluster component. | ||
*/}} |
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,20 @@ | ||
{{- include "kblib.clusterCommon" . }} | ||
clusterDefinitionRef: xinference # ref clusterDefinition.name | ||
{{ if .Values.cpuMode }} | ||
clusterVersionRef: {{ .Values.cpuVersion }} | ||
{{ end }} | ||
componentSpecs: | ||
- name: xinference | ||
componentDefRef: xinference # ref clusterDefinition componentDefs.name | ||
{{- include "kblib.componentMonitor" . | indent 6 }} | ||
replicas: {{ .Values.replicas }} | ||
serviceAccountName: {{ include "kblib.serviceAccountName" . }} | ||
{{ if .Values.cpuMode }} | ||
{{- include "kblib.componentResources" . | indent 6 }} | ||
{{ else }} | ||
resources: | ||
limits: | ||
nvidia.com/gpu: {{ .Values.gpu }} | ||
requests: | ||
nvidia.com/gpu: {{ .Values.gpu }} | ||
{{ end }} |
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 @@ | ||
{{- include "kblib.rbac" . }} |
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,12 @@ | ||
{{/* | ||
Validate cpu, memory and storage | ||
*/}} | ||
{{- $cpu := (float64 .Values.cpu) }} | ||
{{- $memory := (float64 .Values.memory) }} | ||
{{- $storage := (float64 .Values.storage) }} | ||
{{- if or (lt $cpu 0.5) (gt $cpu 64.0) }} | ||
{{- fail (print "cpu must be between 0.5 and 64, got " $cpu) }} | ||
{{- end }} | ||
{{- if or (lt $memory 0.5) (gt $memory 1000.0) }} | ||
{{- fail (print "memory must be between 0.5 and 1000, got " $memory) }} | ||
{{- end }} |
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,61 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema#", | ||
"type": "object", | ||
"properties": { | ||
"cpuMode": { | ||
"title": "CPU Mode", | ||
"description": "Set to true if no GPU is available", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"version": { | ||
"title": "Version", | ||
"description": "Cluster version.", | ||
"type": "string", | ||
"default": "xinference-latest" | ||
}, | ||
"replicas": { | ||
"title": "Replicas", | ||
"description": "The number of replicas, for standalone mode, the replicas is 1, for replication mode, the default replicas is 2.", | ||
"type": "integer", | ||
"default": 1, | ||
"minimum": 1, | ||
"maximum": 5 | ||
}, | ||
"cpu": { | ||
"title": "CPU", | ||
"description": "CPU cores.", | ||
"type": [ | ||
"number", | ||
"string" | ||
], | ||
"default": 2, | ||
"minimum": 0.5, | ||
"maximum": 64, | ||
"multipleOf": 0.5 | ||
}, | ||
"memory": { | ||
"title": "Memory(Gi)", | ||
"description": "Memory, the unit is Gi.", | ||
"type": [ | ||
"number", | ||
"string" | ||
], | ||
"default": 6, | ||
"minimum": 0.5, | ||
"maximum": 1000 | ||
}, | ||
"gpu": { | ||
"title": "GPU", | ||
"description": "GPU cores.", | ||
"type": [ | ||
"number", | ||
"string" | ||
], | ||
"default": 1, | ||
"minimum": 0, | ||
"maximum": 64, | ||
"multipleOf": 1 | ||
} | ||
} | ||
} |
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,27 @@ | ||
# Default values for xinference-cluster. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
## @param version xinference cluster version | ||
## | ||
version: xinference-latest | ||
|
||
cpuVersion: xinference-cpu-latest | ||
|
||
## @param replicas specify cluster replicas | ||
## | ||
replicas: 1 | ||
|
||
## @param cpu | ||
## | ||
cpu: 3 | ||
|
||
## @param memory, the unit is Gi | ||
## | ||
memory: 7 | ||
|
||
## @param gpu | ||
## | ||
gpu: 1 | ||
|
||
cpuMode: false |
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,24 @@ | ||
apiVersion: v2 | ||
name: xinference | ||
description: A Helm chart for Kubernetes | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "1.16.0" |
Empty file.
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,33 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "xinference.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "xinference.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "xinference.labels" -}} | ||
helm.sh/chart: {{ include "xinference.chart" . }} | ||
{{ include "xinference.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "xinference.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "xinference.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} |
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,43 @@ | ||
apiVersion: apps.kubeblocks.io/v1alpha1 | ||
kind: ClusterDefinition | ||
metadata: | ||
name: xinference | ||
labels: | ||
{{- include "xinference.labels" . | nindent 4}} | ||
spec: | ||
componentDefs: | ||
- name: xinference | ||
workloadType: Stateful | ||
characterType: xinference | ||
scriptSpecs: | ||
- name: xinference-scripts | ||
templateRef: xinference-scripts | ||
namespace: {{ .Release.Namespace }} | ||
volumeName: scripts | ||
defaultMode: 493 | ||
service: | ||
ports: | ||
- name: xinference | ||
port: 9997 | ||
targetPort: xinference | ||
podSpec: | ||
containers: | ||
- name: xinference | ||
imagePullPolicy: {{default .Values.image.pullPolicy "IfNotPresent"}} | ||
securityContext: | ||
runAsUser: 0 | ||
privileged: true | ||
allowPrivilegeEscalation: true | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- name: scripts | ||
mountPath: /scripts | ||
command: | ||
- /scripts/start.sh | ||
ports: | ||
- name: xinference | ||
containerPort: 9997 | ||
connectionCredential: | ||
username: root | ||
password: "" |
Oops, something went wrong.