Skip to content

Commit 964f3f7

Browse files
committed
Migrate to Conan 2.x
Signed-off-by: yhmo <yihua.mo@zilliz.com>
1 parent 113c4a0 commit 964f3f7

File tree

17 files changed

+117
-124
lines changed

17 files changed

+117
-124
lines changed

.claude/skills/building/SKILL.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,26 @@ description: Use when building knowhere from source, configuring build options (
1010
```bash
1111
# Ubuntu/Debian
1212
sudo apt install build-essential libopenblas-openmp-dev libaio-dev python3-dev python3-pip
13-
pip3 install conan==1.61.0 --user
13+
pip3 install conan==2.25.1 --user
14+
conan profile detect --force
1415
export PATH=$PATH:$HOME/.local/bin
1516
```
1617

1718
## Build Commands
1819

1920
```bash
20-
mkdir build && cd build
21-
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
22-
```
21+
conan remote add default-conan-local2 https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local2```
2322
2423
| Build Type | Command |
2524
|------------|---------|
26-
| CPU Release | `conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s build_type=Release` |
27-
| CPU Debug | `conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s build_type=Debug` |
28-
| GPU (CUVS) | `conan install .. --build=missing -o with_ut=True -o with_cuvs=True -s compiler.libcxx=libstdc++11 -s build_type=Release` |
29-
| DISKANN | `conan install .. --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release` |
30-
| ASAN (CI default) | `conan install .. --build=missing -o with_ut=True -o with_diskann=True -o with_asan=True -s compiler.libcxx=libstdc++11 -s build_type=Release` |
31-
| macOS | `conan install .. --build=missing -o with_ut=True -s compiler.libcxx=libc++ -s build_type=Release` |
32-
33-
Then run: `conan build ..`
25+
| CPU Release | `conan install . --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s compiler.cppstd=17 -s build_type=Release` |
26+
| CPU Debug | `conan install . --build=missing -o with_ut=True -s compiler.libcxx=libstdc++11 -s compiler.cppstd=17 -s build_type=Debug` |
27+
| GPU (CUVS) | `conan install . --build=missing -o with_ut=True -o with_cuvs=True -s compiler.libcxx=libstdc++11 -s compiler.cppstd=17 -s build_type=Release` |
28+
| DISKANN | `conan install . --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s compiler.cppstd=17 -s build_type=Release` |
29+
| ASAN (CI default) | `conan install . --build=missing -o with_ut=True -o with_diskann=True -o with_asan=True -s compiler.libcxx=libstdc++11 -s compiler.cppstd=17 -s build_type=Release` |
30+
| macOS | `conan install . --build=missing -o with_ut=True -s compiler.libcxx=libc++ -s compiler.cppstd=17 -s build_type=Release` |
31+
32+
Then run: `conan build .`
3433
3534
## Build Options
3635

.github/actions/cache-restore/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ runs:
1818
- name: Cache Conan Packages
1919
uses: actions/cache/restore@v4
2020
with:
21-
path: ~/.conan
21+
path: ~/.conan2
2222
key: knowhere-${{ inputs.os }}-${{ github.job }}-conan-${{ hashFiles('conanfile.py') }}
2323
restore-keys: knowhere-${{ inputs.os }}-${{ github.job }}-conan-

.github/actions/cache-save/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ runs:
1717
- name: Cache Conan Packages
1818
uses: actions/cache/save@v4
1919
with:
20-
path: ~/.conan
20+
path: ~/.conan2
2121
key: knowhere-${{ inputs.os }}-${{ github.job }}-conan-${{ hashFiles('conanfile.py') }}

.github/workflows/analyzer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
analyzer:
1010
name: analyzer
1111
runs-on: ubuntu-22.04
12-
timeout-minutes: 60
12+
timeout-minutes: 180
1313
strategy:
1414
fail-fast: false
1515
steps:

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
Build:
1616
name: Build on ${{ matrix.os }}
1717
runs-on: ${{ matrix.os }}
18-
timeout-minutes: 60
18+
timeout-minutes: 180
1919
env:
2020
RELEASE_NAME: 'knowhere-${{ github.event.inputs.tag }}'
2121
strategy:
@@ -104,7 +104,7 @@ jobs:
104104
# cat << EOF > build.sh
105105
# #!/usr/bin/env bash
106106
#
107-
# conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
107+
# conan remote add default-conan-local2 https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local2
108108
#
109109
# if [[ `gcc -v 2>&1 | sed -n 's/.*\(--with-default-libstdcxx-abi\)=\(\w*\).*/\2/p'` == "gcc4" ]]; then
110110
# conan create . knowhere/${{ github.event.inputs.tag }}@milvus/dev --build=missing
@@ -113,8 +113,8 @@ jobs:
113113
# fi
114114
# EOF
115115
# chmod +x build.sh
116-
# docker run -u ${{env.UID}}:${{env.GID}} -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/home/milvus/.conan:delegated -v $(pwd):/work:delegated -w /work milvusdb/milvus-env:amd64-${{ matrix.os }}-20230215-5351fee bash -c /work/build.sh
116+
# docker run -u ${{env.UID}}:${{env.GID}} -v $(pwd)/.docker/conan-cache:/home/milvus/.conan2:delegated -v $(pwd):/work:delegated -w /work milvusdb/milvus-env:amd64-${{ matrix.os }}-20230215-5351fee bash -c /work/build.sh
117117
# - name: Upload
118118
# run: |
119-
# docker run -u ${{env.UID}}:${{env.GID}} -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/home/milvus/.conan:delegated milvusdb/milvus-env:amd64-${{ matrix.os }}-20230215-5351fee conan user -p ${{ secrets.JFROG_PASSWORD }} -r default-conan-local ${{ secrets.JFROG_USERNAME }}
120-
# docker run -u ${{env.UID}}:${{env.GID}} -e CONAN_REVISIONS_ENABLED=1 -v $(pwd)/.docker/conan-cache:/home/milvus/.conan:delegated milvusdb/milvus-env:amd64-${{ matrix.os }}-20230215-5351fee conan upload knowhere/${{ github.event.inputs.tag }}@milvus/dev -r default-conan-local --all
119+
# docker run -u ${{env.UID}}:${{env.GID}} -v $(pwd)/.docker/conan-cache:/home/milvus/.conan2:delegated milvusdb/milvus-env:amd64-${{ matrix.os }}-20230215-5351fee conan user -p ${{ secrets.JFROG_PASSWORD }} -r default-conan-local2 ${{ secrets.JFROG_USERNAME }}
120+
# docker run -u ${{env.UID}}:${{env.GID}} -v $(pwd)/.docker/conan-cache:/home/milvus/.conan2:delegated milvusdb/milvus-env:amd64-${{ matrix.os }}-20230215-5351fee conan upload knowhere/${{ github.event.inputs.tag }}@milvus/dev -r default-conan-local2 --all

.github/workflows/ut.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
swig-build:
5353
name: python3 wheel
5454
runs-on: ubuntu-22.04
55-
timeout-minutes: 60
55+
timeout-minutes: 180
5656
steps:
5757
- name: Checkout
5858
uses: actions/checkout@v2

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ build: ## Build knowhere (use WITH_GPU=True, WITH_UT=True, WITH_ASAN=True)
8585
ifdef WITH_GPU
8686
@$(PWD)/scripts/prepare_gpu_build.sh
8787
endif
88-
@mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && \
89-
conan install .. $(CONAN_FLAGS) && \
90-
conan build ..
88+
@mkdir -p $(BUILD_DIR) && \
89+
conan install . $(CONAN_FLAGS) && \
90+
conan build . $(CONAN_FLAGS)
9191

9292
# ---------- Test ----------
9393

ci/docker/builder/cpu/ubuntu20.04/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3 \
3333
# install knowhere dependancies
3434
RUN apt update \
3535
&& apt install -y libopenblas-openmp-dev libcurl4-openssl-dev libaio-dev libevent-dev lcov \
36-
&& pip3 install conan==1.61.0 \
37-
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local \
36+
&& pip3 install conan==2.25.1 \
37+
&& conan profile detect --force \
38+
&& conan remote add default-conan-local2 https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local2 \
3839
&& export PATH=$PATH:$HOME/.local/bin
3940

40-
# clone knowhere repo and build to update .conan
41+
# clone knowhere repo and build to update .conan2
4142
RUN git clone https://github.com/zilliztech/knowhere.git \
4243
&& cd knowhere \
43-
&& mkdir build && cd build \
44-
&& conan install .. --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
45-
&& conan build .. \
46-
&& cd ../.. \
44+
&& mkdir -p build \
45+
&& conan install . --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
46+
&& conan build . \
47+
&& cd .. \
4748
&& rm -rf knowhere

ci/docker/builder/cpu/ubuntu22.04/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ RUN cd /tmp \
4242
# install knowhere dependancies
4343
RUN apt update \
4444
&& apt install -y libopenblas-openmp-dev libcurl4-openssl-dev libaio-dev libevent-dev lcov \
45-
&& pip3 install conan==1.61.0 \
46-
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
47-
48-
# clone knowhere repo and build to update .conan
45+
&& pip3 install conan==2.25.1 \
46+
&& conan profile detect --force \
47+
&& conan remote add default-conan-local2 https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local2
48+
# clone knowhere repo and build to update .conan2
4949
RUN git clone https://github.com/zilliztech/knowhere.git \
5050
&& cd knowhere \
51-
&& mkdir build && cd build \
52-
&& conan install .. --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
53-
&& conan build .. \
54-
&& cd ../.. && rm -rf knowhere
51+
&& mkdir -p build \
52+
&& conan install . --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
53+
&& conan build . \
54+
&& cd .. && rm -rf knowhere

ci/docker/builder/cpu/ubuntu22.04/arm64/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ RUN cd /tmp \
4444
# install knowhere dependancies
4545
RUN apt update \
4646
&& apt install -y libopenblas-openmp-dev libcurl4-openssl-dev libaio-dev libevent-dev lcov \
47-
&& pip3 install conan==1.65.0 \
48-
&& conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
49-
50-
# clone knowhere repo and build to update .conan
47+
&& pip3 install conan==2.25.1 \
48+
&& conan profile detect --force \
49+
&& conan remote add default-conan-local2 https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local2
50+
# clone knowhere repo and build to update .conan2
5151
RUN git clone https://github.com/zilliztech/knowhere.git \
5252
&& cd knowhere \
53-
&& mkdir build && cd build \
54-
&& conan install .. --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
55-
&& conan build .. \
56-
&& cd ../.. && rm -rf knowhere
53+
&& mkdir -p build \
54+
&& conan install . --build=missing -o with_ut=True -o with_diskann=True -s compiler.libcxx=libstdc++11 -s build_type=Release \
55+
&& conan build . \
56+
&& cd .. && rm -rf knowhere

0 commit comments

Comments
 (0)