milvus/build/builder.sh
sammy.huang 62fdfe125f
enhance: [skip e2e]to add some comments (#29440)
there are two purposes for this PR
1. to add some comments on variable in the .env file. 
2. avoid git merge conflict when one PR update the value of DATE_VERSION
and LATEST_DATE_VERSION and meanwhile other PR updates the value of
GPU_DATE_VERSION and LATEST_GPU_DATE_VERSION , especailly when github
actions Publish Builder and Publish gpu Builder occur at same time

Signed-off-by: Sammy Huang <sammy.huang@zilliz.com>
2023-12-25 10:28:47 +08:00

44 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Absolute path to the toplevel milvus directory.
toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)")
if [[ -f "$toplevel/.env" ]]; then
set -a # automatically export all variables from .env
source $toplevel/.env
set +a # stop automatically exporting
fi
pushd "${toplevel}"
if [[ "${1-}" == "pull" ]]; then
docker-compose pull --ignore-pull-failures builder
exit 0
fi
if [[ "${1-}" == "down" ]]; then
docker-compose down
exit 0
fi
PLATFORM_ARCH="${PLATFORM_ARCH:-${IMAGE_ARCH}}"
export IMAGE_ARCH=${PLATFORM_ARCH}
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache"
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-go-mod"
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-vscode-extensions"
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-conan"
chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker}"
docker-compose pull --ignore-pull-failures builder
if [[ "${CHECK_BUILDER:-}" == "1" ]]; then
docker-compose build builder
fi
docker-compose run --no-deps --rm builder "$@"
popd