diff --git a/README.md b/README.md index e91b42a13d..9e7a7034a9 100644 --- a/README.md +++ b/README.md @@ -284,41 +284,61 @@ Let's go ahead and finish the tutorial on the on-premises instance. minikube start ``` - > For users in the mainland of China, please add these startup parameters:`--image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers`. If there is no kubectl bin in your machine, you may use `minikube kubectl` or `alias kubectl="minikube kubectl --"` alias command. + > For users in the mainland of China, please add the startup parameter:`--image-mirror-country=cn`. + + ```bash + minikube start --image-mirror-country=cn + ``` + + If there is no kubectl bin in your machine, you may use `minikube kubectl` or `alias kubectl="minikube kubectl --"` alias command. - 🍵 **STEP3**: Installing Starwhale ```bash helm repo add starwhale https://star-whale.github.io/charts helm repo update - export SWNAME=starwhale SWNS=starwhale - helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio --set image.registry=docker-registry.starwhale.cn --set minio.global.imageRegistry=docker-registry.starwhale.cn --set mysql.global.imageRegistry=docker-registry.starwhale.cn + helm pull starwhale/starwhale --untar --untardir ./charts + + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.global.yaml + ``` + + > For users in the mainland of China, use `values.minikube.global.yaml`. + + ```bash + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.cn.yaml ``` After the installation is successful, the following prompt message appears: ```bash + Release "starwhale" has been upgraded. Happy Helming! NAME: starwhale - LAST DEPLOYED: Thu Jun 23 14:48:02 2022 + LAST DEPLOYED: Tue Feb 14 16:25:03 2023 NAMESPACE: starwhale STATUS: deployed - REVISION: 1 + REVISION: 14 NOTES: ****************************************** Chart Name: starwhale - Chart Version: 0.3.0 - App Version: 0.3.0 - ... + Chart Version: 0.1.0 + App Version: latest + Starwhale Image: + - server: ghcr.io/star-whale/server:latest + Runtime default Image: + - runtime image: ghcr.io/star-whale/starwhale:latest + + ****************************************** + Web Visit: Port Forward Visit: - starwhale controller: - - run: kubectl port-forward --namespace starwhale svc/starwhale-controller 8082:8082 + - run: kubectl port-forward --namespace starwhale svc/controller 8082:8082 - visit: http://localhost:8082 - minio admin: - - run: kubectl port-forward --namespace starwhale svc/starwhale-minio 9001:9001 + - run: kubectl port-forward --namespace starwhale svc/minio 9001:9001 - visit: http://localhost:9001 - mysql: - - run: kubectl port-forward --namespace starwhale svc/starwhale-mysql 3306:3306 + - run: kubectl port-forward --namespace starwhale svc/mysql 3306:3306 - visit: mysql -h 127.0.0.1 -P 3306 -ustarwhale -pstarwhale ****************************************** @@ -326,25 +346,25 @@ Let's go ahead and finish the tutorial on the on-premises instance. - starwhale: u:starwhale, p:abcd1234 - minio admin: u:minioadmin, p:minioadmin - *_* Enjoy using Starwhale. *_* + *_* Enjoy to use Starwhale Platform. *_* ``` - Then keep checking the minikube service status until all pods are running. + Then keep checking the minikube service status until all deployments are running. ```bash - kubectl get pods -n starwhale + kubectl get deployments -n starwhale ``` - | NAME | READY | STATUS | RESTARTS | AGE | - |:-----|-------|--------|----------|-----| - |starwhale-controller-7d864558bc-vxvb8|1/1|Running|0|1m - |starwhale-minio-7d45db75f6-7wq9b|1/1|Running|0|2m - |starwhale-mysql-0|1/1|Running|0|2m + | NAME | READY | UP-TO-DATE| AVAILABLE | AGE | + |------|-------|--------|----------|-----| + |controller|1/1|1|1|5m| + |minio|1/1|1|1|5m| + |mysql|1/1|1|1|5m| Make the Starwhale controller accessible locally with the following command: ```bash - kubectl port-forward --namespace starwhale svc/starwhale-controller 8082:8082 + kubectl port-forward --namespace starwhale svc/controller 8082:8082 ``` - ☕ **STEP4**: Upload the artifacts to the cloud instance diff --git a/docker/README.md b/docker/README.md index ebd53e417f..e69de29bb2 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,3 +0,0 @@ -use helm to install: -- helm install starwhale ./ --namespace starwhale -- helm upgrade starwhale ./ --namespace starwhale \ No newline at end of file diff --git a/docker/charts/Chart.lock b/docker/charts/Chart.lock index e99f82cf56..be296ae58a 100644 --- a/docker/charts/Chart.lock +++ b/docker/charts/Chart.lock @@ -2,14 +2,5 @@ dependencies: - name: common repository: https://charts.bitnami.com/bitnami version: 1.16.0 -- name: mysql - repository: https://charts.bitnami.com/bitnami - version: 8.9.6 -- name: minio - repository: https://charts.bitnami.com/bitnami - version: 11.7.6 -- name: nexus-repository-manager - repository: https://sonatype.github.io/helm3-charts/ - version: 39.0.0 -digest: sha256:882b4bd412bf6cd30cce2236144b1e0ad8edf7585ac46d0d6d39479fc26e530c -generated: "2022-06-21T19:23:38.63261854+08:00" +digest: sha256:cd0a73bdd9d5146e1392f5aa4c552822bed8c80f6fb962e56444d342f918e546 +generated: "2023-02-13T17:11:47.46212364+08:00" diff --git a/docker/charts/Chart.yaml b/docker/charts/Chart.yaml index 6f1166ec82..14155e8a49 100644 --- a/docker/charts/Chart.yaml +++ b/docker/charts/Chart.yaml @@ -14,19 +14,7 @@ icon: https://github.com/star-whale/starwhale/raw/main/docs/static/img/logo_72x7 dependencies: - name: common repository: https://charts.bitnami.com/bitnami - version: 1.x.x - - name: mysql - condition: mysql.enabled - repository: https://charts.bitnami.com/bitnami - version: 8.x.x - - name: minio - condition: minio.enabled - repository: https://charts.bitnami.com/bitnami - version: 11.x.x - - name: nexus-repository-manager - condition: nexus3.enabled - repository: https://sonatype.github.io/helm3-charts/ - version: 39.x.x + version: 1.16.0 version: "0.1.0" appVersion: "latest" diff --git a/docker/charts/README.md b/docker/charts/README.md index ca353c22e2..02778237f4 100644 --- a/docker/charts/README.md +++ b/docker/charts/README.md @@ -1,88 +1,126 @@ # Starwhale Helm Charts -Starwhale is a MLOps platform. Starwhale Helm Charts help you deploy the whole platform in Kubernetes easily. +Starwhale is an MLOps platform. Starwhale Helm Charts help you deploy the whole platform in Kubernetes easily. - - Easy to deploy, upgrade and maintain Starwhale controller and agent services. - - Easy to deploy 3rd dependencies, such as minio, mysql. +- Easy to deploy, upgrade and maintain Starwhale controller and agent services. +- Easy to deploy 3rd dependencies, such as minio and MySQL. -## TL; DR +## 1. TL; DR ```bash helm repo add starwhale https://star-whale.github.io/charts helm repo update -helm install starwhale starwhale/starwhale -n starwhale --create-namespace +helm upgrade --install starwhale starwhale/starwhale -n starwhale --create-namespace ``` -## Prerequisites +## 2. Prerequisites - Kubernetes 1.19+ - Helm 3.2.0+ -## Installing the Chart +## 3. Installing the Chart -To install the chart with release name starwhale: +To install the chart with the release name `starwhale` in the Kubernetes `starwhale` namespace: ```bash helm repo add starwhale https://star-whale.github.io/charts -helm install starwhale starwhale/starwhale +helm repo update +helm upgrade --install starwhale starwhale/starwhale -n starwhale --create-namespace ``` -## Uninstalling the Chart +We have offered a variety of installation modes in advance. + +- For minikube(all-in-one) and global network: + + ```bash + helm pull starwhale/starwhale --untar --untardir ./charts + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.global.yaml + ``` + +- For minikube(all-in-one) and China's mainland network: + + ```bash + helm pull starwhale/starwhale --untar --untardir ./charts + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.cn.yaml + ``` + + `helm pull` command will pull and untar the chart package, you can modify the values files for the deep customize. -To uninstall/delete the starwhale deployment: +If you want to install the specified version, you can use `--version` argument. By default, the latest release version will be installed. + +## 4. Uninstalling the Chart + +To uninstall/delete the Starwhale deployment: ```bash helm delete starwhale ``` -## Parameters +`helm delete` command will not delete the namespace, you can run `kubectl delete namespace starwhale` to cleanup the namespace. -### Common parameters +## 5. Upgrading the Chart -| Name | Description | Default Value | -|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| -| `image.registry` | image registry, you can find starwhale docker images in docker.io or ghcr.io. | `ghcr.io` | -| `image.org` | image registry org, [starwhaleai](https://hub.docker.com/u/starwhaleai)(docker.io) or [star-whale](https://github.com/orgs/star-whale)(ghcr.io) or some custom org name in other registry | `star-whale` | +To upgrade new chart version: -### Starwhale parameters +```bash +helm repo update starwhale +``` -| Name | Description | Default Value | -|-----------------------------|--------------------------------------------|----------------------------------| -| `controller.taskSplitSize` | task split size | `2` | -| `controller.auth.username` | admin user name | `starwhale` | -| `controller.auth.password` | admin user password | `abcd1234` | -| `storage.agentHostPathRoot` | persistent host-path for cache data of job | `/mnt/data/starwhale` | -| `mirror.conda.enabled` | conda mirror | `true` | -| `mirror.pypi.enabled` | pypi mirror | `true` | -| `ingress.enabled` | enable ingress for starwhale controller | `true` | -| `ingress.ingressClassName` | ingress class name | `nginx` | -| `ingress.host` | starwhale controller domain | `console.pre.intra.starwhale.ai` | +The `update` command will update the information of available charts locally from the Starwhale chart repository. You can get more version information from [ArtifactHub](https://artifacthub.io/packages/helm/starwhale/starwhale). -### Infra parameters +## 6. Parameters -| Name | Description | Default Value | -|----------------------------------|------------------------------------------------------------------------------------------------------------------------|-----------------------| -| `mysql.enabled` | Deploy a standalone mysql instance with starwhale chart. If set mysql.enabled=true, you should provide a pv for mysql. | `true` | -| `mysql.persistence.storageClass` | mysql pvc storageClass | `local-storage-mysql` | -| `externalMySQL.host` | When mysql.enabled is false, chart will use external mysql. | `localhost` | -| `minio.enabled` | Deploy a standalone minio instance with starwhale chart. If set minio.enabled=true, you should provide a pv for minio. | `true` | -| `minio.persistence.storageClass` | minio pvc storageClass | `local-storage-minio` | -| `externalS3OSS.host` | When minio.enabled is false, chart will use external s3 service. | `localhost` | +### 6.1 Common parameters -### minikube parameters -| Name | Description | Default Value | -|--------------------|------------------------------------|---------------| -| `minikube.enabled` | minikube mode for all-in-one test. | `false` | +| Name| Description | Default Value | +|-----|-------------|---------------| +| `image.registry` | image registry, you can find Starwhale docker images in docker.io, ghcr.io and docker-registry.starwhale.cn.|`ghcr.io`| +| `image.org` | image registry org, [starwhaleai](https://hub.docker.com/u/starwhaleai)(docker.io) or [star-whale](https://github.com/orgs/star-whale)(ghcr.io and docker-registry.starwhale.cn) or some custom org name in other registry.| `star-whale`| -In minikube mode, you can easy to build an all-in-one starwhale. Run command example: +### 6.2 Starwhale controller parameters -```bash -export SWNAME=starwhale -export SWNS=starwhale -helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio -``` +| Name | Description | Default Value | +|------|-------------|---------------| +| `controller.taskSplitSize`| task split size| `2`| +| `controller.auth.username`| login username for console web| `starwhale`| +| `controller.auth.password`| login password for console web| `abcd1234`| +| `controller.ingress.enabled`| enable ingress for Starwhale controller | `true` | +| `controller.ingress.ingressClassName` | ingress class name | `nginx`| +| `controller.ingress.host` | Starwhale controller domain | `console.pre.intra.starwhale.ai` | +| `controller.containerPort`| Starwhale console web port | `8082` | + +### 6.3 Infra parameters + +Starwhale provides MySQL and minio infra charts, but the charts only support standalone mode for controller experiential, debugging and development, for example, minikube all-in-one scenario. In production, you should use external high available infra by the `externalMySQL` and `externalOSS` parameters. + +Standalone Infra for test scenario: + +| Name | Description | Default Value | +|------|-------------|---------------| +| `mysql.enabled` | Deploy a standalone mysql instance with starwhale charts. pv/storageClass will be created automatically. | `true` | +| `minio.enabled` | Deploy a standalone minio instance with starwhale charts. pv/storageClass will be created automatically. | `true` | +| `minio.ingress.enabled` | enable ingress for minio admin web. | `true` | +| `minio.ingress.host` | minio admin web domain | `minio.pre.intra.starwhale.ai` | + +External Infra for production scenario: + +| Name | Description | Default Value | +|------|-------------|---------------| +| `externalMySQL.host` | When mysql.enabled is false, charts will use external mysql. | `localhost` | +| `externalMySQL.port` | port for the external mysql | `3306` | +| `externalMySQL.username` | username for the external mysql | `` | +| `externalMySQL.password` | password for the external mysql | `` | +| `externalMySQL.database` | The System Admin should create a database for Starwhale in the external mysql. | `starwhale` | +| `externalOSS.host` | When minio.enabled is false, charts will use the external OSS service. | `localhost` | +| `externalOSS.port` | port for the external OSS service | `9000` | +| `externalOSS.accessKey` | access key for the external OSS service | `` | +| `externalOSS.secretKey` | secret key for the external OSS service | `` | +| `externalOSS.defaultBuckets` | The System Admin should create a bucket for Starwhale in the external OSS service. | `starwhale` | +| `externalOSS.region` | bucket's region for the external OSS service | `local` | +| `externalOSS.type` | Starwhale supports `s3`, `minio` and `aliyun` OSS types. | `s3` | + +### 6.4 dev mode -### dev mode | Name | Description | Default Value | |-----------------------------|----------------------------------------------------------|------------------| | `devMode.createPV.enabled` | enable auto create PV | `false` | @@ -94,17 +132,75 @@ Dev mode support creating local path PV automatically when devMode.createPV.enab e.g. ```bash -export SWNAME=starwhale -export SWNS=starwhale -helm install $SWNAME . -n $SWNS --create-namespace \ - --set devMode.createPV.enabled=true \ - --set devMode.createPV.host=pv-host \ - --set devMode.createPV.rootPath=/path/to/pv-storage \ - --set mysql.primary.persistence.storageClass=$SWNAME-mysql \ - --set minio.persistence.storageClass=$SWNAME-minio +helm install starwhale . -n starwhale --create-namespace \ + --set devMode.createPV.enabled=true \ + --set devMode.createPV.host=pv-host \ + --set devMode.createPV.rootPath=/path/to/pv-storage ``` -## Community -- Report a bug or feature request, use [Github Issues](https://github.com/star-whale/starwhale/issues/new/choose). +### 6.5 ServiceAccount + +Starwhale Controller can only work properly with ServiceAccount with sufficient permissions. The list of permissions required is as follows (take RBAC as an example): + +| Resource | API Group | Get | List | Watch | Create | Delete | +|----------|-----------|-----|------|-------|--------|--------| +| jobs | batch | Y | Y | Y | Y | Y | +| pods | core | Y | Y | Y | | | +| nodes | core | Y | Y | Y | | | +| events | "" | Y | | | | | + +example + +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: test-role +rules: +- apiGroups: + - "" + resources: + - pods + - nodes + verbs: + - get + - list + - watch +- apiGroups: + - "batch" + resources: + - jobs + verbs: + - create + - get + - list + - watch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - get + - watch + - list +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: test-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: test-role +subjects: +- kind: ServiceAccount + name: test-sa +``` + +## 7. Community + +- Report a bug or feature request, and use [Github Issues](https://github.com/star-whale/starwhale/issues/new/choose). - Realtime Support, please join us on [Slack](https://join.slack.com/t/starwhale/shared_invite/zt-19b6cwnyo-BxMrZYWKj2J~kly1c32oEA). -- Welcome for your pull request, [Github Repo](https://github.com/star-whale/starwhale). +- Welcome to your pull request, [Github Repo](https://github.com/star-whale/starwhale). diff --git a/docker/charts/charts/minio-11.7.6.tgz b/docker/charts/charts/minio-11.7.6.tgz deleted file mode 100644 index 045fce7a31..0000000000 Binary files a/docker/charts/charts/minio-11.7.6.tgz and /dev/null differ diff --git a/docker/charts/charts/mysql-8.9.6.tgz b/docker/charts/charts/mysql-8.9.6.tgz deleted file mode 100644 index 31edeabe4a..0000000000 Binary files a/docker/charts/charts/mysql-8.9.6.tgz and /dev/null differ diff --git a/docker/charts/charts/nexus-repository-manager-39.0.0.tgz b/docker/charts/charts/nexus-repository-manager-39.0.0.tgz deleted file mode 100644 index 58f6a5f1f6..0000000000 Binary files a/docker/charts/charts/nexus-repository-manager-39.0.0.tgz and /dev/null differ diff --git a/docker/charts/templates/NOTES.txt b/docker/charts/templates/NOTES.txt index 083a5e43ef..9475826711 100644 --- a/docker/charts/templates/NOTES.txt +++ b/docker/charts/templates/NOTES.txt @@ -3,44 +3,32 @@ Chart Name: {{ .Chart.Name }} Chart Version: {{ .Chart.Version }} App Version: {{ .Chart.AppVersion }} Starwhale Image: - - server: {{ .Values.image.registry }}/{{ .Values.image.org }}/{{ .Values.image.server.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }} + - server: {{ .Values.image.registry }}/{{ .Values.image.org }}/{{ .Values.image.server.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }} Runtime default Image: - runtime image: {{ .Values.image.registry }}/{{ .Values.image.org }}/{{ .Values.image.base.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }} ****************************************** -{{- if .Values.ingress.enabled }} Web Visit: - {{- if .Values.minikube.enabled }} - - starwhale controller: http://{{.Values.minikube.hostname.controller }} - {{- else }} - - starwhale controller: http://{{.Values.ingress.host}} + {{- if .Values.controller.ingress.enabled }} + - starwhale controller: http://{{.Values.controller.ingress.host }} {{- end}} - {{- if .Values.minio.enabled}} - - minio admin: http://{{.Values.minio.ingress.hostname}} - {{- end}} - {{- if .Values.nexus3.enabled}} - - nexus3 admin: http://localhost:{{ .Values.nexus3.nexusPort }} + {{- if and .Values.minio.enabled .Values.minio.ingress.enabled }} + - minio admin: http://{{.Values.minio.ingress.host }} {{- end}} -{{- end }} -Port Forward Visist: +Port Forward Visit: - starwhale controller: - - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }}-controller {{ .Values.controller.containerPort }}:{{ .Values.controller.containerPort }} + - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/controller {{ .Values.controller.containerPort }}:{{ .Values.controller.containerPort }} - visit: http://localhost:{{.Values.controller.containerPort}} {{- if .Values.minio.enabled}} - minio admin: - - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }}-minio {{ .Values.minio.containerPorts.console }}:{{ .Values.minio.containerPorts.console }} - - visit: http://localhost:{{.Values.minio.containerPorts.console}} + - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/minio {{ .Values.minio.ports.console }}:{{ .Values.minio.ports.console }} + - visit: http://localhost:{{.Values.minio.ports.console}} {{- end}} {{- if and .Values.mysql.enabled .Values.minikube.enabled }} - mysql: - - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }}-mysql {{ .Values.mysql.primary.service.port }}:{{ .Values.mysql.primary.service.port }} - - visit: mysql -h 127.0.0.1 -P {{ .Values.mysql.primary.service.port }} -u{{ .Values.mysql.auth.username }} -p{{ .Values.mysql.auth.password }} - {{- end}} - {{- if and .Values.nexus3.enabled .Values.minikube.enabled }} - - nexus3: - - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "common.names.fullname" . }}-nexus-repository-manager {{ .Values.nexus3.nexusPort }}:{{ .Values.nexus3.nexusPort }} - - visit: http://localhost:{{ .Values.nexus3.nexusPort }} user:admin,password:admin123 + - run: kubectl port-forward --namespace {{ .Release.Namespace }} svc/mysql {{ .Values.mysql.ports.api }}:{{ .Values.mysql.ports.api }} + - visit: mysql -h 127.0.0.1 -P {{ .Values.mysql.ports.api }} -u{{ .Values.mysql.auth.username }} -p{{ .Values.mysql.auth.password }} {{- end}} ****************************************** diff --git a/docker/charts/templates/_helpers.tpl b/docker/charts/templates/_helpers.tpl index d1ab041f2c..4ec315f96b 100644 --- a/docker/charts/templates/_helpers.tpl +++ b/docker/charts/templates/_helpers.tpl @@ -35,29 +35,29 @@ Common labels */}} {{- define "chart.labels" -}} helm.sh/chart: {{ include "chart.chart" . }} -{{ include "chart.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} -{{/* -controller label -*/}} {{- define "chart.controller.labels" -}} starwhale.ai/role: controller app.kubernetes.io/name: {{ include "common.names.fullname" . }} -app.kubernetes.io/instance: {{ include "common.names.fullname" . }}-controller +app.kubernetes.io/instance: controller {{- end}} -{{/* -Selector labels -*/}} -{{- define "chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "chart.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} +{{- define "chart.mysql.labels" -}} +starwhale.ai/role: mysql +app.kubernetes.io/name: {{ include "common.names.fullname" . }} +app.kubernetes.io/instance: mysql +{{- end}} + +{{- define "chart.minio.labels" -}} +starwhale.ai/role: minio +app.kubernetes.io/name: {{ include "common.names.fullname" . }} +app.kubernetes.io/instance: minio +{{- end}} {{/* Create the name of the service account to use @@ -92,7 +92,7 @@ Create PV for dev mode apiVersion: v1 kind: PersistentVolume metadata: - name: {{ .Release.Name }}-pv-{{ .backend }} + name: {{ include "common.names.fullname" . }}-pv-{{ .backend }} namespace: {{ .Release.Namespace }} spec: capacity: @@ -101,14 +101,14 @@ spec: accessModes: - ReadWriteOnce hostPath: - path: {{ .rootPath }}/{{ .backend }} + path: {{ .rootPath }}/{{ include "common.names.fullname" . }}/{{ .backend }} type: DirectoryOrCreate - storageClassName: {{ .Release.Name }}-{{ .backend }} + storageClassName: {{ include "common.names.fullname" . }}-{{ .backend }} --- kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: - name: {{ .Release.Name }}-{{ .backend }} + name: {{ include "common.names.fullname" . }}-{{ .backend }} provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer {{- end}} diff --git a/docker/charts/templates/controller-deployment.yaml b/docker/charts/templates/controller-deployment.yaml index 27c63f5f51..077d1e32e5 100644 --- a/docker/charts/templates/controller-deployment.yaml +++ b/docker/charts/templates/controller-deployment.yaml @@ -1,22 +1,16 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ include "common.names.fullname" . }}-controller - labels: {{ include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - starwhale.ai/role: controller + name: controller + labels: {{ include "chart.controller.labels" . | nindent 4 }} spec: replicas: 1 selector: - matchLabels: - {{ include "chart.controller.labels" . | nindent 6}} + matchLabels: {{ include "chart.controller.labels" . | nindent 6}} template: metadata: - labels: - {{ include "chart.controller.labels" . | nindent 8}} + labels: {{ include "chart.controller.labels" . | nindent 8}} spec: volumes: - name: controller-storage @@ -85,6 +79,8 @@ spec: value: "{{ .Release.Name }}" - name: SW_RUNTIME_IMAGE_DEFAULT value: "{{ .Values.image.registry }}/{{ .Values.image.org }}/{{ .Values.image.base.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + - name: SW_DOCKER_REGISTRY_URL + value: "{{ .Values.image.registry }}" - name: SW_TASK_SPLIT_SIZE value: "{{ .Values.controller.taskSplitSize }}" - name: SW_HOST_IP @@ -96,10 +92,10 @@ spec: - name: SW_K8S_HOST_PATH_FOR_CACHE value: {{ .Values.storage.agentHostPathRoot }}/job - name: SW_INSTANCE_URI - value: "http://{{ include "common.names.fullname" . }}-controller:{{ .Values.controller.containerPort }}" + value: "http://controller:{{ .Values.controller.containerPort }}" {{- if .Values.minio.enabled }} - name: SW_STORAGE_ENDPOINT - value: "http://{{ .Release.Name }}-minio:{{ .Values.minio.containerPorts.api }}" + value: "http://minio:{{ .Values.minio.ports.api }}" - name: SW_STORAGE_BUCKET value: "{{ .Values.minio.defaultBuckets }}" - name: SW_STORAGE_ACCESSKEY @@ -110,23 +106,23 @@ spec: value: "local" {{- else }} - name: SW_STORAGE_ENDPOINT - value: "http://{{ .Values.externalS3OSS.host }}:{{ .Values.externalS3OSS.port }}" + value: "http://{{ .Values.externalOSS.host }}:{{ .Values.externalOSS.port }}" - name: SW_STORAGE_BUCKET - value: "{{ .Values.externalS3OSS.defaultBuckets }}" + value: "{{ .Values.externalOSS.defaultBuckets }}" - name: SW_STORAGE_ACCESSKEY - value: "{{ .Values.externalS3OSS.accessKey }}" + value: "{{ .Values.externalOSS.accessKey }}" - name: SW_STORAGE_SECRETKEY - value: "{{ .Values.externalS3OSS.secretKey }}" + value: "{{ .Values.externalOSS.secretKey }}" - name: SW_STORAGE_REGION - value: "{{ .Values.externalS3OSS.region }}" + value: "{{ .Values.externalOSS.region }}" - name: SW_STORAGE_TYPE - value: "{{ .Values.externalS3OSS.type }}" + value: "{{ .Values.externalOSS.type }}" {{- end }} {{- if .Values.mysql.enabled }} - name: SW_METADATA_STORAGE_IP - value: "{{ .Release.Name }}-mysql" + value: "mysql" - name: SW_METADATA_STORAGE_PORT - value: "{{ .Values.mysql.primary.service.port }}" + value: "{{ .Values.mysql.ports.api }}" - name: SW_METADATA_STORAGE_PASSWORD # todo whether use secret value: "{{ .Values.mysql.auth.password }}" - name: SW_METADATA_STORAGE_USER diff --git a/docker/charts/templates/controller-ingress.yaml b/docker/charts/templates/controller-ingress.yaml index 7b5f04efb4..70a5249dd3 100644 --- a/docker/charts/templates/controller-ingress.yaml +++ b/docker/charts/templates/controller-ingress.yaml @@ -1,28 +1,24 @@ -{{ if .Values.ingress.enabled }} +{{ if .Values.controller.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "common.names.fullname" . }}-controller + name: controller namespace: {{ .Release.Namespace }} annotations: nginx.ingress.kubernetes.io/proxy-body-size: 30g spec: - ingressClassName: {{ .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.controller.ingress.ingressClassName }} rules: - {{- if .Values.minikube.enabled }} - - host: {{ .Values.minikube.hostname.controller }} - {{- else }} - - host: {{ .Values.ingress.host }} - {{- end}} + - host: {{ .Values.controller.ingress.host }} http: paths: - - path: {{ .Values.ingress.path }} + - path: {{ .Values.controller.ingress.path }} pathType: Prefix backend: service: - name: {{ include "common.names.fullname" . }}-controller + name: controller port: number: {{ .Values.controller.containerPort }} {{ end }} @@ -30,7 +26,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: {{ include "common.names.fullname" . }}-controller + name: controller namespace: {{ .Release.Namespace }} labels: {{ include "chart.controller.labels" . | nindent 4}} diff --git a/docker/charts/templates/minio.yaml b/docker/charts/templates/minio.yaml new file mode 100644 index 0000000000..7ddcb9b6ec --- /dev/null +++ b/docker/charts/templates/minio.yaml @@ -0,0 +1,131 @@ +{{- if .Values.minio.enabled }} +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: minio + namespace: {{ .Release.Namespace | quote }} + labels: {{ include "chart.minio.labels" . | nindent 4 }} +spec: + selector: + matchLabels: {{- include "chart.minio.labels" . | nindent 6 }} + strategy: + type: Recreate + template: + metadata: + labels: {{- include "chart.minio.labels" . | nindent 8 }} + spec: + initContainers: + - name: volume-permissions + image: "{{ .Values.minio.initImage }}" + command: + - /bin/bash + - -ec + - chown -R 1001:1001 /data + securityContext: + runAsUser: 0 + volumeMounts: + - name: data + mountPath: /data + containers: + - name: minio + image: "{{ .Values.minio.image }}" + volumeMounts: + - mountPath: /data + name: data + securityContext: + runAsUser: 1001 + env: + - name: MINIO_SCHEME + value: http + - name: MINIO_FORCE_NEW_KEYS + value: "no" + - name: MINIO_DEFAULT_BUCKETS + value: {{ .Values.minio.defaultBuckets }} + - name: MINIO_ROOT_USER + value: {{ .Values.minio.auth.rootUser }} + - name: MINIO_ROOT_PASSWORD + value: {{ .Values.minio.auth.rootPassword }} + - name: MINIO_BROWSER + value: "on" + - name: MINIO_CONSOLE_PORT_NUMBER + value: {{ .Values.minio.ports.console | quote}} + ports: + - name: minio-api + containerPort: {{ .Values.minio.ports.api }} + protocol: TCP + - name: minio-console + containerPort: {{ .Values.minio.ports.console }} + protocol: TCP + livenessProbe: + httpGet: + path: /minio/health/live + port: minio-api + scheme: "HTTP" + readinessProbe: + tcpSocket: + port: minio-api + {{- if .Values.minio.resources }} + resources: {{- toYaml .Values.minio.resources | nindent 12 }} + {{- end }} + securityContext: + fsGroup: 1001 + volumes: + - name: data + persistentVolumeClaim: + claimName: minio +--- +apiVersion: v1 +kind: Service +metadata: + name: minio + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "chart.minio.labels" . | nindent 4 }} +spec: + type: "ClusterIP" + ports: + - name: minio-api + port: {{ .Values.minio.ports.api }} + targetPort: minio-api + - name: minio-console + port: {{ .Values.minio.ports.console }} + targetPort: minio-console + selector: {{ include "chart.minio.labels" . | nindent 4 }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: minio + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "chart.minio.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ include "common.names.fullname" . }}-minio + volumeMode: Filesystem + volumeName: {{ include "common.names.fullname" . }}-pv-minio + resources: + requests: + storage: {{ .Values.minio.persistence.size | quote }} +--- +{{- if .Values.minio.ingress.enabled }} +apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} +kind: Ingress +metadata: + name: minio + namespace: {{ .Release.Namespace | quote }} + labels: {{ include "chart.minio.labels" . | nindent 4 }} +spec: + ingressClassName: {{ .Values.minio.ingress.ingressClassName | quote }} + rules: + - host: {{ .Values.minio.ingress.host }} + http: + paths: + - backend: + service: + name: minio + port: + name: minio-console + path: / + pathType: ImplementationSpecific +{{- end}} +{{- end }} \ No newline at end of file diff --git a/docker/charts/templates/mysql.yaml b/docker/charts/templates/mysql.yaml new file mode 100644 index 0000000000..6efa0c41e1 --- /dev/null +++ b/docker/charts/templates/mysql.yaml @@ -0,0 +1,156 @@ +{{- if .Values.mysql.enabled }} +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} +kind: Deployment +metadata: + name: mysql + namespace: {{ .Release.Namespace | quote }} + labels: {{ include "chart.mysql.labels" . | nindent 4 }} + +spec: + selector: + matchLabels: {{ include "chart.mysql.labels" . | nindent 6 }} + strategy: + type: Recreate + template: + metadata: + labels: {{ include "chart.mysql.labels" . | nindent 8 }} + spec: + initContainers: + - name: volume-permissions + image: "{{ .Values.mysql.initImage }}" + command: + - /bin/bash + - -ec + - chown -R 1001:1001 /bitnami/mysql + securityContext: + runAsUser: 0 + volumeMounts: + - name: data + mountPath: /bitnami/mysql + containers: + - name: mysql + image: "{{ .Values.mysql.image }}" + volumeMounts: + - mountPath: /bitnami/mysql + name: data + - mountPath: /opt/bitnami/mysql/conf/my.cnf + name: config + subPath: my.cnf + securityContext: + runAsUser: 1001 + env: + - name: MYSQL_USER + value: {{ .Values.mysql.auth.username }} + - name: MYSQL_PASSWORD + value: {{ .Values.mysql.auth.password }} + - name: MYSQL_DATABASE + value: {{ .Values.mysql.auth.database }} + - name: MYSQL_ROOT_PASSWORD + value: {{ .Values.mysql.auth.rootPassword }} + ports: + - name: mysql-api + containerPort: {{ .Values.mysql.ports.api }} + protocol: TCP + livenessProbe: + exec: + command: + - /bin/bash + - -ec + - mysqladmin status -uroot -p"${MYSQL_ROOT_PASSWORD}" + startupProbe: + exec: + command: + - /bin/bash + - -ec + - mysqladmin status -uroot -p"${MYSQL_ROOT_PASSWORD}" + readinessProbe: + exec: + command: + - /bin/bash + - -ec + - mysqladmin status -uroot -p"${MYSQL_ROOT_PASSWORD}" + {{- if .Values.mysql.resources }} + resources: {{- toYaml .Values.mysql.resources | nindent 12 }} + {{- end }} + securityContext: + fsGroup: 1001 + volumes: + - name: data + persistentVolumeClaim: + claimName: mysql + - name: config + configMap: + name: mysql +--- +apiVersion: v1 +kind: Service +metadata: + name: mysql + namespace: {{ .Release.Namespace | quote }} + labels: {{ include "chart.mysql.labels" . | nindent 4 }} +spec: + type: "ClusterIP" + ports: + - name: mysql-api + port: {{ .Values.mysql.ports.api }} + targetPort: mysql-api + protocol: TCP + selector: {{ include "chart.mysql.labels" . | nindent 4 }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mysql + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "chart.mysql.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ include "common.names.fullname" . }}-mysql + volumeMode: Filesystem + volumeName: {{ include "common.names.fullname" . }}-pv-mysql + resources: + requests: + storage: {{ .Values.mysql.persistence.size | quote }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: mysql + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "chart.mysql.labels" . | nindent 4 }} +data: + my.cnf: |- + + [mysqld] + default_authentication_plugin=mysql_native_password + skip-name-resolve + explicit_defaults_for_timestamp + basedir=/opt/bitnami/mysql + plugin_dir=/opt/bitnami/mysql/lib/plugin + port=3306 + socket=/opt/bitnami/mysql/tmp/mysql.sock + datadir=/bitnami/mysql/data + tmpdir=/opt/bitnami/mysql/tmp + max_allowed_packet=16M + bind-address=* + pid-file=/opt/bitnami/mysql/tmp/mysqld.pid + log-error=/opt/bitnami/mysql/logs/mysqld.log + character-set-server=UTF8 + collation-server=utf8_general_ci + slow_query_log=0 + slow_query_log_file=/opt/bitnami/mysql/logs/mysqld.log + long_query_time=10.0 + + [client] + port=3306 + socket=/opt/bitnami/mysql/tmp/mysql.sock + default-character-set=UTF8 + plugin_dir=/opt/bitnami/mysql/lib/plugin + + [manager] + port=3306 + socket=/opt/bitnami/mysql/tmp/mysql.sock + pid-file=/opt/bitnami/mysql/tmp/mysqld.pid + +{{- end}} \ No newline at end of file diff --git a/docker/charts/templates/pv.yaml b/docker/charts/templates/pv.yaml index a4c276bfc7..92057c0541 100644 --- a/docker/charts/templates/pv.yaml +++ b/docker/charts/templates/pv.yaml @@ -20,7 +20,7 @@ {{ end }} {{ if .Values.mysql.enabled }} -{{ include "chart.createPV" (merge (dict "backend" "mysql" "storage" .Values.mysql.primary.persistence.size) $params) }} +{{ include "chart.createPV" (merge (dict "backend" "mysql" "storage" .Values.mysql.persistence.size) $params) }} {{ end }} {{ end }} diff --git a/docker/charts/values.minikube.cn.yaml b/docker/charts/values.minikube.cn.yaml new file mode 100644 index 0000000000..70a6b0d4fd --- /dev/null +++ b/docker/charts/values.minikube.cn.yaml @@ -0,0 +1,38 @@ +# "docker-registry.starwhale.cn" is the Starwhale official docker registry for the China mainland users that syncs all docker images from https://github.com/orgs/star-whale/packages. +image: + registry: docker-registry.starwhale.cn + org: star-whale + +mysql: + enabled: true + initImage: docker-registry.starwhale.cn/bitnami/bitnami-shell:11-debian-11-r6 + image: docker-registry.starwhale.cn/bitnami/mysql:8.0.29-debian-10-r2 + +minio: + enabled: true + initImage: docker-registry.starwhale.cn/bitnami/bitnami-shell:11-debian-11-r6 + image: docker-registry.starwhale.cn/bitnami/minio:2022.6.20-debian-11-r0 + ingress: + enabled: false + +controller: + taskSplitSize: 1 + containerPort: 8082 + ingress: + enabled: false + +minikube: + enabled: true + +mirror: + pypi: + enabled: true + indexUrl: "https://mirrors.aliyun.com/pypi/simple/" + extraIndexUrl: "https://pypi.doubanio.com/simple/" + trustedHost: "mirrors.aliyun.com pypi.doubanio.com" +# If you use the Aliyun ECS, the ECS internal pypi mirror is a better choice. Examples are shown below: +# mirror: +# pypi: +# enabled: true +# indexUrl: "https://mirrors.cloud.aliyuncs.com/pypi/simple/" +# trustedHost: "mirrors.cloud.aliyuncs.com" diff --git a/docker/charts/values.minikube.global.yaml b/docker/charts/values.minikube.global.yaml new file mode 100644 index 0000000000..32b077b7c9 --- /dev/null +++ b/docker/charts/values.minikube.global.yaml @@ -0,0 +1,28 @@ +image: + registry: "ghcr.io" + org: star-whale + +mysql: + enabled: true + image: docker.io/bitnami/mysql:8.0.29-debian-10-r2 + initImage: docker.io/bitnami/bitnami-shell:11-debian-11-r6 + +minio: + enabled: true + image: docker.io/bitnami/minio:2022.6.20-debian-11-r0 + initImage: docker.io/bitnami/bitnami-shell:11-debian-11-r6 + ingress: + enabled: false + +controller: + taskSplitSize: 1 + containerPort: 8082 + ingress: + enabled: false + +minikube: + enabled: true + +mirror: + pypi: + enabled: false diff --git a/docker/charts/values.yaml b/docker/charts/values.yaml index 5ca4fa86e2..ace2e0a0f2 100644 --- a/docker/charts/values.yaml +++ b/docker/charts/values.yaml @@ -1,11 +1,4 @@ -nameOverride: "" -fullnameOverride: "" -commonLabels: {} -commonAnnotations: {} - image: - #registry: "docker.io" - #org: "starwhaleai" registry: "ghcr.io" org: "star-whale" base: @@ -15,30 +8,24 @@ image: mysql: enabled: true - architecture: standalone + initImage: docker.io/bitnami/bitnami-shell:11-debian-11-r6 + image: docker.io/bitnami/mysql:8.0.29-debian-10-r2 auth: rootPassword: root username: starwhale password: starwhale database: starwhale - volumePermissions: - enabled: true - primary: - service: - port: 3306 - persistence: - enabled: true - # can not dynamically render when devMode.createPV=true - # see: https://github.com/helm/helm/issues/2492 - storageClass: local-storage-mysql - size: 8Gi - resources: - limits: - cpu: 2000m - memory: 4Gi - requests: - cpu: 500m - memory: 250Mi + ports: + api: 3306 + persistence: + size: 8Gi + resources: + limits: + cpu: 2000m + memory: 4Gi + requests: + cpu: 500m + memory: 250Mi externalMySQL: host: localhost @@ -47,56 +34,22 @@ externalMySQL: password: "" database: starwhale -nexus3: - enabled: false - nexusPort: 8081 - # ingress: - # hostname: nexus.pre.intra.starwhale.ai - -# todo self define hostname -nexus-repository-manager: - nexus: - nexusPort: 8081 - # hostAliases: - # - nexus.pre.intra.starwhale.ai - env: - - name: NEXUS_SECURITY_RANDOMPASSWORD - value: "false" - resources: - limits: - cpu: 2000m - memory: 4Gi - requests: - cpu: 500m - memory: 250Mi - ingress: - enabled: true - # annotations: - # kubernetes.io/ingress.class: nginx - # hostname: nexus.pre.intra.starwhale.ai - path: / - persistence: - enabled: true - storageSize: 50Gi - minio: enabled: true - containerPorts: + initImage: docker.io/bitnami/bitnami-shell:11-debian-11-r6 + image: docker.io/bitnami/minio:2022.6.20-debian-11-r0 + ports: api: 9000 console: 9001 ingress: enabled: true - hostname: minio.pre.intra.starwhale.ai + host: minio.pre.intra.starwhale.ai ingressClassName: nginx - mode: standalone auth: rootUser: minioadmin rootPassword: minioadmin - volumePermissions: - enabled: true defaultBuckets: starwhale persistence: - storageClass: local-storage-minio size: 50Gi resources: limits: @@ -106,14 +59,14 @@ minio: cpu: 500m memory: 250Mi -externalS3OSS: +externalOSS: host: localhost port: 9000 accessKey: "" secretKey: "" defaultBuckets: starwhale region: "local" - type: "s3" # supported type: s3, aliyun + type: "s3" # supported type: s3, minio and aliyun controller: taskSplitSize: 2 @@ -125,6 +78,11 @@ controller: username: starwhale password: abcd1234 containerPort: 8082 + ingress: + enabled: true + ingressClassName: nginx + host: console.pre.intra.starwhale.ai + path: / storage: agentHostPathRoot: "/mnt/data/starwhale" @@ -134,13 +92,9 @@ nodeSelector: minikube: enabled: false - agentHostPath: "/var/starwhale" - gpuEnabled: false pv: storage: 100Gi rootPath: "/var/starwhale/local-storage" - hostname: - controller: console.minikube.local resources: controller: @@ -163,12 +117,6 @@ serviceAccount: automountServiceAccountToken: false customServiceAccount: foobarbaz -ingress: - enabled: true - ingressClassName: nginx - host: console.pre.intra.starwhale.ai - path: / - mirror: pypi: enabled: true diff --git a/docs/docs/guides/install/helm-charts.md b/docs/docs/guides/install/helm-charts.md index fc19364962..cac33cfbcd 100644 --- a/docs/docs/guides/install/helm-charts.md +++ b/docs/docs/guides/install/helm-charts.md @@ -4,17 +4,17 @@ title: Helm Charts Installation ## 1. Helm Charts -Helm Charts helps you quickly deploy the whole Starwhale instance in Kubernetes. +Starwhale is an MLOps platform. Starwhale Helm Charts help you deploy the whole platform in Kubernetes easily. -- To deploy, upgrade, and maintain the Starwhale `controller`. -- To deploy third-party dependencies, such as minio, mysql, etc. +- Easy to deploy, upgrade and maintain Starwhale controller and agent services. +- Easy to deploy 3rd dependencies, such as minio and MySQL. ## 2. TL; DR ```bash helm repo add starwhale https://star-whale.github.io/charts helm repo update -helm install starwhale starwhale/starwhale -n starwhale --create-namespace +helm upgrade --install starwhale starwhale/starwhale -n starwhale --create-namespace ``` ## 3. Prerequisites @@ -28,9 +28,30 @@ To install the chart with the release name starwhale: ```bash helm repo add starwhale https://star-whale.github.io/charts -helm install starwhale starwhale/starwhale +helm repo update +helm upgrade --install starwhale starwhale/starwhale -n starwhale --create-namespace ``` +We have offered a variety of installation modes in advance. + +- For minikube(all-in-one) and global network: + + ```bash + helm pull starwhale/starwhale --untar --untardir ./charts + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.global.yaml + ``` + +- For minikube(all-in-one) and China's mainland network: + + ```bash + helm pull starwhale/starwhale --untar --untardir ./charts + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.cn.yaml + ``` + + `helm pull` command will pull and untar the chart package, you can modify the values files for the deep customize. + +If you want to install the specified version, you can use `--version` argument. By default, the latest release version will be installed. + ## 5. Uninstalling the Chart To remove the starwhale deployment: @@ -39,60 +60,70 @@ To remove the starwhale deployment: helm delete starwhale ``` -## 6. Parameters +`helm delete` command will not delete the namespace, you can run `kubectl delete namespace starwhale` to cleanup the namespace. -### 6.1 Common parameters +## 6. Upgrading the Chart -| Name | Description | Default Value | -|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------| -| `image.registry` | image registry, you can find Starwhale docker images in docker.io or ghcr.io or docker-registry.starwhale.cn. For users in the mainland of China, please use docker-registry.starwhale.cn registry. | `ghcr.io`| -| `image.org`| image registry org, [starwhaleai](https://hub.docker.com/u/starwhaleai)(docker.io) or [star-whale](https://github.com/orgs/star-whale)(ghcr.io and docker-registry.starwhale.cn) or some custom org name in other registries | `star-whale` | +To upgrade new chart version: -### 6.2 Starwhale parameters +```bash +helm repo update starwhale +``` -| Name | Description | Default Value | -|-----------------------------|--------------------------------------------|----------------------------------| -| `controller.taskSplitSize` | task split size | `2` | -| `controller.auth.username` | admin user name | `starwhale` | -| `controller.auth.password` | admin user password | `abcd1234` | -| `storage.agentHostPathRoot` | persistent host-path for cache data of job | `/mnt/data/starwhale` | -| `mirror.conda.enabled` | conda mirror | `true` | -| `mirror.pypi.enabled` | pypi mirror | `true` | -| `ingress.enabled` | enable ingress for starwhale controller | `true` | -| `ingress.ingressClassName` | ingress class name | `nginx` | -| `ingress.host` | starwhale controller domain | `console.pre.intra.starwhale.ai` | +The `update` command will update the information of available charts locally from the Starwhale chart repository. You can get more version information from [ArtifactHub](https://artifacthub.io/packages/helm/starwhale/starwhale). -### 6.3 Infra parameters +## 7. Parameters -| Name | Description | Default Value | -|----------------------------------|------------------------------------------------------------------------------------------------------------------------|-----------------------| -| `mysql.enabled` | Deploy a standalone mysql instance with starwhale chart. If set mysql.enabled=true, you should provide a pv for mysql. | `true` | -| `mysql.persistence.storageClass` | mysql pvc storageClass | `local-storage-mysql` | -| `externalMySQL.host` | When mysql.enabled is false, chart will use external mysql. | `localhost` | -| `minio.enabled` | Deploy a standalone minio instance with starwhale chart. If set minio.enabled=true, you should provide a pv for minio. | `true` | -| `minio.persistence.storageClass` | minio pvc storageClass | `local-storage-minio` | -| `externalS3OSS.host` | When minio.enabled is false, chart will use external s3 service. | `localhost` | +### 7.1 Common parameters -### 6.4 minikube parameters +| Name| Description | Default Value | +|-----|-------------|---------------| +| `image.registry` | image registry, you can find Starwhale docker images in docker.io, ghcr.io and docker-registry.starwhale.cn.|`ghcr.io`| +| `image.org` | image registry org, [starwhaleai](https://hub.docker.com/u/starwhaleai)(docker.io) or [star-whale](https://github.com/orgs/star-whale)(ghcr.io and docker-registry.starwhale.cn) or some custom org name in other registry.| `star-whale`| -| Name | Description | Default Value | -|--------------------|----------------------------------------|---------------| -| `minikube.enabled` | minikube mode for the all-in-one test. | `false` | +### 7.2 Starwhale controller parameters -In minikube mode, you can easy to build an all-in-one starwhale. Run command example: +| Name | Description | Default Value | +|------|-------------|---------------| +| `controller.taskSplitSize`| task split size| `2`| +| `controller.auth.username`| login username for console web| `starwhale`| +| `controller.auth.password`| login password for console web| `abcd1234`| +| `controller.ingress.enabled`| enable ingress for Starwhale controller | `true` | +| `controller.ingress.ingressClassName` | ingress class name | `nginx`| +| `controller.ingress.host` | Starwhale controller domain | `console.pre.intra.starwhale.ai` | +| `controller.containerPort`| Starwhale console web port | `8082` | -```bash -helm upgrade --install starwhale starwhale/starwhale --namespace starwhale --create-namespace --set minikube.enabled=true -``` +### 7.3 Infra parameters -For users in the mainland of China, please use the following command: +Starwhale provides MySQL and minio infra charts, but the charts only support standalone mode for controller experiential, debugging and development, for example, minikube all-in-one scenario. In production, you should use external high available infra by the `externalMySQL` and `externalOSS` parameters. -```bash -export SWNAME=starwhale SWNS=starwhale -helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio --set image.registry=docker-registry.starwhale.cn --set minio.global.imageRegistry=docker-registry.starwhale.cn --set mysql.global.imageRegistry=docker-registry.starwhale.cn -``` +Standalone Infra for test scenario: + +| Name | Description | Default Value | +|------|-------------|---------------| +| `mysql.enabled` | Deploy a standalone mysql instance with starwhale charts. pv/storageClass will be created automatically. | `true` | +| `minio.enabled` | Deploy a standalone minio instance with starwhale charts. pv/storageClass will be created automatically. | `true` | +| `minio.ingress.enabled` | enable ingress for minio admin web. | `true` | +| `minio.ingress.host` | minio admin web domain | `minio.pre.intra.starwhale.ai` | + +External Infra for production scenario: + +| Name | Description | Default Value | +|------|-------------|---------------| +| `externalMySQL.host` | When mysql.enabled is false, charts will use external mysql. | `localhost` | +| `externalMySQL.port` | port for the external mysql | `3306` | +| `externalMySQL.username` | username for the external mysql | `` | +| `externalMySQL.password` | password for the external mysql | `` | +| `externalMySQL.database` | The System Admin should create a database for Starwhale in the external mysql. | `starwhale` | +| `externalOSS.host` | When minio.enabled is false, charts will use the external OSS service. | `localhost` | +| `externalOSS.port` | port for the external OSS service | `9000` | +| `externalOSS.accessKey` | access key for the external OSS service | `` | +| `externalOSS.secretKey` | secret key for the external OSS service | `` | +| `externalOSS.defaultBuckets` | The System Admin should create a bucket for Starwhale in the external OSS service. | `starwhale` | +| `externalOSS.region` | bucket's region for the external OSS service | `local` | +| `externalOSS.type` | Starwhale supports `s3`, `minio` and `aliyun` OSS types. | `s3` | -### 6.5 dev mode +### 7.4 dev mode | Name | Description | Default Value | |-----------------------------|----------------------------------------------------------|------------------| @@ -105,19 +136,15 @@ Dev mode support creating local path PV automatically when devMode.createPV.enab e.g. ```bash -export SWNAME=starwhale -export SWNS=starwhale -helm install $SWNAME . -n $SWNS --create-namespace \ +helm install starwhale . -n starwhale --create-namespace \ --set devMode.createPV.enabled=true \ --set devMode.createPV.host=pv-host \ - --set devMode.createPV.rootPath=/path/to/pv-storage \ - --set mysql.primary.persistence.storageClass=$SWNAME-mysql \ - --set minio.persistence.storageClass=$SWNAME-minio + --set devMode.createPV.rootPath=/path/to/pv-storage ``` -### 6.6 ServiceAccount +### 7.5 ServiceAccount -Starwhale Controller can only works properly with ServiceAccount with sufficient permissions. The list of permissions required is as follows (take RBAC as an example): +Starwhale Controller can only work properly with ServiceAccount with sufficient permissions. The list of permissions required is as follows (take RBAC as an example): | Resource | API Group | Get | List | Watch | Create | Delete | |----------|-----------|-----|------|-------|--------|--------| diff --git a/docs/docs/quickstart/on-premises.md b/docs/docs/quickstart/on-premises.md index 4e7ebdb67d..67800c5e8f 100644 --- a/docs/docs/quickstart/on-premises.md +++ b/docs/docs/quickstart/on-premises.md @@ -31,47 +31,55 @@ In this tutorial, minikube is used instead of the standard Kubernetes cluster minikube start ``` -For users in the mainland of China, please add these startup parameters:`--image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers`. If there is no kubectl bin in your machine, you may use `minikube kubectl` or `alias kubectl="minikube kubectl --"` alias command. +For users in the mainland of China, please add these startup parameters to speedup download rate:`--image-mirror-country=cn`. If there is no kubectl bin in your machine, you may use `minikube kubectl` or `alias kubectl="minikube kubectl --"` alias command. ### 1.3 Installing Starwhale ```bash helm repo add starwhale https://star-whale.github.io/charts helm repo update -export SWNAME=starwhale SWNS=starwhale -helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio --set image.registry=docker-registry.starwhale.cn --set minio.global.imageRegistry=docker-registry.starwhale.cn --set mysql.global.imageRegistry=docker-registry.starwhale.cn +helm pull starwhale/starwhale --untar --untardir ./charts + +helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.global.yaml +``` + +For users in the mainland of China, please use the following upgrade command: + +```bash +helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.cn.yaml ``` After the installation is successful, the following prompt message appears: ```bash +Release "starwhale" has been upgraded. Happy Helming! NAME: starwhale -LAST DEPLOYED: Thu Jun 23 14:48:02 2022 +LAST DEPLOYED: Tue Feb 14 16:25:03 2023 NAMESPACE: starwhale STATUS: deployed -REVISION: 1 +REVISION: 14 NOTES: ****************************************** Chart Name: starwhale -Chart Version: 0.3.0 -App Version: 0.3.0 +Chart Version: 0.1.0 +App Version: latest Starwhale Image: - - server: docker-registry.starwhale.cn/star-whale/server:0.3.0 + - server: ghcr.io/star-whale/server:latest +Runtime default Image: + - runtime image: ghcr.io/star-whale/starwhale:latest ****************************************** Web Visit: - - starwhale controller: http://console.minikube.local - - minio admin: http://minio.pre.intra.starwhale.ai -Port Forward Visist: +Port Forward Visit: - starwhale controller: - - run: kubectl port-forward --namespace starwhale svc/starwhale-controller 8082:8082 + - run: kubectl port-forward --namespace starwhale svc/controller 8082:8082 - visit: http://localhost:8082 - minio admin: - - run: kubectl port-forward --namespace starwhale svc/starwhale-minio 9001:9001 + - run: kubectl port-forward --namespace starwhale svc/minio 9001:9001 - visit: http://localhost:9001 - mysql: - - run: kubectl port-forward --namespace starwhale svc/starwhale-mysql 3306:3306 + - run: kubectl port-forward --namespace starwhale svc/mysql 3306:3306 - visit: mysql -h 127.0.0.1 -P 3306 -ustarwhale -pstarwhale ****************************************** @@ -79,27 +87,29 @@ Login Info: - starwhale: u:starwhale, p:abcd1234 - minio admin: u:minioadmin, p:minioadmin -*_* Enjoy using Starwhale. *_* +*_* Enjoy to use Starwhale Platform. *_* ``` -Then keep checking the minikube service status until all pods are running. +Then keep checking the minikube service status until all deployments are running. ```bash -kubectl get pods -n starwhale +kubectl get deployments -n starwhale ``` -| NAME | READY | STATUS | RESTARTS | AGE | -|:-----|-------|--------|----------|-----| -|starwhale-controller-7d864558bc-vxvb8|1/1|Running|0|1m -|starwhale-minio-7d45db75f6-7wq9b|1/1|Running|0|2m -|starwhale-mysql-0|1/1|Running|0|2m +| NAME | READY | UP-TO-DATE| AVAILABLE | AGE | +|------|-------|--------|----------|-----| +|controller|1/1|1|1|5m| +|minio|1/1|1|1|5m| +|mysql|1/1|1|1|5m| Make the Starwhale controller accessible locally with the following command: ```bash -kubectl port-forward --namespace starwhale svc/starwhale-controller 8082:8082 +kubectl port-forward --namespace starwhale svc/controller 8082:8082 ``` +When the controller's pod is restarted, the port-forward command needs to be re-executed. + ## 2. Upload the artifacts to the cloud instance Before starting this tutorial, the following three artifacts should already exist on your machine: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/guides/install/helm-charts.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/guides/install/helm-charts.md index 93d913b230..e3e78df7c9 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/guides/install/helm-charts.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/guides/install/helm-charts.md @@ -11,7 +11,7 @@ title: 使用Helm安装Cloud Instance ```bash helm repo add starwhale https://star-whale.github.io/charts helm repo update -helm install starwhale starwhale/starwhale -n starwhale --create-namespace +helm upgrade --install starwhale starwhale/starwhale -n starwhale --create-namespace ``` ## 3. 前置条件 @@ -23,74 +23,98 @@ helm install starwhale starwhale/starwhale -n starwhale --create-namespace ```bash helm repo add starwhale https://star-whale.github.io/charts -helm install starwhale starwhale/starwhale +helm repo update +helm upgrade --install starwhale starwhale/starwhale -n starwhale --create-namespace ``` +我们提供了多种使用不同场景的values.yaml: + +- 针对minikube的all-in-one场景,适合非中国大陆网络环境: + + ```bash + helm pull starwhale/starwhale --untar --untardir ./charts + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.global.yaml + ``` + +- 针对minikube的all-in-one场景,适合中国大陆网络环境: + + ```bash + helm pull starwhale/starwhale --untar --untardir ./charts + helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.cn.yaml + ``` + + `helm pull` 命令会将chart包下载到本地并解压,可以修改其中的values文件,满足个性化场景需求。 + +可以通过 `--version` 参数指定版本,默认会安装最新发布的Charts + ## 5. 卸载Chart ```bash helm delete starwhale ``` -## 6. 配置参数说明 +`helm delete` 命令不支持删除Kubernetes的namespace,需要执行 `kubectl delete namespace starwhale` 命令进行删除。 -### 6.1 基本参数 +## 6. 更新Chart + +```bash +helm repo update starwhale +``` + +`update` 命令从远端的Starwhale Chart仓库中更新本地的charts文件。更详细的版本信息可以参考[ArtifactHub](https://artifacthub.io/packages/helm/starwhale/starwhale)。 + +## 7. 配置参数说明 + +### 7.1 基本参数 |字段|描述|默认值| |---|---|-----| | `image.registry` | 镜像Registry, Starwhale镜像会发布在 docker.io, ghcr.io和docker-registry.starwhale.cn上,中国大陆网络推荐使用docker-registry.starwhale.cn镜像源 | `ghcr.io`| | `image.org` | 镜像的org名字: [starwhaleai](https://hub.docker.com/u/starwhaleai)(docker.io)、[star-whale](https://github.com/orgs/star-whale)(ghcr.io和docker-registry.starwhale.cn) 或者其他在私有registry上定义的镜像org名字 | `star-whale` | -### 6.2 Starwhale参数 +### 7.2 Starwhale controller参数 |字段|描述|默认值| |---|---|-----| -| `mirror.pypi.enabled` | pypi 镜像源设置 | `true` | -| `ingress.enabled` | 使用Ingress | `true` | -| `ingress.ingressClassName` | ingress class name | `nginx` | -| `ingress.host` | Starwhale Controller 的访问域名 | `console.pre.intra.starwhale.ai` | +| `controller.taskSplitSize`| task split size | `2`| +| `controller.auth.username`| console web 用户名| `starwhale`| +| `controller.auth.password`| console web 密码| `abcd1234`| +| `controller.ingress.enabled`| 使用Ingress | `true` | +| `controller.ingress.ingressClassName` | ingress class name | `nginx`| +| `controller.ingress.host` | Starwhale controller 访问域名 | `console.pre.intra.starwhale.ai` | +| `controller.containerPort`| Starwhale console web port | `8082` | + +### 7.3 基础设施参数 -### 6.3 基础设施参数 +Starwhale 提供MySQL和minio的Charts,由于是单例模式,故只能在开发调试场景中使用。如果是生产环境,需要通过externalMySQL和externalOSS参数配置外部的高可用基础设施。 + +测试环境中使用的单例基础设施: |字段|描述|默认值| -|---|---|-----| +|------|-------------|---------------| | `mysql.enabled` | 部署一个单例的MySQL服务,需要为MySQL提供一个PV持久化数据 | `true` | -| `mysql.persistence.storageClass` | mysql pvc storageClass | `local-storage-mysql` | -| `externalMySQL.host` | 当 mysql.enabled 设置为 false, 使用外部的MySQL host | `localhost` | -| `externalMySQL.port` | 使用外部的MySQL port | `3306` | -| `externalMySQL.username` | 外部的MySQL 用户名 | | -| `externalMySQL.password` | 外部的MySQL 密码 | | -| `externalMySQL.database` | 外部的MySQL 的database 名称 | `starwhale` | | `minio.enabled` | 部署一个单例的Minio服务,需要为Minio提供一个PV持久化数据| `true`| -| `minio.persistence.storageClass` | minio pvc storageClass | `local-storage-minio` | -| `externalS3OSS.host`| 当 minio.enabled 设置为 false, 使用外部的基于S3协议的对象存储的host | `localhost` | -| `externalS3OSS.port`| 外部对象存储的port | `9000` | -| `externalS3OSS.accessKey`| 外部对象存储的access key | | -| `externalS3OSS.secretKey`| 外部对象存储的secret key | | -| `externalS3OSS.region`| 外部对象存储的region | `local` | -| `externalS3OSS.type`| 外部对象存储的类型,目前支持s3、aliyun、minio三种OSS | `minio` | +| `minio.ingress.enabled` | 设置minio admin web的Ingress | `true` | +| `minio.ingress.host` | minio admin web 域名 | `minio.pre.intra.starwhale.ai` | -### 6.4 minikube参数 +生产环境中使用的外部基础设施: |字段|描述|默认值| |---|---|-----| -| `minikube.enabled` | 使用minikube模式 | `false` | - -使用minikube模式,可以在单机环境使用minikube安装一个all-in-one的Starwhale,方便进行本地开发、调试。安装命令如下: - -```bash -export SWNAME=starwhale SWNS=starwhale -helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio -``` - -若在中国大陆网络环境,推荐使用如下命令: - -```bash -export SWNAME=starwhale SWNS=starwhale -helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio --set image.registry=docker-registry.starwhale.cn --set minio.global.imageRegistry=docker-registry.starwhale.cn --set mysql.global.imageRegistry=docker-registry.starwhale.cn -``` - -### 6.5 开发模式 +| `externalMySQL.host` | 当 mysql.enabled 设置为 false, 使用外部的MySQL host | `localhost` | +| `externalMySQL.port` | 使用外部的MySQL port | `3306` | +| `externalMySQL.username` | 外部的MySQL 用户名 | `` | +| `externalMySQL.password` | 外部的MySQL 密码 | `` | +| `externalMySQL.database` | 系统管理创建一个给Starwhale独立使用的database | `starwhale` | +| `externalOSS.host`| 当 minio.enabled 设置为 false, 使用外部的基于S3协议的对象存储的host | `localhost` | +| `externalOSS.port`| 外部对象存储的port | `9000` | +| `externalOSS.accessKey`| 外部对象存储的access key | `` | +| `externalOSS.secretKey`| 外部对象存储的secret key | `` | +| `externalOSS.region`| 外部对象存储的region | `local` | +| `externalOSS.defaultBuckets` | 系统管理员创建一个给Starwhale独立使用的bucket | `starwhale` | +| `externalOSS.type`| 外部对象存储的类型,目前支持s3、aliyun、minio三种OSS | `s3` | + +### 7.4 开发模式 |字段|描述|默认值| |---|---|-----| @@ -101,17 +125,13 @@ helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-na 开发模式支持自动创建local path的PV。 ```bash -export SWNAME=starwhale -export SWNS=starwhale -helm install $SWNAME . -n $SWNS --create-namespace \ +helm install starwhale . -n starwhale --create-namespace \ --set devMode.createPV.enabled=true \ --set devMode.createPV.host=pv-host \ - --set devMode.createPV.rootPath=/path/to/pv-storage \ - --set mysql.primary.persistence.storageClass=$SWNAME-mysql \ - --set minio.persistence.storageClass=$SWNAME-minio + --set devMode.createPV.rootPath=/path/to/pv-storage ``` -### 6.6 ServiceAccount +### 7.5 ServiceAccount 为了 Starwhale Controller 能够在 K8s 集群上正常运行,我们需要给 Controller 配置 ServiceAccount,并且分配足够的权限,目前需要的权限列表如下(以RBAC为例) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/quickstart/on-premises.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/quickstart/on-premises.md index dfa743a55f..c6e2252d73 100644 --- a/docs/i18n/zh/docusaurus-plugin-content-docs/current/quickstart/on-premises.md +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/quickstart/on-premises.md @@ -18,50 +18,58 @@ Starwhale Cloud 有两种形态,一种是私有化到用户独立集群的On-P ### 1.2 启动Minikube ```bash -minikube start +minikube start --image-mirror-country=cn ``` -对于中国大陆的网络环境,可以在minikube start命令中增加 `--image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers` 参数来提升镜像下载速度。另外如果本机没有 `kubectl` 命令,可以使用 `minikube kubectl` 代替,也可以采用 `alias kubectl="minikube kubectl --"` 命令,在当前终端中提供 `kubectl` 命令的alias。 +对于非中国大陆网络环境,可以去掉 `--image-mirror-country=cn` 参数,直接使用 `minikube start` 即可。另外如果本机没有 `kubectl` 命令,可以使用 `minikube kubectl` 代替,也可以采用 `alias kubectl="minikube kubectl --"` 命令,在当前终端中提供 `kubectl` 命令的alias。 ### 1.3 使用Helm安装Starwhale Cloud ```bash helm repo add starwhale https://star-whale.github.io/charts helm repo update -export SWNAME=starwhale SWNS=starwhale -helm upgrade --install $SWNAME starwhale/starwhale --namespace $SWNS --create-namespace --set minikube.enabled=true --set mysql.primary.persistence.storageClass=$SWNAME-mysql --set minio.persistence.storageClass=$SWNAME-minio --set image.registry=docker-registry.starwhale.cn --set minio.global.imageRegistry=docker-registry.starwhale.cn --set mysql.global.imageRegistry=docker-registry.starwhale.cn +helm pull starwhale/starwhale --untar --untardir ./charts + +helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.cn.yaml +``` + +对于非中国大陆网络环境,可以使用如下upgrade命令: + +```bash +helm upgrade --install starwhale ./charts/starwhale -n starwhale --create-namespace -f ./charts/starwhale/values.minikube.global.yaml ``` 更详细的Helm Charts参数配置,请参考[使用Helm安装Cloud Instance](../guides/install/helm-charts.md)文档。当成功安装后,会有类似如下信息输出: ```bash +Release "starwhale" has been upgraded. Happy Helming! NAME: starwhale -LAST DEPLOYED: Thu Jun 23 14:48:02 2022 +LAST DEPLOYED: Tue Feb 14 16:25:03 2023 NAMESPACE: starwhale STATUS: deployed -REVISION: 1 +REVISION: 14 NOTES: ****************************************** Chart Name: starwhale -Chart Version: 0.3.0 -App Version: 0.3.0 +Chart Version: 0.1.0 +App Version: latest Starwhale Image: - - server: docker-registry.starwhale.cn/star-whale/server:0.3.0 + - server: docker-registry.starwhale.cn/star-whale/server:latest +Runtime default Image: + - runtime image: docker-registry.starwhale.cn/star-whale/starwhale:latest ****************************************** Web Visit: - - starwhale controller: http://console.minikube.local - - minio admin: http://minio.pre.intra.starwhale.ai -Port Forward Visist: +Port Forward Visit: - starwhale controller: - - run: kubectl port-forward --namespace starwhale svc/starwhale-controller 8082:8082 + - run: kubectl port-forward --namespace starwhale svc/controller 8082:8082 - visit: http://localhost:8082 - minio admin: - - run: kubectl port-forward --namespace starwhale svc/starwhale-minio 9001:9001 + - run: kubectl port-forward --namespace starwhale svc/minio 9001:9001 - visit: http://localhost:9001 - mysql: - - run: kubectl port-forward --namespace starwhale svc/starwhale-mysql 3306:3306 + - run: kubectl port-forward --namespace starwhale svc/mysql 3306:3306 - visit: mysql -h 127.0.0.1 -P 3306 -ustarwhale -pstarwhale ****************************************** @@ -69,27 +77,29 @@ Login Info: - starwhale: u:starwhale, p:abcd1234 - minio admin: u:minioadmin, p:minioadmin -*_* Enjoy using Starwhale. *_* +*_* Enjoy to use Starwhale Platform. *_* ``` -可以检查starwhale namespace下的Pod是否都运行起来,正常情况会产生类似如下的输出: +可以检查starwhale namespace下的Deployments是否都运行起来,正常情况会产生类似如下的输出: ```bash -kubectl get pods -n starwhale +kubectl get deployments -n starwhale ``` -| NAME | READY | STATUS | RESTARTS | AGE | -|:-----|-------|--------|----------|-----| -|starwhale-controller-7d864558bc-vxvb8|1/1|Running|0|1m -|starwhale-minio-7d45db75f6-7wq9b|1/1|Running|0|2m -|starwhale-mysql-0|1/1|Running|0|2m +| NAME | READY | UP-TO-DATE| AVAILABLE | AGE | +|------|-------|--------|----------|-----| +|controller|1/1|1|1|5m| +|minio|1/1|1|1|5m| +|mysql|1/1|1|1|5m| 可以使用kubectl的port-forward命令,在宿主机浏览器直接通过8082端口访问Starwhale Controller Web: ```bash -kubectl port-forward --namespace starwhale svc/starwhale-controller 8082:8082 +kubectl port-forward --namespace starwhale svc/controller 8082:8082 ``` +需要注意,当controller的pod重启时,需要重新执行port-forward命令做端口转发。 + ## 2. 发布Model/Runtime/Dataset到Cloud Instance上 我们使用[Standalone 快速上手](standalone.md)文档中构建出来的Pytorch的Starwhale Runtime,MNIST的Starwhale Model和Starwhale Dataset 作为基础制品,完成在Cloud Instance上的评测任务。 diff --git a/scripts/e2e_test/check_controller_port.sh b/scripts/e2e_test/check_controller_port.sh index 71e7033443..7678f8ef57 100755 --- a/scripts/e2e_test/check_controller_port.sh +++ b/scripts/e2e_test/check_controller_port.sh @@ -6,7 +6,7 @@ then sleep 10 else if kill -9 `ps -ef|grep port-forward | grep -v grep | awk '{print $2}'` ; then echo "kill success and restart port-forward"; fi - nohup kubectl port-forward --namespace starwhale-e2e svc/starwhale-e2e-controller 8082:8082 & + nohup kubectl port-forward --namespace starwhale-e2e svc/controller 8082:8082 & sleep 10 fi diff --git a/scripts/e2e_test/start_test.sh b/scripts/e2e_test/start_test.sh index 0a88ac659d..aa73804ff9 100644 --- a/scripts/e2e_test/start_test.sh +++ b/scripts/e2e_test/start_test.sh @@ -165,14 +165,13 @@ start_starwhale() { pushd ../../docker/charts helm upgrade --install $SWNAME --namespace $SWNS --create-namespace \ --set resources.controller.requests.cpu=700m \ - --set mysql.resources.primary.requests.cpu=300m \ - --set mysql.primary.persistence.storageClass=$SWNAME-mysql \ + --set mysql.resources.requests.cpu=300m \ --set minio.resources.requests.cpu=200m \ - --set minio.persistence.storageClass=$SWNAME-minio \ --set controller.taskSplitSize=1 \ --set minikube.enabled=true \ --set image.registry=$NEXUS_HOSTNAME:$PORT_NEXUS_DOCKER \ --set image.tag=$PYPI_RELEASE_VERSION \ + --set mirror.pypi.enabled=true \ --set mirror.pypi.indexUrl=http://$NEXUS_HOSTNAME:$PORT_NEXUS/repository/$REPO_NAME_PYPI/simple \ --set mirror.pypi.extraIndexUrl=$SW_PYPI_EXTRA_INDEX_URL \ --set mirror.pypi.trustedHost=$NEXUS_HOSTNAME \ @@ -189,18 +188,14 @@ check_controller_service() { break else echo "controller is starting" - kubectl get pods --namespace $SWNS - kubectl get svc --namespace $SWNS - # kubectl get pod -l starwhale.ai/role=controller -n starwhale -o json| jq -r '.items[0].status' - # ready=`kubectl get pod -l starwhale.ai/role=controller -n starwhale -o json| jq -r '.items[0].status.phase'` - # if [[ "$ready" == "Running" ]]; then - # name=`kubectl get pod -l starwhale.ai/role=controller -n starwhale -o json| jq -r '.items[0].metadata.name'` - # kubectl describe pod $name --namespace starwhale - # fi + kubectl -n $SWNS get svc + kubectl -n $SWNS get pods + kubectl -n $SWNS describe deployments/controller + kubectl -n $SWNS logs --tail 10 deployments/controller fi sleep 15 done - nohup kubectl port-forward --namespace $SWNS svc/$SWNAME-starwhale-controller $PORT_CONTROLLER:$PORT_CONTROLLER & + nohup kubectl port-forward --namespace $SWNS svc/controller $PORT_CONTROLLER:$PORT_CONTROLLER & } client_test() { diff --git a/scripts/publish/pub.sh b/scripts/publish/pub.sh index 881af99204..55eb5786d5 100644 --- a/scripts/publish/pub.sh +++ b/scripts/publish/pub.sh @@ -92,16 +92,19 @@ deploy() { helm upgrade --install ${SWNAME//./-} . -n $SWNS --create-namespace \ --set image.registry=$NEXUS_HOSTNAME:$PORT_NEXUS_DOCKER \ --set image.tag=$SERVER_RELEASE_VERSION \ + --set mirror.pypi.enabled=true \ --set mirror.pypi.indexUrl=http://$NEXUS_HOSTNAME:$PORT_NEXUS/repository/$REPO_NAME_PYPI/simple \ --set mirror.pypi.extraIndexUrl=$SW_PYPI_EXTRA_INDEX_URL \ --set mirror.pypi.trustedHost=$NEXUS_HOSTNAME \ + --set mysql.image=docker-registry.starwhale.cn/bitnami/mysql:8.0.29-debian-10-r2 \ + --set mysql.initImage=docker-registry.starwhale.cn/bitnami/bitnami-shell:11-debian-11-r6 \ + --set minio.initImage=docker-registry.starwhale.cn/bitnami/bitnami-shell:11-debian-11-r6 \ + --set minio.image=docker-registry.starwhale.cn/bitnami/minio:2022.6.20-debian-11-r0 \ --set devMode.createPV.enabled=true \ --set devMode.createPV.host=host005-bj01 \ --set devMode.createPV.rootPath=/mnt/data/starwhale/$SWNS/$SWNAME \ - --set mysql.primary.persistence.storageClass=${SWNAME//./-}-mysql \ - --set minio.persistence.storageClass=${SWNAME//./-}-minio \ - --set minio.ingress.hostname=${SWNAME//./-}-minio.pre.intra.starwhale.ai \ - --set ingress.host=${SWNAME//./-}.pre.intra.starwhale.ai + --set minio.ingress.host=${SWNAME//./-}-minio.pre.intra.starwhale.ai \ + --set controller.ingress.host=${SWNAME//./-}.pre.intra.starwhale.ai popd }