diff --git a/.env b/.env index 55717836..7d3f1201 100644 --- a/.env +++ b/.env @@ -20,11 +20,6 @@ USAGE_ENABLED=true # flag to enable observability stack OBSERVE_ENABLED=false -# This flag is used for integration test in which dummy model is used instead of pulling model from GitHub, HuggingFace or ArtiVC. -# The reason is reducing the impact of network trouble during integration test -# The default value is alway false, only set when running `make integration-test` -ITMODE_ENABLED=false - # flag to enable model-backend creating predploy models INITMODEL_ENABLED=false @@ -182,21 +177,3 @@ REGISTRY_VERSION=2.8.3 REGISTRY_HOST=registry REGISTRY_PORT=5000 REGISTRY_EXTERNAL_PORT=5001 - -# controller-model -CONTROLLER_MODEL_IMAGE=instill/controller-model -CONTROLLER_MODEL_VERSION=0.4.0-alpha -CONTROLLER_MODEL_HOST=controller-model -CONTROLLER_MODEL_PRIVATEPORT=3086 - -# etcd -ETCD_IMAGE=quay.io/coreos/etcd -ETCD_VERSION=3.5.8 -ETCD_HOST=etcd -ETCD_CLIENT_PORT=3379 -ETCD_PEER_PORT=3380 -ETCD_CLUSTER_TOKEN=instill-core-etcd -ETCD_CLUSTER_STATE=new -ETCDCTL_API=3 -ETCD_AUTO_COMPACTION_MODE=revision -ETCD_AUTO_COMPACTION_RETENTION=1 diff --git a/.github/workflows/helm-integration-test-backend.yml b/.github/workflows/helm-integration-test-backend.yml index 673e72f7..3adc261f 100644 --- a/.github/workflows/helm-integration-test-backend.yml +++ b/.github/workflows/helm-integration-test-backend.yml @@ -57,14 +57,15 @@ jobs: run: | helm install core charts/core --namespace instill-ai --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ + --set artifactBackend.image.tag=latest \ --set apiGateway.image.tag=latest \ --set mgmtBackend.image.tag=latest \ --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set pipelineBackend.image.tag=latest \ - --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ + --set modelBackend.image.tag=latest \ --set console.image.tag=latest \ - --set rayService.image.tag=${RAY_SERVER_VERSION} \ + --set rayService.image.tag=latest \ --set rayService.headGroupSpec.resources.limits.cpu=0 \ --set rayService.headGroupSpec.resources.limits.memory=2Gi \ --set rayService.headGroupSpec.resources.requests.cpu=0 \ @@ -166,11 +167,12 @@ jobs: run: | helm install core charts/core --namespace instill-ai --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ + --set artifactBackend.image.tag=${ARTIFACT_BACKEND_VERSION} \ --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ --set mgmtBackend.image.tag=${MGMT_BACKEND_VERSION} \ --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ --set console.image.tag=${CONSOLE_VERSION} \ --set rayService.image.tag=${RAY_SERVER_VERSION} \ diff --git a/.github/workflows/helm-integration-test-console.yml b/.github/workflows/helm-integration-test-console.yml index 94da8067..a5574a87 100644 --- a/.github/workflows/helm-integration-test-console.yml +++ b/.github/workflows/helm-integration-test-console.yml @@ -46,14 +46,15 @@ jobs: run: | helm install core charts/core --namespace instill-ai --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ + --set artifactBackend.image.tag=latest \ --set apiGateway.image.tag=latest \ --set mgmtBackend.image.tag=latest \ --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set pipelineBackend.image.tag=latest \ - --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ + --set modelBackend.image.tag=latest \ --set console.image.tag=latest \ - --set rayService.image.tag=${RAY_SERVER_VERSION} \ + --set rayService.image.tag=latest \ --set rayService.headGroupSpec.resources.limits.cpu=0 \ --set rayService.headGroupSpec.resources.limits.memory=2Gi \ --set rayService.headGroupSpec.resources.requests.cpu=0 \ @@ -178,11 +179,12 @@ jobs: run: | helm install core charts/core --namespace instill-ai --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ + --set artifactBackend.image.tag=${ARTIFACT_BACKEND_VERSION} \ --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ --set mgmtBackend.image.tag=${MGMT_BACKEND_VERSION} \ --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ --set console.image.tag=${CONSOLE_VERSION} \ --set rayService.image.tag=${RAY_SERVER_VERSION} \ diff --git a/.github/workflows/integration-test-backend.yml b/.github/workflows/integration-test-backend.yml index b936479f..c1e807ac 100644 --- a/.github/workflows/integration-test-backend.yml +++ b/.github/workflows/integration-test-backend.yml @@ -48,7 +48,7 @@ jobs: - name: Launch Instill Core (latest) run: | - make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true + make latest BUILD=true EDITION=local-ce:test - name: Uppercase component name id: uppercase @@ -102,7 +102,7 @@ jobs: - name: Launch Instill Core (latest) run: | - make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true + make latest BUILD=true EDITION=local-ce:test - name: Uppercase component name id: uppercase @@ -158,7 +158,7 @@ jobs: - name: Launch Instill Core (release) run: | - make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true + make all BUILD=true EDITION=local-ce:test - name: Uppercase component name id: uppercase @@ -220,7 +220,7 @@ jobs: - name: Launch Instill Core (release) run: | - make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true + make all BUILD=true EDITION=local-ce:test - name: Uppercase component name id: uppercase diff --git a/.github/workflows/integration-test-console.yml b/.github/workflows/integration-test-console.yml index 47617a70..819f681b 100644 --- a/.github/workflows/integration-test-console.yml +++ b/.github/workflows/integration-test-console.yml @@ -41,7 +41,7 @@ jobs: - name: Launch Instill Core (latest) run: | - make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true INSTILL_CORE_HOST=api-gateway + make latest BUILD=true EDITION=local-ce:test INSTILL_CORE_HOST=api-gateway - name: Run console integration test (latest) run: | @@ -135,7 +135,7 @@ jobs: - name: Launch Instill Core (release) run: | - make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true INSTILL_CORE_HOST=api-gateway + make all BUILD=true EDITION=local-ce:test INSTILL_CORE_HOST=api-gateway - name: Run console integration test (release) run: | diff --git a/Dockerfile b/Dockerfile index 61978995..58a2036b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,14 +28,13 @@ RUN echo "Instill Core latest codebase cloned on ${CACHE_DATE}" WORKDIR /instill-core -ARG MODEL_BACKEND_VERSION CONTROLLER_MODEL_VERSION +ARG CONTROLLER_MODEL_VERSION +RUN git clone --depth=1 https://github.com/instill-ai/artifact-backend.git RUN git clone --depth=1 https://github.com/instill-ai/api-gateway.git RUN git clone --depth=1 https://github.com/instill-ai/mgmt-backend.git RUN git clone --depth=1 https://github.com/instill-ai/console.git RUN git clone --depth=1 https://github.com/instill-ai/pipeline-backend.git -RUN git clone --depth=1 -b v${MODEL_BACKEND_VERSION} https://github.com/instill-ai/model-backend.git -RUN git clone --depth=1 https://github.com/instill-ai/artifact-backend.git -RUN git clone --depth=1 -b v${CONTROLLER_MODEL_VERSION} https://github.com/instill-ai/controller-model.git +RUN git clone --depth=1 https://github.com/instill-ai/model-backend.git FROM alpine:${ALPINE_VERSION} AS release @@ -56,4 +55,3 @@ RUN git clone --depth=1 -b v${CONSOLE_VERSION} -c advice.detachedHead=false http RUN git clone --depth=1 -b v${PIPELINE_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/pipeline-backend.git RUN git clone --depth=1 -b v${MODEL_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/model-backend.git RUN git clone --depth=1 -b v${ARTIFACT_BACKEND_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/artifact-backend.git -RUN git clone --depth=1 -b v${CONTROLLER_MODEL_VERSION} -c advice.detachedHead=false https://github.com/instill-ai/controller-model.git diff --git a/Makefile b/Makefile index 7c92f550..7a8a96a0 100644 --- a/Makefile +++ b/Makefile @@ -81,8 +81,6 @@ build-latest: ## Build latest images for all Instill Core components --build-arg ALPINE_VERSION=${ALPINE_VERSION} \ --build-arg GOLANG_VERSION=${GOLANG_VERSION} \ --build-arg K6_VERSION=${K6_VERSION} \ - --build-arg MODEL_BACKEND_VERSION=${MODEL_BACKEND_VERSION} \ - --build-arg CONTROLLER_MODEL_VERSION=${CONTROLLER_MODEL_VERSION} \ --build-arg CACHE_DATE="$(shell date)" \ --target latest \ -t ${INSTILL_CORE_IMAGE_NAME}:latest . @@ -116,7 +114,6 @@ build-release: ## Build release images for all Instill Core components --build-arg MODEL_BACKEND_VERSION=${MODEL_BACKEND_VERSION} \ --build-arg ARTIFACT_BACKEND_VERSION=${ARTIFACT_BACKEND_VERSION} \ --build-arg CONSOLE_VERSION=${CONSOLE_VERSION} \ - --build-arg CONTROLLER_MODEL_VERSION=${CONTROLLER_MODEL_VERSION} \ --target release \ -t ${INSTILL_CORE_IMAGE_NAME}:${INSTILL_CORE_VERSION} . @if [ "${BUILD}" = "true" ]; then \ @@ -181,7 +178,7 @@ doc: ## Run Redoc for OpenAPI spec at http://localhost:3001 .PHONY: integration-test-latest integration-test-latest: ## Run integration test on the latest VDP - @make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true + @make latest BUILD=true EDITION=local-ce:test @docker run --rm \ --network instill-network \ --name ${INSTILL_CORE_INTEGRATION_TEST_CONTAINER_NAME}-latest \ @@ -194,7 +191,7 @@ integration-test-latest: ## Run integration test on the latest VDP .PHONY: integration-test-release integration-test-release: ## Run integration test on the release VDP - @make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true + @make all BUILD=true EDITION=local-ce:test @docker run --rm \ --network instill-network \ --name ${INSTILL_CORE_INTEGRATION_TEST_CONTAINER_NAME}-release \ @@ -211,15 +208,15 @@ helm-integration-test-latest: ## Run integration test on t @helm install ${HELM_RELEASE_NAME} charts/core \ --namespace ${HELM_NAMESPACE} --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ --set apiGateway.image.tag=latest \ --set mgmtBackend.image.tag=latest \ --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set artifactBackend.image.tag=latest \ --set pipelineBackend.image.tag=latest \ - --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ + --set modelBackend.image.tag=latest \ --set console.image.tag=latest \ - --set rayService.image.tag=${RAY_RELEASE_TAG} \ + --set rayService.image.tag=${RAY_LATEST_TAG} \ --set tags.observability=false \ --set tags.prometheusStack=false @kubectl rollout status deployment ${HELM_RELEASE_NAME}-api-gateway --namespace ${HELM_NAMESPACE} --timeout=300s @@ -250,12 +247,12 @@ helm-integration-test-release: ## Run integration test on @helm install ${HELM_RELEASE_NAME} charts/core \ --namespace ${HELM_NAMESPACE} --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ --set mgmtBackend.image.tag=${MGMT_BACKEND_VERSION} \ --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set artifactBackend.image.tag=${ARTIFACT_BACKEND_VERSION} \ --set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ --set console.image.tag=${CONSOLE_VERSION} \ --set rayService.image.tag=${RAY_RELEASE_TAG} \ @@ -285,7 +282,7 @@ endif .PHONY: console-integration-test-latest console-integration-test-latest: ## Run console integration test on the latest Instill Core - @make latest BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true INSTILL_CORE_HOST=${API_GATEWAY_HOST} + @make latest BUILD=true EDITION=local-ce:test INSTILL_CORE_HOST=${API_GATEWAY_HOST} @docker run --rm \ -e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \ -e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \ @@ -303,7 +300,7 @@ console-integration-test-latest: ## Run console integration test on the latest .PHONY: console-integration-test-release console-integration-test-release: ## Run console integration test on the release Instill Core - @make all BUILD=true EDITION=local-ce:test ITMODE_ENABLED=true INSTILL_CORE_HOST=${API_GATEWAY_HOST} + @make all BUILD=true EDITION=local-ce:test INSTILL_CORE_HOST=${API_GATEWAY_HOST} @docker run --rm \ -e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \ -e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \ @@ -325,7 +322,6 @@ console-helm-integration-test-latest: ## Run console integ ifeq ($(UNAME_S),Darwin) @helm install ${HELM_RELEASE_NAME} charts/core --namespace ${HELM_NAMESPACE} --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ --set tags.observability=false \ --set tags.prometheusStack=false \ --set apiGateway.image.tag=latest \ @@ -333,16 +329,16 @@ ifeq ($(UNAME_S),Darwin) --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set artifactBackend.image.tag=latest \ --set pipelineBackend.image.tag=latest \ - --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ + --set modelBackend.image.tag=latest \ --set console.image.tag=latest \ - --set rayService.image.tag=${RAY_RELEASE_TAG} \ + --set rayService.image.tag=${RAY_LATEST_TAG} \ --set apiGatewayURL=http://host.docker.internal:${API_GATEWAY_PORT} \ --set console.serverApiGatewayURL=http://host.docker.internal:${API_GATEWAY_PORT} \ --set consoleURL=http://host.docker.internal:${CONSOLE_PORT} else ifeq ($(UNAME_S),Linux) @helm install ${HELM_RELEASE_NAME} charts/core --namespace ${HELM_NAMESPACE} --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ --set tags.observability=false \ --set tags.prometheusStack=false \ --set apiGateway.image.tag=latest \ @@ -350,9 +346,10 @@ else ifeq ($(UNAME_S),Linux) --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set artifactBackend.image.tag=latest \ --set pipelineBackend.image.tag=latest \ - --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ + --set modelBackend.image.tag=latest \ --set console.image.tag=latest \ - --set rayService.image.tag=${RAY_RELEASE_TAG} \ + --set rayService.image.tag=${RAY_LATEST_TAG} \ --set apiGatewayURL=http://localhost:${API_GATEWAY_PORT} \ --set console.serverApiGatewayURL=http://localhost:${API_GATEWAY_PORT} \ --set consoleURL=http://localhost:${CONSOLE_PORT} @@ -403,7 +400,6 @@ console-helm-integration-test-release: ## Run console inte ifeq ($(UNAME_S),Darwin) @helm install ${HELM_RELEASE_NAME} charts/core --namespace ${HELM_NAMESPACE} --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ --set tags.observability=false \ --set tags.prometheusStack=false \ --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ @@ -411,6 +407,7 @@ ifeq ($(UNAME_S),Darwin) --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set artifactBackend.image.tag=${ARTIFACT_BACKEND_VERSION} \ --set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ --set console.image.tag=${CONSOLE_VERSION} \ --set rayService.image.tag=${RAY_RELEASE_TAG} \ @@ -420,7 +417,6 @@ ifeq ($(UNAME_S),Darwin) else ifeq ($(UNAME_S),Linux) @helm install ${HELM_RELEASE_NAME} charts/core --namespace ${HELM_NAMESPACE} --create-namespace \ --set edition=k8s-ce:test \ - --set itMode.enabled=true \ --set tags.observability=false \ --set tags.prometheusStack=false \ --set apiGateway.image.tag=${API_GATEWAY_VERSION} \ @@ -428,6 +424,7 @@ else ifeq ($(UNAME_S),Linux) --set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set artifactBackend.image.tag=${ARTIFACT_BACKEND_VERSION} \ --set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \ + --set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \ --set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \ --set console.image.tag=${CONSOLE_VERSION} \ --set rayService.image.tag=${RAY_RELEASE_TAG} \ diff --git a/charts/core/Chart.lock b/charts/core/Chart.lock index ad1dc2c1..d5a9ed46 100644 --- a/charts/core/Chart.lock +++ b/charts/core/Chart.lock @@ -1,10 +1,7 @@ dependencies: - name: kuberay-operator repository: https://ray-project.github.io/kuberay-helm/ - version: 1.0.0 -- name: etcd - repository: https://charts.bitnami.com/bitnami - version: 8.8.1 + version: 1.1.1 - name: elasticsearch repository: https://helm.elastic.co version: 7.17.3 @@ -23,5 +20,5 @@ dependencies: - name: grafana repository: https://grafana.github.io/helm-charts version: 7.0.19 -digest: sha256:180573d09ca0bf326bd87569c9670c4551da04ee6821541af07190eab68e786f -generated: "2024-04-12T15:46:04.148469+08:00" +digest: sha256:54af8013247538db390dec1acf2dfb3b7b0d70c039e1d57763d689b6f48aea8e +generated: "2024-05-12T04:49:12.15233+08:00" diff --git a/charts/core/Chart.yaml b/charts/core/Chart.yaml index 5c54d423..04e86b1d 100644 --- a/charts/core/Chart.yaml +++ b/charts/core/Chart.yaml @@ -20,13 +20,7 @@ maintainers: dependencies: - name: kuberay-operator repository: https://ray-project.github.io/kuberay-helm/ - version: 1.0.0 - tags: - - model - - name: etcd - repository: https://charts.bitnami.com/bitnami - version: 8.8.1 - condition: etcd.enabled + version: 1.1.1 tags: - model - name: elasticsearch diff --git a/charts/core/charts/etcd-8.8.1.tgz b/charts/core/charts/etcd-8.8.1.tgz deleted file mode 100644 index 2a41d2d7..00000000 Binary files a/charts/core/charts/etcd-8.8.1.tgz and /dev/null differ diff --git a/charts/core/charts/kuberay-operator-1.0.0.tgz b/charts/core/charts/kuberay-operator-1.0.0.tgz deleted file mode 100644 index c8bf9d99..00000000 Binary files a/charts/core/charts/kuberay-operator-1.0.0.tgz and /dev/null differ diff --git a/charts/core/charts/kuberay-operator-1.1.1.tgz b/charts/core/charts/kuberay-operator-1.1.1.tgz new file mode 100644 index 00000000..8b21c4cc Binary files /dev/null and b/charts/core/charts/kuberay-operator-1.1.1.tgz differ diff --git a/charts/core/templates/_helpers.tpl b/charts/core/templates/_helpers.tpl index 4e4a978b..e61ec45d 100644 --- a/charts/core/templates/_helpers.tpl +++ b/charts/core/templates/_helpers.tpl @@ -453,50 +453,3 @@ Allow KubeVersion to be overridden. {{- define "core.ingress.kubeVersion" -}} {{- default .Capabilities.KubeVersion.Version .Values.expose.ingress.kubeVersionOverride -}} {{- end -}} - - -{{/* -Deprecated soon -*/}} -{{/* -controller-model -*/}} -{{- define "core.controllerModel" -}} - {{- printf "%s-controller-model" (include "core.fullname" .) -}} -{{- end -}} - -{{/* controller-model service and container private port */}} -{{- define "core.controllerModel.privatePort" -}} - {{- printf "3086" -}} -{{- end -}} - -{{/* -etcd -*/}} -{{- define "core.etcd" -}} - {{- printf "%s-etcd" (include "core.fullname" .) -}} -{{- end -}} - -{{- define "core.etcd.clientPort" -}} - {{- printf "2379" -}} -{{- end -}} - -{{- define "core.etcd.peerPort" -}} - {{- printf "2380" -}} -{{- end -}} - -{{- define "core.internalTLS.controllerModel.secretName" -}} - {{- if eq .Values.internalTLS.certSource "secret" -}} - {{- .Values.internalTLS.controllerModel.secretName -}} - {{- else -}} - {{- printf "%s-controller-model-internal-tls" (include "core.fullname" .) -}} - {{- end -}} -{{- end -}} - -{{- define "core.modelRepositoryDataVolume" -}} - {{- printf "%s-model-repository-data-volume" (include "core.fullname" .) -}} -{{- end -}} - -{{- define "core.rayCondaDataVolume" -}} - {{- printf "%s-ray-conda-data-volume" (include "core.fullname" .) -}} -{{- end -}} diff --git a/charts/core/templates/controller-model/configmap.yaml b/charts/core/templates/controller-model/configmap.yaml deleted file mode 100644 index a37e1ab2..00000000 --- a/charts/core/templates/controller-model/configmap.yaml +++ /dev/null @@ -1,50 +0,0 @@ -{{- if .Values.tags.model -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "core.controllerModel" . }} - labels: - {{- include "core.labels" . | nindent 4 }} - app.kubernetes.io/component: controller-model -data: - config.yaml: |+ - server: - privateport: {{ template "core.controllerModel.privatePort" . }} - edition: {{ .Values.edition }} - loopinterval: {{ .Values.controllerModel.loopinterval }} - timeout: 120 - debug: {{ ternary "true" "false" (eq (.Values.logLevel | upper) "DEBUG") }} - {{- if .Values.internalTLS.enabled }} - https: - cert: /etc/instill-ai/model/ssl/controller/tls.crt - key: /etc/instill-ai/model/ssl/controller/tls.key - {{- end }} - etcd: - host: {{ template "core.etcd" . }} - port: {{ template "core.etcd.clientPort" . }} - timeout: 5 - modelbackend: - host: {{ template "core.modelBackend" . }} - publicport: {{ template "core.modelBackend.publicPort" . }} - privateport: {{ template "core.modelBackend.privatePort" . }} - {{- if .Values.internalTLS.enabled }} - https: - cert: /etc/instill-ai/model/ssl/model/tls.crt - key: /etc/instill-ai/model/ssl/model/tls.key - {{- end }} - cache: - redis: - redisoptions: - addr: {{ default (include "core.redis.addr" .) .Values.redis.external.addr }} - model: - {{- toYaml .Values.modelBackend.cache | nindent 8 }} - mgmtbackend: - host: {{ template "core.mgmtBackend" . }} - publicport: {{ template "core.mgmtBackend.publicPort" . }} - privateport: {{ template "core.mgmtBackend.privatePort" . }} - {{- if .Values.internalTLS.enabled }} - https: - cert: /etc/instill-ai/model/ssl/mgmt/tls.crt - key: /etc/instill-ai/model/ssl/mgmt/tls.key - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/core/templates/controller-model/deployment.yaml b/charts/core/templates/controller-model/deployment.yaml deleted file mode 100644 index aa244776..00000000 --- a/charts/core/templates/controller-model/deployment.yaml +++ /dev/null @@ -1,150 +0,0 @@ -{{- if .Values.tags.model -}} -{{- $modelRepository := .Values.persistence.persistentVolumeClaim.modelRepository -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "core.controllerModel" . }} - labels: - {{- include "core.labels" . | nindent 4 }} - app.kubernetes.io/component: controller-model - annotations: - rollme: {{ randAlphaNum 5 | quote }} -spec: - strategy: - type: {{ .Values.updateStrategy.type }} - {{- if eq .Values.updateStrategy.type "RollingUpdate" }} - rollingUpdate: - maxSurge: {{ .Values.updateStrategy.rollingUpdate.maxSurge }} - maxUnavailable: {{ .Values.updateStrategy.rollingUpdate.maxUnavailable }} - {{- else}} - rollingUpdate: null - {{- end }} - {{- if not .Values.controllerModel.autoscaling.enabled }} - replicas: {{ .Values.controllerModel.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "core.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: controller-model - template: - metadata: - labels: - {{- include "core.matchLabels" . | nindent 8 }} - app.kubernetes.io/component: controller-model - annotations: - checksum/config: {{ include (print $.Template.BasePath "/controller-model/configmap.yaml") . | sha256sum }} - {{- with .Values.controllerModel.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - # distroless users - # root:x:0:0:root:/root:/sbin/nologin - # nobody:x:65534:65534:nobody:/nonexistent:/sbin/nologin - # nonroot:x:65532:65532:nonroot:/home/nonroot:/sbin/nologin - securityContext: - runAsUser: 65534 - runAsGroup: 65534 - {{- if .Values.controllerModel.serviceAccountName }} - serviceAccountName: {{ .Values.controllerModel.serviceAccountName }} - {{- end }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - automountServiceAccountToken: {{ .Values.controllerModel.automountServiceAccountToken | default false }} - terminationGracePeriodSeconds: 120 - initContainers: - - name: wait-for-dependencies - image: curlimages/curl:8.00.1 - command: ['sh', '-c'] - args: - - > - while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${ETCD_HOST}:${ETCD_CLIENT_PORT}/health)" != "200" ]]; do echo waiting for etcd; sleep 1; done && - while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${MODEL_BACKEND_HOST}:${MODEL_BACKEND_PORT}/v1alpha/health/model)" != "200" ]]; do echo waiting for model-backend; sleep 1; done - env: - - name: MODEL_BACKEND_HOST - value: "{{ template "core.modelBackend" . }}" - - name: MODEL_BACKEND_PORT - value: "{{ template "core.modelBackend.publicPort" . }}" - - name: ETCD_HOST - value: "{{ template "core.etcd" . }}" - - name: ETCD_CLIENT_PORT - value: "{{ template "core.etcd.clientPort" . }}" - containers: - - name: controller-model - image: {{ .Values.controllerModel.image.repository }}:{{ .Values.controllerModel.image.tag }} - imagePullPolicy: {{ .Values.controllerModel.image.pullPolicy }} - readinessProbe: - httpGet: - path: /v1alpha/__readiness - scheme: {{ ternary "https" "http" .Values.internalTLS.enabled | upper }} - port: {{ ternary "https" "http" .Values.internalTLS.enabled }}-private - periodSeconds: 10 - livenessProbe: - httpGet: - path: /v1alpha/__liveness - scheme: {{ ternary "https" "http" .Values.internalTLS.enabled | upper }} - port: {{ ternary "https" "http" .Values.internalTLS.enabled }}-private - periodSeconds: 10 - {{- if .Values.controllerModel.resources }} - resources: - {{- toYaml .Values.controllerModel.resources | nindent 12 }} - {{- end }} - command: [./{{ .Values.controllerModel.commandName.main }}] - ports: - - name: {{ ternary "https" "http" .Values.internalTLS.enabled }}-private - containerPort: {{ template "core.controllerModel.privatePort" . }} - protocol: TCP - volumeMounts: - - name: config - mountPath: {{ .Values.controllerModel.configPath }} - subPath: config.yaml - - name: model-repository - mountPath: /model-repository - {{- if .Values.internalTLS.enabled }} - - name: controller-internal-certs - mountPath: "/etc/instill-ai/model/ssl/controller" - {{- end }} - {{- with .Values.controllerModel.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.controllerModel.extraEnv }} - env: - {{- toYaml .Values.controllerModel.extraEnv | nindent 12 }} - {{- end }} - {{- with .Values.controllerModel.sidecarContainers }} - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: config - configMap: - name: {{ template "core.controllerModel" . }} - - name: controller-internal-certs - secret: - secretName: {{ template "core.internalTLS.controllerModel.secretName" . }} - - name: model-repository - {{- if not .Values.persistence.enabled }} - emptyDir: {} - {{- else if $modelRepository.existingClaim }} - persistentVolumeClaim: - claimName: {{ $modelRepository.existingClaim }} - {{- else }} - persistentVolumeClaim: - claimName: {{ template "core.modelRepositoryDataVolume" . }} - {{- end }} - {{- with .Values.controllerModel.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.controllerModel.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.controllerModel.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.controllerModel.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/core/templates/controller-model/hpa.yaml b/charts/core/templates/controller-model/hpa.yaml deleted file mode 100644 index 5b9724c4..00000000 --- a/charts/core/templates/controller-model/hpa.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if .Values.tags.model -}} -{{- if .Values.controllerModel.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ template "core.controllerModel" . }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ template "core.controllerModel" . }} - labels: - {{- include "core.labels" . | nindent 4 }} - app.kubernetes.io/component: controller-model - minReplicas: {{ .Values.controllerModel.autoscaling.minReplicas }} - maxReplicas: {{ .Values.controllerModel.autoscaling.maxReplicas }} - metrics: -{{- with .Values.controllerModel.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ . }} -{{- end }} -{{- with .Values.controllerModel.autoscaling.targetAverageMemoryUtilization }} - - type: Resource - resource: - name: memory - target: - type: AverageValue - averageValue: {{ . }} -{{- end }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/core/templates/controller-model/service.yaml b/charts/core/templates/controller-model/service.yaml deleted file mode 100644 index 3b767f13..00000000 --- a/charts/core/templates/controller-model/service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- if .Values.tags.model -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "core.controllerModel" . }} - labels: - {{- include "core.labels" . | nindent 4 }} - app.kubernetes.io/component: controller-model - {{- with .Values.controllerModel.serviceAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - ports: - - name: {{ ternary "https" "http" .Values.internalTLS.enabled }}-private - port: {{ template "core.controllerModel.privatePort" . }} - targetPort: {{ template "core.controllerModel.privatePort" . }} - selector: - {{- include "core.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: controller-model -{{- end }} \ No newline at end of file diff --git a/charts/core/templates/model-backend/configmap.yaml b/charts/core/templates/model-backend/configmap.yaml index 7b4696d8..ea5a3c69 100644 --- a/charts/core/templates/model-backend/configmap.yaml +++ b/charts/core/templates/model-backend/configmap.yaml @@ -15,8 +15,6 @@ data: usage: {{- toYaml .Values.usage | nindent 8 }} debug: {{ ternary "true" "false" (eq (.Values.logLevel | upper) "DEBUG") }} - itmode: - enabled: {{ .Values.itMode.enabled }} maxdatasize: {{ .Values.maxDataSizeMB }} workflow: maxworkflowtimeout: {{ .Values.modelBackend.temporal.workflow.maxWorkflowTimeout }} @@ -27,6 +25,7 @@ data: cert: /etc/instill-ai/model/ssl/model/tls.crt key: /etc/instill-ai/model/ssl/model/tls.key {{- end }} + instillcorehost: {{ .Values.modelBackend.instillCoreHost }} log: external: {{ .Values.tags.observability }} otelcollector: @@ -41,9 +40,18 @@ data: cert: /etc/instill-ai/model/ssl/mgmt/tls.crt key: /etc/instill-ai/model/ssl/mgmt/tls.key {{- end }} + artifactbackend: + host: {{ template "core.artifactBackend" . }} + publicport: {{ template "core.artifactBackend.publicPort" . }} + privateport: {{ template "core.artifactBackend.privatePort" . }} + {{- if .Values.internalTLS.enabled }} + https: + cert: /etc/instill-ai/core/ssl/artifact/tls.crt + key: /etc/instill-ai/core/ssl/artifact/tls.key + {{- end }} rayserver: grpcuri: {{ include "core.ray" . }}:{{ include "core.ray.serveGrpcPort" . }} - modelstore: /model-repository + modelstore: /model-backend vram: {{ .Values.rayService.vram }} database: username: {{ default (include "core.database.username" .) .Values.database.external.username }} @@ -69,8 +77,6 @@ data: redis: redisoptions: addr: {{ default (include "core.redis.addr" .) .Values.redis.external.addr }} - model: - {{- toYaml .Values.modelBackend.cache | nindent 8 }} maxbatchsizelimitation: unspecified: 2 classification: 16 @@ -92,25 +98,14 @@ data: {{- toYaml .Values.modelBackend.initModel | nindent 6 }} openfga: host: {{ template "core.openfga" . }} - port: 8080 + port: 8081 {{- if .Values.database.external_replica }} replica: host: {{ template "core.openfga" . }} - port: 8082 + port: 8083 replicationtimeframe: 1 {{- end }} registry: host: {{ template "core.registry" . }} port: {{ template "core.registry.port" . }} - github: - patenabled: {{ .Values.modelBackend.github.patenabled }} - pat: {{ .Values.modelBackend.github.pat }} - controller: - host: {{ template "core.controllerModel" . }} - privateport: {{ template "core.controllerModel.privatePort" . }} - {{- if .Values.internalTLS.enabled }} - https: - cert: /etc/instill-ai/model/ssl/controller/tls.crt - key: /etc/instill-ai/model/ssl/controller/tls.key - {{- end }} {{- end }} diff --git a/charts/core/templates/model-backend/deployment.yaml b/charts/core/templates/model-backend/deployment.yaml index 118c0daa..aea9949f 100644 --- a/charts/core/templates/model-backend/deployment.yaml +++ b/charts/core/templates/model-backend/deployment.yaml @@ -1,6 +1,4 @@ {{- if .Values.tags.model -}} -{{- $modelRepository := .Values.persistence.persistentVolumeClaim.modelRepository -}} -{{- $rayConda := .Values.persistence.persistentVolumeClaim.rayConda -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -127,15 +125,6 @@ spec: value: "{{ template "core.ray" . }}" - name: RAY_SERVER_SERVE_PORT value: "{{ template "core.ray.servePort" . }}" - - name: chmod-model-repostiroy - securityContext: - runAsUser: 0 - runAsGroup: 0 - image: busybox - command: ["sh", "-c", "chmod -R 777 /model-repository"] - volumeMounts: - - name: model-repository - mountPath: /model-repository containers: - name: model-backend-worker image: {{ .Values.modelBackend.image.repository }}:{{ .Values.modelBackend.image.tag }} @@ -152,10 +141,6 @@ spec: - name: config mountPath: {{ .Values.modelBackend.configPath }} subPath: config.yaml - - name: model-repository - mountPath: /model-repository - - name: ray-conda - mountPath: /ray-conda {{- with .Values.modelBackend.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -189,10 +174,6 @@ spec: - name: config mountPath: {{ .Values.modelBackend.configPath }} subPath: config.yaml - - name: model-repository - mountPath: /model-repository - - name: ray-conda - mountPath: /ray-conda {{- if .Values.internalTLS.enabled }} - name: model-internal-certs mountPath: "/etc/instill-ai/model/ssl/model" @@ -211,26 +192,6 @@ spec: - name: config configMap: name: {{ template "core.modelBackend" . }} - - name: model-repository - {{- if not .Values.persistence.enabled }} - emptyDir: {} - {{- else if $modelRepository.existingClaim }} - persistentVolumeClaim: - claimName: {{ $modelRepository.existingClaim }} - {{- else }} - persistentVolumeClaim: - claimName: core-model-repository-data-volume - {{- end }} - - name: ray-conda - {{- if not .Values.persistence.enabled }} - emptyDir: {} - {{- else if $rayConda.existingClaim }} - persistentVolumeClaim: - claimName: {{ $rayConda.existingClaim }} - {{- else }} - persistentVolumeClaim: - claimName: {{ template "core.rayCondaDataVolume" . }} - {{- end }} {{- if .Values.internalTLS.enabled }} - name: model-internal-certs secret: diff --git a/charts/core/templates/model-backend/post-install-job.yaml b/charts/core/templates/model-backend/post-install-job.yaml index e7b9c433..1e9ae266 100644 --- a/charts/core/templates/model-backend/post-install-job.yaml +++ b/charts/core/templates/model-backend/post-install-job.yaml @@ -1,6 +1,5 @@ {{- if .Values.tags.model -}} {{- if .Values.modelBackend.initModel.enabled -}} -{{- $modelRepository := .Values.persistence.persistentVolumeClaim.modelRepository -}} apiVersion: batch/v1 kind: Job metadata: @@ -58,8 +57,6 @@ spec: - name: config mountPath: {{ .Values.modelBackend.configPath }} subPath: config.yaml - - name: model-repository - mountPath: /model-repository env: - name: MODEL_BACKEND_HOST value: "{{ template "core.modelBackend" . }}" @@ -67,16 +64,6 @@ spec: - name: config configMap: name: {{ template "core.modelBackend" . }} - - name: model-repository - {{- if not .Values.persistence.enabled }} - emptyDir: {} - {{- else if $modelRepository.existingClaim }} - persistentVolumeClaim: - claimName: {{ $modelRepository.existingClaim }} - {{- else }} - persistentVolumeClaim: - claimName: {{ template "core.modelRepositoryDataVolume" . }} - {{- end }} {{- with .Values.modelBackend.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/core/templates/pvc.yaml b/charts/core/templates/pvc.yaml index 59404c06..242cbfa7 100644 --- a/charts/core/templates/pvc.yaml +++ b/charts/core/templates/pvc.yaml @@ -1,64 +1,4 @@ {{- if .Values.persistence.enabled }} -{{- if .Values.tags.model -}} -{{- $modelRepository := .Values.persistence.persistentVolumeClaim.modelRepository -}} -{{- if not $modelRepository.existingClaim }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "core.modelRepositoryDataVolume" . }} - annotations: - {{- range $key, $value := $modelRepository.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - {{- if eq .Values.persistence.resourcePolicy "keep" }} - helm.sh/resource-policy: keep - {{- end }} - labels: - {{- include "core.labels" . | nindent 4 }} - app.kubernetes.io/component: model-backend -spec: - accessModes: - - {{ $modelRepository.accessMode }} - resources: - requests: - storage: {{ $modelRepository.size }} - {{- if $modelRepository.storageClass }} - {{- if eq "-" $modelRepository.storageClass }} - storageClassName: "" - {{- else }} - storageClassName: {{ $modelRepository.storageClass }} - {{- end }} - {{- end }} -{{- end }} -{{- $rayConda := .Values.persistence.persistentVolumeClaim.rayConda -}} -{{- if not $rayConda.existingClaim }} ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "core.rayCondaDataVolume" . }} - annotations: - {{- range $key, $value := $rayConda.annotations }} - {{ $key }}: {{ $value | quote }} - {{- end }} - labels: - {{- include "core.labels" . | nindent 4 }} - app.kubernetes.io/component: model-backend -spec: - accessModes: - - {{ $rayConda.accessMode }} - resources: - requests: - storage: {{ $rayConda.size }} - {{- if $rayConda.storageClass }} - {{- if eq "-" $rayConda.storageClass }} - storageClassName: "" - {{- else }} - storageClassName: {{ $rayConda.storageClass }} - {{- end }} - {{- end }} -{{- end }} -{{- end }} {{- if eq .Values.registry.config.storage.type "filesystem" }} {{- $registry := .Values.persistence.persistentVolumeClaim.registry -}} {{- if not $registry.existingClaim }} diff --git a/charts/core/templates/ray-service/ray-service.yaml b/charts/core/templates/ray-service/ray-service.yaml index a8176a05..9e825e34 100644 --- a/charts/core/templates/ray-service/ray-service.yaml +++ b/charts/core/templates/ray-service/ray-service.yaml @@ -1,6 +1,4 @@ {{- if .Values.tags.model -}} -{{- $modelRepository := .Values.persistence.persistentVolumeClaim.modelRepository -}} -{{- $rayConda := .Values.persistence.persistentVolumeClaim.rayConda -}} apiVersion: ray.io/v1 kind: RayCluster metadata: @@ -50,23 +48,6 @@ spec: path: policy.json - key: storage.conf path: storage.conf - - name: ray-conda - {{- if not $.Values.persistence.enabled }} - emptyDir: {} - {{- else if $rayConda.existingClaim }} - persistentVolumeClaim: - claimName: {{ $rayConda.existingClaim }} - {{- else }} - persistentVolumeClaim: - claimName: {{ template "core.rayCondaDataVolume" . }} - {{- end }} - - name: cp-conda-env-configmap - configMap: - name: cp-conda-env - defaultMode: 0777 - items: - - key: cp_conda_env.sh - path: cp_conda_env.sh containers: - name: ray-head # ray-head need to have access to GPU for some reason in order to `podman run` gpu container in ray-worker node @@ -94,14 +75,12 @@ spec: - name: RAY_PROMETHEUS_HOST value: http://core-prometheus:9090 - name: RAY_worker_register_timeout_seconds - value: "360" + value: "3600" + # - name: RAY_REDIS_ADDRESS + # value: {{ template "core.redis.addr" . }} volumeMounts: - mountPath: /etc/containers/ name: podman-configmap - - mountPath: /ray-conda-pack - name: ray-conda - - mountPath: /home/ray/script - name: cp-conda-env-configmap ports: - containerPort: 6379 name: gcs-server @@ -124,10 +103,10 @@ spec: - "/bin/bash" - "-c" - > + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu; if [[ -n ${NVIDIA_VISIBLE_DEVICES} ]]; then - sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml; + sudo env PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH nvidia-ctk cdi generate --library-search-path=$LD_LIBRARY_PATH --output=/etc/cdi/nvidia.yaml; fi; - /home/ray/script/cp_conda_env.sh preStop: exec: command: ["/bin/sh","-c","ray stop"] @@ -138,6 +117,11 @@ spec: maxReplicas: {{ $workerGroupSpecs.maxReplicas }} groupName: {{ $workerGroupSpecs.groupName }} rayStartParams: + {{- if $workerGroupSpecs.gpuWorkerGroup.enabled }} + num-cpus: "0" + {{- else }} + num-cpus: "{{ $workerGroupSpecs.resources.requests.cpu }}" + {{- end }} {{- if $workerGroupSpecs.gpuWorkerGroup.customResource }} resources: {{ $workerGroupSpecs.gpuWorkerGroup.customResource }} {{- end }} @@ -163,16 +147,6 @@ spec: path: registries.conf - key: policy.json path: policy.json - - name: model-repository - {{- if not $.Values.persistence.enabled }} - emptyDir: {} - {{- else if $modelRepository.existingClaim }} - persistentVolumeClaim: - claimName: {{ $modelRepository.existingClaim }} - {{- else }} - persistentVolumeClaim: - claimName: core-model-repository-data-volume - {{- end }} containers: - name: ray-worker image: {{ $.Values.rayService.image.repository }}:{{ $.Values.rayService.image.tag }}{{ ternary "-gpu" "" $workerGroupSpecs.gpuWorkerGroup.enabled }} @@ -182,7 +156,7 @@ spec: imagePullPolicy: {{ $.Values.rayService.image.pullPolicy }} env: - name: RAY_worker_register_timeout_seconds - value: "360" + value: "3600" lifecycle: postStart: exec: @@ -190,8 +164,9 @@ spec: - "/bin/bash" - "-c" - > + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu; if [[ -n ${NVIDIA_VISIBLE_DEVICES} ]]; then - sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml; + sudo env PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH nvidia-ctk cdi generate --library-search-path=$LD_LIBRARY_PATH --output=/etc/cdi/nvidia.yaml; fi; while true; do ray health-check 2>/dev/null; @@ -219,34 +194,10 @@ spec: volumeMounts: - mountPath: /etc/containers/ name: podman-configmap - - mountPath: /model-repository - name: model-repository {{- end }} --- apiVersion: v1 kind: ConfigMap -metadata: - name: cp-conda-env -data: - cp_conda_env.sh: | - #!/bin/bash - # wait for ray cluster to finish initialization - while true; do - ray health-check 2>/dev/null - if [ "$?" = "0" ]; then - break - else - echo "INFO: waiting for ray head to start" - sleep 1 - fi - done - echo "INFO: copying Conda env to the shared folder /ray-conda-pack" - sudo chown -R 1000:100 /ray-conda-pack - cp -r /home/ray/anaconda3/* /ray-conda-pack - echo "INFO: Conda env copying done" ---- -apiVersion: v1 -kind: ConfigMap metadata: name: podman data: diff --git a/charts/core/templates/registry/deployment.yaml b/charts/core/templates/registry/deployment.yaml index f34e3475..a9155910 100644 --- a/charts/core/templates/registry/deployment.yaml +++ b/charts/core/templates/registry/deployment.yaml @@ -74,14 +74,14 @@ spec: scheme: {{ ternary "https" "http" .Values.internalTLS.enabled | upper }} port: {{ template "core.registry.port" . }} periodSeconds: 10 - initialDelaySeconds: 60 + initialDelaySeconds: 10 livenessProbe: httpGet: path: / scheme: {{ ternary "https" "http" .Values.internalTLS.enabled | upper }} port: {{ template "core.registry.port" . }} periodSeconds: 10 - initialDelaySeconds: 60 + initialDelaySeconds: 10 {{- if .Values.registry.resources }} resources: {{- toYaml .Values.registry.resources | nindent 12 }} diff --git a/charts/core/values.yaml b/charts/core/values.yaml index afd945c8..5a5c4946 100644 --- a/charts/core/values.yaml +++ b/charts/core/values.yaml @@ -18,11 +18,6 @@ logLevel: info edition: k8s-ce # -- The maximum data payload to Model cluster (MB) maxDataSizeMB: 32 -# -- Set true to enable integration test mode -# The model-backend will use dummy models -# The mgmt-backend will set a mock up customer_id -itMode: - enabled: false # -- Use this set to assign a list of default pullSecrets imagePullSecrets: expose: @@ -195,14 +190,6 @@ internalTLS: crt: "" # Content of ray's TLS key file, only available when `certSource` is "manual" key: "" - # controller-model related cert configuration - controllerModel: - # secret name for controller-model's tls certs, only available when `certSource` is "secret" - secretName: "" - # Content of controller-model's TLS key file, only available when `certSource` is "manual" - crt: "" - # Content of controller-model's TLS key file, only available when `certSource` is "manual" - key: "" # -- The persistence is enabled by default and a default StorageClass # is needed in the k8s cluster to provision volumes dynamically. # Specify another StorageClass in the "storageClass" or set "existingClaim" @@ -238,20 +225,6 @@ persistence: accessMode: ReadWriteOnce size: 250Gi annotations: {} - modelRepository: - existingClaim: "" - storageClass: "" - subPath: "" - accessMode: ReadWriteOnce - size: 500Gi - annotations: {} - rayConda: - existingClaim: "" - storageClass: "" - subPath: "" - accessMode: ReadWriteOnce - size: 20Gi - annotations: {} # -- The usage collector configuration usage: usageidentifieruid: @@ -491,7 +464,8 @@ modelBackend: # -- The path of configuration file for model-backend configPath: /model-backend/config/config.yaml # -- The database migration version - dbVersion: 4 + dbVersion: 5 + instillCoreHost: # -- The configuration of Temporal Cloud temporal: hostPort: @@ -517,68 +491,6 @@ modelBackend: ownerid: admin enabled: false path: https://raw.githubusercontent.com/instill-ai/instill-core/main/model-hub/model_hub_test.json - cache: - enabled: false - cache_dir: /model-repository/.cache/models - retentionperiod: 24h - github: - patenabled: false - pat: - # -- Add extra env variables - extraEnv: [] - # -- Mount external volumes - # For example, mount a secret containing Certificate root CA to verify database - # TLS connection. - extraVolumes: [] - # - name: my-volume - # secret: - # secretName: my-secret - extraVolumeMounts: [] - # - name: my-volume - # mountPath: /etc/secrets/my-secret - # readOnly: true - # -- Add extra init containers - extraInitContainers: [] - # extraInitContainers: - # - name: ... - # image: ... - # -- Add extra sidecar containers - sidecarContainers: {} - # -- Additional deployment annotations - podAnnotations: {} - # -- Additional service annotations - serviceAnnotations: {} - resources: {} - autoscaling: - enabled: false - minReplicas: - maxReplicas: - targetCPUUtilizationPercentage: - targetAverageMemoryUtilization: - nodeSelector: {} - tolerations: [] - affinity: {} - podDisruptionBudget: - enabled: false - spec: - minAvailable: -controllerModel: - # -- The image of controller - image: - repository: instill/controller-model - tag: 0.4.0-alpha - pullPolicy: IfNotPresent - # -- The command names to be executed - commandName: - main: controller-model - # -- The path of configuration file for mgmt-backend - configPath: /controller-model/config/config.yaml - # -- Set the service account to be used, default if left empty - serviceAccountName: "" - # -- Mount the service account token - automountServiceAccountToken: false - # -- The number of replica for controller - replicaCount: 1 # -- Add extra env variables extraEnv: [] # -- Mount external volumes @@ -604,7 +516,6 @@ controllerModel: # -- Additional service annotations serviceAnnotations: {} resources: {} - loopinterval: 3 autoscaling: enabled: false minReplicas: @@ -622,7 +533,7 @@ controllerModel: # -- The configuration of artifact-backend artifactBackend: # -- Enable artifact-backend deployment - enabled: false + enabled: true # -- The image of artifact-backend image: repository: instill/artifact-backend @@ -757,7 +668,7 @@ rayService: memory: "512Mi" image: repository: instill/ray - version: "2.9.3" + version: "2.21.0" tag: 0.3.0-alpha pullPolicy: IfNotPresent headGroupSpec: @@ -1535,6 +1446,9 @@ registry: secret: i-love-instill-ai relativeurls: false draintimeout: 60s + tls: + certificate: + key: debug: addr: 0.0.0.0:5001 prometheus: @@ -1557,15 +1471,6 @@ registry: idletimeout: 300s tls: enabled: false -# -- The configuration of etcd -etcd: - persistence: - enabled: false - auth: - rbac: - create: false - autoCompactionMode: revision - autoCompactionRetention: 1 tags: model: true observability: true diff --git a/docker-compose-latest.yml b/docker-compose-latest.yml index ae2d8310..f48adae2 100644 --- a/docker-compose-latest.yml +++ b/docker-compose-latest.yml @@ -147,7 +147,7 @@ services: - ${TEMPORAL_PORT}:7233 ray_server: - image: ${RAY_SERVER_IMAGE}:${RAY_RELEASE_TAG} + image: ${RAY_SERVER_IMAGE}:${RAY_LATEST_TAG} ports: - ${RAY_SERVER_CLIENT_PORT}:${RAY_SERVER_CLIENT_PORT} - ${RAY_SERVER_DASHBOARD_PORT}:${RAY_SERVER_DASHBOARD_PORT} @@ -166,19 +166,3 @@ services: registry: ports: - ${REGISTRY_EXTERNAL_PORT}:5000 - - controller_model: - profiles: - - all - - exclude-api-gateway - - exclude-mgmt - - exclude-console - - exclude-pipeline - - exclude-model - - exclude-artifact - image: ${CONTROLLER_MODEL_IMAGE}:latest - environment: - CFG_SERVER_DEBUG: "true" - CFG_SERVER_EDITION: ${EDITION} - ports: - - ${CONTROLLER_MODEL_PRIVATEPORT}:${CONTROLLER_MODEL_PRIVATEPORT} diff --git a/docker-compose.yml b/docker-compose.yml index 4124629a..539d4dc9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,6 @@ networks: volumes: elasticsearch_data: name: elasticsearch-data - model_repository: - name: model-repository - model_cache: - name: model-cache - ray_conda: - name: ray-conda services: api_gateway: @@ -229,11 +223,11 @@ services: CFG_SERVER_PUBLICPORT: ${MODEL_BACKEND_PUBLICPORT} CFG_SERVER_DEBUG: "false" CFG_SERVER_MAXDATASIZE: ${MAX_DATA_SIZE} - CFG_SERVER_ITMODE_ENABLED: ${ITMODE_ENABLED} CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED} CFG_SERVER_EDITION: ${EDITION} + CFG_SERVER_INSTILLCOREHOST: http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} CFG_RAYSERVER_GRPCURI: ${RAY_SERVER_HOST}:${RAY_SERVER_SERVE_GRPC_PORT} - CFG_RAYSERVER_MODELSTORE: /model-repository + CFG_RAYSERVER_MODELSTORE: /model-backend CFG_RAYSERVER_VRAM: ${RAY_SERVER_VRAM} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} CFG_DATABASE_PORT: ${POSTGRESQL_PORT} @@ -252,10 +246,6 @@ services: ./model-backend-migrate ./model-backend-init ./model-backend - volumes: - - model_repository:/model-repository - - model_cache:/.cache - - ray_conda:/ray-conda healthcheck: test: [ @@ -287,7 +277,6 @@ services: restart: unless-stopped environment: CFG_SERVER_DEBUG: "false" - CFG_SERVER_ITMODE_ENABLED: ${ITMODE_ENABLED} CFG_RAYSERVER_VRAM: ${RAY_SERVER_VRAM} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} CFG_DATABASE_PORT: ${POSTGRESQL_PORT} @@ -297,10 +286,6 @@ services: CFG_CACHE_REDIS_REDISOPTIONS_ADDR: ${REDIS_HOST}:${REDIS_PORT} CFG_LOG_EXTERNAL: ${OBSERVE_ENABLED} CFG_LOG_OTELCOLLECTOR_PORT: ${OTEL_COLLECTOR_PORT} - volumes: - - model_repository:/model-repository - - model_cache:/.cache - - ray_conda:/ray-conda entrypoint: ./model-backend-worker depends_on: temporal: @@ -329,6 +314,9 @@ services: CFG_SERVER_DEBUG: "false" CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED} CFG_SERVER_EDITION: ${EDITION} + MGMT_BACKEND_HOST: ${MGMT_BACKEND_HOST} + MGMT_BACKEND_PUBLICPORT: ${MGMT_BACKEND_PUBLICPORT} + MGMT_BACKEND_PRIVATEPORT: ${MGMT_BACKEND_PRIVATEPORT} CFG_REGISTRY_HOST: ${REGISTRY_HOST} CFG_REGISTRY_PORT: ${REGISTRY_PORT} CFG_DATABASE_HOST: ${POSTGRESQL_HOST} @@ -357,6 +345,8 @@ services: depends_on: pg_sql: condition: service_healthy + mgmt_backend: + condition: service_healthy console: container_name: ${CONSOLE_HOST} @@ -432,7 +422,7 @@ services: - RAY_GRAFANA_HOST=http://${GRAFANA_HOST}:${GRAFANA_PORT} - RAY_PROMETHEUS_HOST=http://${PROMETHEUS_HOST}:${PROMETHEUS_PORT} - RAY_GRAFANA_IFRAME_HOST=http://localhost:${GRAFANA_PORT} - - RAY_worker_register_timeout_seconds=360 + - RAY_worker_register_timeout_seconds=3600 entrypoint: ["/bin/bash", "-c"] command: | 'if [[ $${NVIDIA_VISIBLE_DEVICES} == all ]]; then @@ -442,8 +432,6 @@ services: serve start --http-host=0.0.0.0 --grpc-port ${RAY_SERVER_SERVE_GRPC_PORT} --grpc-servicer-functions ray_pb2_grpc.add_RayServiceServicer_to_server && tail -f /dev/null' volumes: - - model_repository:/model-repository - - ray_conda:/home/ray/anaconda3/ - /var/lib/containers:/var/lib/containers - ${CONFIG_DIR_PATH}/registry/registries.conf:/etc/containers/registries.conf healthcheck: @@ -577,39 +565,3 @@ services: depends_on: redis: condition: service_healthy - - controller_model: - container_name: ${CONTROLLER_MODEL_HOST} - image: ${CONTROLLER_MODEL_IMAGE}:${CONTROLLER_MODEL_VERSION} - restart: unless-stopped - environment: - CFG_SERVER_DEBUG: "false" - CFG_SERVER_EDITION: ${EDITION} - CFG_DATABASE_HOST: ${POSTGRESQL_HOST} - CFG_DATABASE_PORT: ${POSTGRESQL_PORT} - CFG_DATABASE_USERNAME: postgres - CFG_DATABASE_PASSWORD: password - CFG_ETCD_HOST: ${ETCD_HOST} - CFG_ETCD_PORT: ${ETCD_CLIENT_PORT} - CFG_LOG_EXTERNAL: ${OBSERVE_ENABLED} - CFG_LOG_OTELCOLLECTOR_PORT: ${OTEL_COLLECTOR_PORT} - entrypoint: ./controller-model - volumes: - - model_repository:/model-repository - - etcd: - container_name: ${ETCD_HOST} - image: ${ETCD_IMAGE}:v${ETCD_VERSION} - restart: unless-stopped - environment: - ETCD_NAME: ${ETCD_HOST} - ETCD_ADVERTISE_CLIENT_URLS: http://${ETCD_HOST}:${ETCD_CLIENT_PORT} - ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:${ETCD_CLIENT_PORT} - ETCD_INITIAL_ADVERTISE_PEER_URLS: http://${ETCD_HOST}:${ETCD_PEER_PORT} - ETCD_LISTEN_PEER_URLS: http://0.0.0.0:${ETCD_PEER_PORT} - ETCD_INITIAL_CLUSTER_TOKEN: ${ETCD_CLUSTER_TOKEN} - ETCD_INITIAL_CLUSTER_STATE: ${ETCD_CLUSTER_STATE} - ETCD_INITIAL_CLUSTER: ${ETCD_HOST}=http://${ETCD_HOST}:${ETCD_PEER_PORT} - ETCDCTL_API: ${ETCDCTL_API} - ETCD_AUTO_COMPACTION_MODE: ${ETCD_AUTO_COMPACTION_MODE} - ETCD_AUTO_COMPACTION_RETENTION: ${ETCD_AUTO_COMPACTION_RETENTION} diff --git a/model-hub/model_hub_gpu.json b/model-hub/model_hub_gpu.json index 6706b0a8..33eee79a 100644 --- a/model-hub/model_hub_gpu.json +++ b/model-hub/model_hub_gpu.json @@ -2,91 +2,89 @@ { "id": "mobilenetv2", "description": "An efficient image classification model, pretrained on ImageNet dataset which contains images from 1,000 classes.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_CLASSIFICATION", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-mobilenetv2-dvc", - "tag": "v0.7.0-ray-gpu" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "CPU", + "version": "v0.1.0", + "configuration": {} }, { "id": "yolov7", "description": "YOLOv7 is a state-of-the-art real-time object detector pretrained on MS COCO dataset with 80 object classes.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_DETECTION", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-yolov7-dvc", - "tag": "v0.7.0-ray-gpu" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "CPU", + "version": "v0.1.0", + "configuration": {} }, { "id": "yolov7-stomata", "description": "The instance segmentation model based on Yolov7, fine-tuned on the custom dataset with 337 images and 1 object class 'stomata'.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_INSTANCE_SEGMENTATION", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-stomata-instance-segmentation-dvc", - "tag": "v0.7.0-yolov7-mask-ray-gpu" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "NVIDIA_TESLA_T4", + "version": "v0.1.0", + "configuration": {} }, { "id": "llava-1-6-13b", "description": "LLaVa-13b, from liuhaotian, is trained to generate text based on your prompts with miltimodal input.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_VISUAL_QUESTION_ANSWERING", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-llava-13b-dvc", - "tag": "f16-gpuAuto-transformer-ray-v0.11.0-hotfix3" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "NVIDIA_A100", + "version": "v0.1.0", + "configuration": {} }, { "id": "stable-diffusion-xl", "description": "Stable-Diffusion-XL, from StabilityAI, is trained to generate image based on your prompts.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_TEXT_TO_IMAGE", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-diffusion-xl-dvc", - "tag": "f16-gpuAuto-diffusers-ray-v0.8.0" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "NVIDIA_L4", + "version": "v0.1.0", + "configuration": {} }, { "id": "llama2-7b-chat", "description": "Llama2-7b-Chat, from meta, is trained to generate text based on your prompts.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_TEXT_GENERATION_CHAT", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-llama2-7b-chat-dvc", - "tag": "f16-gpuAuto-transformer-ray-v0.8.0" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "NVIDIA_L4", + "version": "v0.1.0", + "configuration": {} }, { "id": "zephyr-7b", "description": "Zephyr-7b, from Huggingface, is trained to generate text based on your prompts.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_TEXT_GENERATION_CHAT", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-zephyr-7b-dvc", - "tag": "f16-1gpu-transformer-ray-v0.11.0" - } - }, - { - "id": "controlnet-canny", - "description": "ControlNet-Canny Version, from Lvmin, is trained to generate image based on your prompts and images.", - "task": "TASK_IMAGE_TO_IMAGE", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-controlnet-dvc", - "tag": "f16-gpuAuto-diffusers-ray-v0.8.0" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "NVIDIA_L4", + "version": "v0.1.0", + "configuration": {} }, { "id": "llamacode-7b", "description": "Llamacode-7b, from Huggingface, is trained to generate text based on your prompts.", + "model_definition": "model-definitions/container", + "visibility": "VISIBILITY_PUBLIC", "task": "TASK_TEXT_GENERATION_CHAT", - "model_definition": "model-definitions/github", - "configuration": { - "repository": "instill-ai/model-codellama-7b-dvc", - "tag": "f16-1gpu-transformer-ray-v0.11.0" - } + "region": "REGION_GCP_EUROPE_WEST4", + "hardware": "NVIDIA_L4", + "version": "v0.1.0", + "configuration": {} } ]