Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable build 2.3 for macosx #38

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM milvusdb/milvus-env:amd64-centos7-20230329-1431037
FROM milvusdb/milvus-env:amd64-centos7-20230606-c9d9940

# Ignore tool missing warnings, and wo also not need clang-tools
RUN rm -fr /etc/profile.d/llvm-toolset*.sh
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
}
},
"mounts": [
"source=${localEnv:HOME}/.ssh,target=/home/${localEnv:USER}/.ssh,type=bind,consistency=cached"
"source=${localWorkspaceFolder}/.conan,target=/home/${localEnv:USER}/.conan,type=bind,consistency=cached"
]
}
2 changes: 2 additions & 0 deletions .devcontainer/setup/gen_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ echo DEV_GROUP=$(id -gn) >> ${this_dir}/env
echo DEV_GID=$(id -g) >> ${this_dir}/env
echo DEV_HOME=$HOME >> ${this_dir}/env
echo DEV_SHELL=$SHELL >> ${this_dir}/env

mkdir -p ${this_dir}/../../.conan
166 changes: 89 additions & 77 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest
container:
# note: keep same as .devcontainer/Dockerfile
image: milvusdb/milvus-env:amd64-centos7-20230329-1431037
image: milvusdb/milvus-env:amd64-centos7-20230606-c9d9940
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
timeout-minutes: 120
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -62,55 +62,55 @@ jobs:
name: wheel_linux
path: dist/*.whl
retention-days: 5
# build_macos:
# name: Build Wheel - macOS
# runs-on: macos-11
# env:
# CCACHE_DIR: ${{ github.workspace }}/.ccache
# CCACHE_COMPILERCHECK: content
# CCACHE_COMPRESS: 1
# CCACHE_COMPRESSLEVEL: 5
# CCACHE_MAXSIZE: 2G
# timeout-minutes: 120
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Cache go
# uses: actions/cache@v3
# with:
# path: |
# ~/.cache/go-build
# ~/go/pkg/mod
# key: macos-go-${{ hashFiles('milvus_binary/env.sh') }}
# restore-keys: macos-go-
# - name: Cache conan
# uses: actions/cache@v3
# with:
# path: |
# ~/.conan/data
# key: macos-conan-${{ hashFiles('milvus_binary/env.sh') }}
# restore-keys: macos-conan-
# - name: Cache ccache
# uses: actions/cache@v3
# with:
# path: |
# ${{ github.workspace }}/.ccache
# key: macos-ccache-${{ hashFiles('milvus_binary/env.sh') }}
# restore-keys: macos-ccache-
# - name: Setup Go environment
# uses: actions/setup-go@v4
# with:
# go-version: '~1.18.10'
# cache: false
# - name: Build Wheel
# run: |
# python3 -m pip install --user build wheel 'setuptools>64.0'
# python3 -m build -w -n
# - uses: actions/upload-artifact@v3
# with:
# name: wheel_macos
# path: dist/*.whl
# retention-days: 5
build_macos:
name: Build Wheel - macOS
runs-on: macos-11
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache go
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: macos-go-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: macos-go-
- name: Cache conan
uses: actions/cache@v3
with:
path: |
~/.conan/data
key: macos-conan-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: macos-conan-
- name: Cache ccache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
key: macos-ccache-${{ hashFiles('milvus_binary/env.sh') }}
restore-keys: macos-ccache-
- name: Setup Go environment
uses: actions/setup-go@v4
with:
go-version: '~1.18.10'
cache: false
- name: Build Wheel
run: |
python3 -m pip install --user build wheel 'setuptools>64.0'
python3 -m build -w -n
- uses: actions/upload-artifact@v3
with:
name: wheel_macos
path: dist/*.whl
retention-days: 5
# build_windows:
# name: Build Wheel - windows
# runs-on: windows-latest
Expand All @@ -120,7 +120,7 @@ jobs:
# CCACHE_COMPRESS: 1
# CCACHE_COMPRESSLEVEL: 5
# CCACHE_MAXSIZE: 2G
# timeout-minutes: 120
# timeout-minutes: 180
# steps:
# - name: Set git to use LF
# run: |
Expand Down Expand Up @@ -210,31 +210,43 @@ jobs:
python3 -m pip install --user "$(echo dist/*.whl)[client]"
cd examples
python3 example.py
# acceptance_test_macos:
# needs:
# - build_macos
# name: Acceptance Test ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# timeout-minutes: 60
# strategy:
# fail-fast: false
# matrix:
# os: ["macos-11", "macos-12"]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: '3.8'
# - uses: actions/download-artifact@v3
# with:
# name: wheel_macos
# path: dist
# - name: Run hello milvus
# run: |
# python3 -m pip install --user wheel setuptools
# python3 -m pip install --user "$(echo dist/*.whl)[client]"
# cd examples
# python3 example.py
- name: Upload runtime log
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: milvus-log
path: ~/.milvus.io/milvus-server/**/*.log
acceptance_test_macos:
needs:
- build_macos
name: Acceptance Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: ["macos-11", "macos-12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- uses: actions/download-artifact@v3
with:
name: wheel_macos
path: dist
- name: Run hello milvus
run: |
python3 -m pip install --user wheel setuptools
python3 -m pip install --user "$(echo dist/*.whl)[client]"
cd examples
python3 example.py
- name: Upload runtime log
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: milvus-log
path: ~/.milvus.io/milvus-server/**/*.log
# acceptance_test_windows:
# needs:
# - build_windows
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ dmypy.json

# Pyre type checker
.pyre/


.conan/

4 changes: 2 additions & 2 deletions examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# 5. search

# Optional, if you want store all related data to specific location
# default it wil using %APPDATA%/milvus-io/milvus-server
default_server.set_base_dir('test_milvus')
# default it wil using ~/.milvus-io/milvus-server/<__version_of_milvus__>
# default_server.set_base_dir('test_milvus')

# Optional, if you want cleanup previous data
default_server.cleanup()
Expand Down
33 changes: 28 additions & 5 deletions milvus_binary/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ if [[ ! -d milvus ]] ; then
if [ -f ../patches/milvus-${MILVUS_VERSION}.patch ] ; then
patch -p1 < ../patches/milvus-${MILVUS_VERSION}.patch
fi
if [ -d ../patches/milvus-${MILVUS_VERSION} ] ; then
for pf in ../patches/milvus-${MILVUS_VERSION}/*.patch ; do
git apply ${pf}
done
fi
cd -
fi

Expand Down Expand Up @@ -195,12 +200,30 @@ function build_msys() {

cd bin
mv milvus milvus.exe
rm -fr *.log *.dll

find .. -name \*.dll | xargs -I {} cp -frv {} . || :
for x in $(ldd milvus.exe | awk '{print $1}') ; do
if [ -f ${MINGW_PREFIX}/bin/$x ] ; then
cp -frv ${MINGW_PREFIX}/bin/$x .
fi
has_new_file=true
while ${has_new_file} ; do
has_new_file=false
for binary in milvus.exe *.dll ; do
for x in $(ldd ${binary} | grep -vi /windows/ | awk '{print $1}') ; do
if test -f $x ; then
:
else
echo $x
for p in ../internal/core/output/lib ../internal/core/output/bin /mingw64/bin ; do
if test -f $p/$x && ! test -f $x ; then
file=$p/$x
while test -L $file ; do
file=$(dirname $file)/$(readlink $file)
done
cp -frv $file $x
has_new_file=true
fi
done
fi
done
done
done
}

Expand Down
2 changes: 1 addition & 1 deletion milvus_binary/env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

MILVUS_REPO="https://github.com/milvus-io/milvus.git"
MILVUS_VERSION="v2.3.0-beta"
MILVUS_VERSION="e9f1515a"
BUILD_PROXY=
BUILD_FORCE=NO
Loading