From af1941b6fed27b68eada0efcc6396df44bfe979b Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Tue, 5 Jan 2021 15:25:01 +0800 Subject: [PATCH] Add docker for indexbuilder Signed-off-by: zhenshan.cao --- .env | 1 - .jenkins/modules/Publish/Publish.groovy | 4 ++++ .../Regression/PythonRegression.groovy | 1 + build/docker/deploy/.env | 1 + build/docker/deploy/docker-compose.yml | 16 ++++++++++++++ build/docker/deploy/indexbuilder/DockerFile | 22 +++++++++++++++++++ docker-compose.yml | 2 -- 7 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 build/docker/deploy/indexbuilder/DockerFile diff --git a/.env b/.env index 0ce6e0ff20..38ea72e55a 100644 --- a/.env +++ b/.env @@ -6,4 +6,3 @@ LATEST_DATE_VERSION=latest MINIO_ADDRESS=minio:9000 PULSAR_ADDRESS=pulsar://pulsar:6650 ETCD_ADDRESS=etcd:2379 -MASTER_ADDRESS=localhost:53100 diff --git a/.jenkins/modules/Publish/Publish.groovy b/.jenkins/modules/Publish/Publish.groovy index e60bf34d28..ad209ccf6b 100644 --- a/.jenkins/modules/Publish/Publish.groovy +++ b/.jenkins/modules/Publish/Publish.groovy @@ -17,6 +17,10 @@ dir ('build/docker/deploy') { sh 'docker-compose build --force-rm master' sh 'docker-compose push master' + sh 'docker pull ${SOURCE_REPO}/indexbuilder:${SOURCE_TAG} || true' + sh 'docker-compose build --force-rm indexbuilder' + sh 'docker-compose push indexbuilder' + sh 'docker pull ${SOURCE_REPO}/proxy:${SOURCE_TAG} || true' sh 'docker-compose build --force-rm proxy' sh 'docker-compose push proxy' diff --git a/.jenkins/modules/Regression/PythonRegression.groovy b/.jenkins/modules/Regression/PythonRegression.groovy index cb7d5a06fe..f726d92da1 100644 --- a/.jenkins/modules/Regression/PythonRegression.groovy +++ b/.jenkins/modules/Regression/PythonRegression.groovy @@ -6,6 +6,7 @@ try { dir ('build/docker/deploy') { sh 'docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} pull' sh 'docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} up -d master' + sh 'docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} up -d indexbuilder' sh 'docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} up -d proxy' sh 'docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} run -e QUERY_NODE_ID=1 -d querynode' sh 'docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} run -e QUERY_NODE_ID=2 -d querynode' diff --git a/build/docker/deploy/.env b/build/docker/deploy/.env index 4a3735af88..fe63196a78 100644 --- a/build/docker/deploy/.env +++ b/build/docker/deploy/.env @@ -6,3 +6,4 @@ PULSAR_ADDRESS=pulsar://pulsar:6650 ETCD_ADDRESS=etcd:2379 MASTER_ADDRESS=master:53100 MINIO_ADDRESS=minio:9000 +INDEX_BUILDER_ADDRESS=indexbuider:31000 diff --git a/build/docker/deploy/docker-compose.yml b/build/docker/deploy/docker-compose.yml index 045924ad24..9eaf635e9c 100644 --- a/build/docker/deploy/docker-compose.yml +++ b/build/docker/deploy/docker-compose.yml @@ -11,6 +11,7 @@ services: environment: PULSAR_ADDRESS: ${PULSAR_ADDRESS} ETCD_ADDRESS: ${ETCD_ADDRESS} + INDEX_BUILDER_ADDRESS: ${INDEX_BUILDER_ADDRESS} networks: - milvus @@ -27,6 +28,21 @@ services: networks: - milvus + indexbuilder: + image: ${TARGET_REPO}/indexbuilder:${TARGET_TAG} + build: + context: ../../../ + dockerfile: build/docker/deploy/indexbuilder/DockerFile + cache_from: + - ${SOURCE_REPO}/indexbuilder:${SOURCE_TAG} + environment: + MASTER_ADDRESS: ${MASTER_ADDRESS} + ETCD_ADDRESS: ${ETCD_ADDRESS} + MINIO_ADDRESS: ${MINIO_ADDRESS} + + networks: + - milvus + querynode: image: ${TARGET_REPO}/querynode:${TARGET_TAG} build: diff --git a/build/docker/deploy/indexbuilder/DockerFile b/build/docker/deploy/indexbuilder/DockerFile new file mode 100644 index 0000000000..4d40f27a98 --- /dev/null +++ b/build/docker/deploy/indexbuilder/DockerFile @@ -0,0 +1,22 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +FROM alpine:3.12.1 + +COPY ./bin/indexbuilder /milvus-distributed/bin/indexbuilder + +COPY ./configs/ /milvus-distributed/configs/ + +WORKDIR /milvus-distributed/ + +CMD ["./bin/indexbuilder"] + +EXPOSE 31000 diff --git a/docker-compose.yml b/docker-compose.yml index e2b44897f2..cba23befab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,6 @@ services: <<: *ccache PULSAR_ADDRESS: ${PULSAR_ADDRESS} ETCD_ADDRESS: ${ETCD_ADDRESS} - MASTER_ADDRESS: ${MASTER_ADDRESS} MINIO_ADDRESS: ${MINIO_ADDRESS} volumes: &ubuntu-volumes - .:/go/src/github.com/zilliztech/milvus-distributed:delegated @@ -46,7 +45,6 @@ services: environment: PULSAR_ADDRESS: ${PULSAR_ADDRESS} ETCD_ADDRESS: ${ETCD_ADDRESS} - MASTER_ADDRESS: ${MASTER_ADDRESS} MINIO_ADDRESS: ${MINIO_ADDRESS} volumes: - .:/go/src/github.com/zilliztech/milvus-distributed:delegated