From cbfe344ecf36008b8ea49c6665c52c6ad145dcb2 Mon Sep 17 00:00:00 2001 From: "sammy.huang" Date: Mon, 19 Feb 2024 14:14:55 +0800 Subject: [PATCH] enhance: [skip 2e2]add the option of host network mode into builder_gpu.sh file (#30573) Signed-off-by: Sammy Huang --- build/builder_gpu.sh | 4 ++++ ci/jenkins/PublishGPUImages.groovy | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/builder_gpu.sh b/build/builder_gpu.sh index c1927f46dc..e74ee1a912 100755 --- a/build/builder_gpu.sh +++ b/build/builder_gpu.sh @@ -5,6 +5,10 @@ set -euo pipefail # Absolute path to the toplevel milvus directory. toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)") +if [[ "$IS_NETWORK_MODE_HOST" == "true" ]]; then + sed -i '/gpubuilder:/,/^\s*$/s/image: \${IMAGE_REPO}\/milvus-env:gpu-\${OS_NAME}-\${GPU_DATE_VERSION}/&\n network_mode: "host"/' $toplevel/docker-compose.yml +fi + export OS_NAME="${OS_NAME:-ubuntu20.04}" pushd "${toplevel}" diff --git a/ci/jenkins/PublishGPUImages.groovy b/ci/jenkins/PublishGPUImages.groovy index ba0a6c78d0..e9a43c1107 100644 --- a/ci/jenkins/PublishGPUImages.groovy +++ b/ci/jenkins/PublishGPUImages.groovy @@ -34,7 +34,10 @@ pipeline { container('main') { script { sh './build/set_docker_mirror.sh' - sh "./build/builder_gpu.sh /bin/bash -c \"make gpu-install\"" + sh """ + export IS_NETWORK_MODE_HOST="true" + ./build/builder_gpu.sh /bin/bash -c \"make gpu-install\" + """ def date = sh(returnStdout: true, script: 'date +%Y%m%d').trim() def gitShortCommit = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()