Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ray): update infra to accommodate containerized model serving #494

Merged
merged 16 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
10 changes: 6 additions & 4 deletions .github/workflows/helm-integration-test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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} \
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/helm-integration-test-console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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} \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration-test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-test-console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
35 changes: 16 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -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} \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -325,34 +322,34 @@ 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 \
--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 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 \
--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 apiGatewayURL=http://localhost:${API_GATEWAY_PORT} \
--set console.serverApiGatewayURL=http://localhost:${API_GATEWAY_PORT} \
--set consoleURL=http://localhost:${CONSOLE_PORT}
Expand Down Expand Up @@ -403,14 +400,14 @@ 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} \
--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} \
Expand All @@ -420,14 +417,14 @@ 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} \
--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} \
Expand Down
9 changes: 3 additions & 6 deletions charts/core/Chart.lock
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
8 changes: 1 addition & 7 deletions charts/core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file removed charts/core/charts/etcd-8.8.1.tgz
Binary file not shown.
Binary file removed charts/core/charts/kuberay-operator-1.0.0.tgz
Binary file not shown.
Binary file added charts/core/charts/kuberay-operator-1.1.1.tgz
Binary file not shown.
Loading
Loading