Skip to content

Commit 85f9fa7

Browse files
authored
Fix bug for ubuntu24/windows release workflow (#485)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
1 parent beb0eb9 commit 85f9fa7

2 files changed

Lines changed: 37 additions & 6 deletions

File tree

.github/workflows/release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
timeout-minutes: 100
137137
env:
138138
BUILD_SHARED_LIBS: ON
139+
MILVUS_USE_PYTHON_VENV: ON
139140
strategy:
140141
fail-fast: false
141142
matrix:
@@ -152,11 +153,13 @@ jobs:
152153
sh scripts/install_deps.sh
153154
- name: Build
154155
run: |
156+
. ~/.venv/bin/activate
155157
export MILVUS_SDK_VERSION="${{ needs.select-targets.outputs.version }}"
156158
make test-release
157159
cmake --build cmake_build --target package --parallel 4
158160
- name: Verify package
159161
run: |
162+
. ~/.venv/bin/activate
160163
sh scripts/verify_package_linux.sh cmake_build/Pack
161164
- name: Release
162165
uses: ncipollo/release-action@v1
@@ -251,7 +254,7 @@ jobs:
251254
conan install . -of build -s build_type=Release -s compiler.cppstd=14 -s:b build_type=Release -s:b compiler.cppstd=17 -o "&:shared=True" -o "&:with_tests=True" -c tools.cmake.cmaketoolchain:generator=Ninja -c tools.build:jobs=4 --build=missing
252255
if errorlevel 1 exit /b %errorlevel%
253256
if not exist build\build\Release\generators\conan_toolchain.cmake exit /b 1
254-
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build\build\Release\generators\conan_toolchain.cmake -DMILVUS_BUILD_TEST=YES -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_FROM_CONAN=ON -DMILVUS_SDK_VERSION=${{ needs.select-targets.outputs.version }} -G Ninja %LAUNCHER%
257+
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build\build\Release\generators\conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DMILVUS_BUILD_TEST=YES -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_FROM_CONAN=ON -DMILVUS_SDK_VERSION=${{ needs.select-targets.outputs.version }} -G Ninja %LAUNCHER%
255258
if errorlevel 1 exit /b %errorlevel%
256259
cmake --build build
257260
if errorlevel 1 exit /b %errorlevel%

scripts/install_deps.sh

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,28 @@ check_sudo() {
88
fi
99
}
1010

11+
activate_python_venv() {
12+
if [ "${MILVUS_USE_PYTHON_VENV}" != "ON" ] ; then
13+
return 0
14+
fi
15+
16+
if [ -n "${VIRTUAL_ENV}" ] ; then
17+
return 0
18+
fi
19+
20+
python3 -m venv "${HOME}/.venv" || exit 1
21+
. "${HOME}/.venv/bin/activate" || exit 1
22+
}
23+
1124
install_linux_cmake_clang_toolchain() {
1225
echo 'Pip install clang toolchain.'
13-
pip3 install --user -U pip scikit-build wheel
14-
pip3 install --user cmake clang-tidy~=17.0 clang-format~=17.0
26+
if [ -n "${VIRTUAL_ENV}" ] ; then
27+
pip3 install -U pip scikit-build wheel
28+
pip3 install cmake clang-tidy~=17.0 clang-format~=17.0
29+
else
30+
pip3 install --user -U pip scikit-build wheel
31+
pip3 install --user cmake clang-tidy~=17.0 clang-format~=17.0
32+
fi
1533
}
1634

1735
ensure_conan_default_profile() {
@@ -96,12 +114,17 @@ install_deps_for_ubuntu_common() {
96114
fi
97115

98116
${SUDO} apt-get -y install gpg wget gcc g++ ccache make \
99-
libssl-dev iwyu lcov git python3-pip clang-format clang-tidy
117+
libssl-dev iwyu lcov git python3-pip python3-venv clang-format clang-tidy
118+
activate_python_venv
100119
install_linux_cmake_clang_toolchain
101120
install_conan
102121

103122
echo 'Pip install docker for integration tests.'
104-
pip3 install --user "docker>=7.0.0"
123+
if [ -n "${VIRTUAL_ENV}" ] ; then
124+
pip3 install "docker>=7.0.0"
125+
else
126+
pip3 install --user "docker>=7.0.0"
127+
fi
105128
}
106129

107130
install_deps_for_ubuntu() {
@@ -111,11 +134,16 @@ install_deps_for_ubuntu() {
111134
install_deps_for_fedora_common() {
112135
check_sudo
113136
${SUDO} dnf -y install gcc gcc-c++ python2 gpg wget ccache make openssl-devel which lcov git rpm-build cpio python3-pip perl perl-core
137+
activate_python_venv
114138
install_linux_cmake_clang_toolchain
115139
install_conan
116140

117141
echo 'Pip install docker for integration tests.'
118-
pip3 install --user "docker>=7.0.0"
142+
if [ -n "${VIRTUAL_ENV}" ] ; then
143+
pip3 install "docker>=7.0.0"
144+
else
145+
pip3 install --user "docker>=7.0.0"
146+
fi
119147
}
120148

121149
install_deps_for_centos_8() {

0 commit comments

Comments
 (0)