[skip e2e] Add script for building deb package. (#16929)

Signed-off-by: Bennu-Li <yunmei.li@zilliz.com>
This commit is contained in:
Bennu 2022-05-23 12:07:58 +08:00 committed by GitHub
parent d28a2db46c
commit 33ddd8bb58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 202 additions and 0 deletions

65
build/deb/build_deb.sh Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash
#Download milvus source code
git clone https://github.com/milvus-io/milvus.git
cd milvus
# $1 is the branch name or commit number
git checkout $1
make
cd ..
#Prepare for milvus-deb
mkdir -p milvus-deb/milvus
mkdir milvus-deb/milvus/milvus-bin
mkdir milvus-deb/milvus/milvus-lib
## binary
cp milvus/bin/milvus milvus-deb/milvus/milvus-bin/
wget https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz && tar -xf etcd-v3.5.0-linux-amd64.tar.gz
cp etcd-v3.5.0-linux-amd64/etcd milvus-deb/milvus/milvus-bin/milvus-etcd
wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2021-02-14T04-01-33Z -O milvus-deb/milvus/milvus-bin/milvus-minio
## lib
cp -d milvus/internal/core/output/lib/* milvus-deb/milvus/milvus-lib/
cp /usr/lib/x86_64-linux-gnu/libgfortran.so.4.0.0 milvus-deb/milvus/milvus-lib/libgfortran.so.4
cp /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0 milvus-deb/milvus/milvus-lib/libgomp.so.1
cp /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0 milvus-deb/milvus/milvus-lib/libquadmath.so.0
cp /usr/lib/x86_64-linux-gnu/libtbb.so.2 milvus-deb/milvus/milvus-lib/libtbb.so.2
cp /usr/lib/libopenblas-r0.3.9.so milvus-deb/milvus/milvus-lib/libopenblas.so.0
## script
cp -r scripts milvus-deb/milvus/
## config
cp -r milvus/configs milvus-deb/milvus/
# set env
apt update
apt install gnupg pbuilder ubuntu-dev-tools apt-file dh-make build-essential -y
## $3 is name, $4 is email
bzr whoami "$3 $4"
export DEBFULLNAME="$3"
export DEBEMAIL="$4"
#Initial milvus package
cd milvus-deb
#$2 is Milvus version
tar zcf milvus-$2.tar.gz milvus
rm -rf milvus
bzr dh-make milvus $2 milvus-$2.tar.gz
##Modify debian files
sed -i '1s/unstable/bionic/' milvus/debian/changelog
sed -i "3s/(Closes: #nnnn) <nnnn is the bug number of your ITP>/$2-1/" milvus/debian/changelog
sed -i '3,4d' milvus/debian/README.Debian
sed -i '3,5d' milvus/debian/README.source
cp ../debian/* milvus/debian/
rm -rf milvus/debian/*.ex milvus/debian/*.EX
# package milvus deb
cd milvus
bzr add debian/source/format
bzr commit -m "Initial commit of Debian packaging."
bzr builddeb -- -us -uc
#sign package and upload to launcgpad
#bzr builddeb -S
#dput ppa:milvusdb/milvus milvus_$2-1_source.changes

1
build/deb/debian/compat Normal file
View File

@ -0,0 +1 @@
10

14
build/deb/debian/control Normal file
View File

@ -0,0 +1,14 @@
Source: milvus
Section: devel
Priority: optional
Maintainer: Yunmei Li <yunmei.li@zilliz.com>
Build-Depends: debhelper (>= 10), gcc (>= 7.5), g++ (>= 7.5)
Standards-Version: 4.1.2
Homepage: https://github.com/milvus-io/milvus
Package: milvus
Architecture: any-amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: An open-source vector dstabase for unstructured data.
Milvus was created in 2019 with a singular goal: store, index, and manage massive embedding vectors generated by deep neural networks and other machine learning (ML) models.

View File

@ -0,0 +1,35 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: milvus
Source: https://github.com/milvus-io/milvus
Files: *
Copyright: 2019-2022, Zilliz <yunmei.li@zilliz.com>
License: Apache-2.0
Files: debian/*
Copyright: 2022 Zilliz <yunmei.li@zilliz.com>
License: GPL-2+
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: Apache-2.0
This package is free software; you can redistribute it and/or modify
it under the terms of the Apache-2.0 License.
On Debian systems, the complete text of the Artistic License can be
found in `/usr/share/common-licenses/Apache-2.0

View File

@ -0,0 +1,2 @@
README.Debian
README.source

29
build/deb/debian/rules Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/make -f
export HOME = $(CURDIR)
%:
dh $@
override_dh_auto_build:
echo "skip build"
override_dh_auto_install:
mkdir -p $(PWD)/debian/milvus/usr/bin
mkdir -p $(PWD)/debian/milvus/usr/lib/milvus/
mkdir -p $(PWD)/debian/milvus/etc/milvus/configs/advanced
mkdir -p $(PWD)/debian/milvus/var/lib/milvus/minio-data
mkdir -p $(PWD)/debian/milvus/var/lib/milvus/etcd-data
mkdir -p $(PWD)/debian/milvus/lib/systemd/system
mkdir -p $(PWD)/debian/milvus/etc/ld.so.conf.d
cp -f $(PWD)/milvus-bin/milvus $(PWD)/debian/milvus/usr/bin/
cp -f $(PWD)/milvus-bin/milvus-minio $(PWD)/debian/milvus/usr/bin/
cp -f $(PWD)/milvus-bin/milvus-etcd $(PWD)/debian/milvus/usr/bin/
cp -P -r $(PWD)/milvus-lib/* $(PWD)/debian/milvus/usr/lib/milvus/
cp -r $(PWD)/configs/advanced/* $(PWD)/debian/milvus/etc/milvus/configs/advanced/
cp $(PWD)/configs/milvus.yaml $(PWD)/debian/milvus/etc/milvus/configs/
cp $(PWD)/scripts/milvus.conf $(PWD)/debian/milvus/etc/ld.so.conf.d/
cp $(PWD)/scripts/milvus.service $(PWD)/debian/milvus/lib/systemd/system/
cp $(PWD)/scripts/milvus-etcd.service $(PWD)/debian/milvus/lib/systemd/system/
cp $(PWD)/scripts/milvus-minio.service $(PWD)/debian/milvus/lib/systemd/system/
override_dh_shlibdeps:
dh_shlibdeps -l$(shell pwd)/milvus-lib

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,16 @@
[Unit]
Description=Etcd of Milvus Standalone Server
After=network.target syslog.target
PartOf=milvus.service
[Install]
WantedBy=multi-user.target
Alias=milvus-etcd.service
[Service]
StandardOutput=journal
StandardError=inherit
Restart=always
# Start main service
ExecStart=/usr/bin/milvus-etcd --data-dir /var/lib/milvus/etcd-data

View File

@ -0,0 +1,17 @@
[Unit]
Description=MinIO of Milvus Standalone Server
After=network.target syslog.target
PartOf=milvus.service
[Install]
WantedBy=multi-user.target
Alias=milvus-minio.service
[Service]
Type=simple
StandardOutput=journal
StandardError=inherit
Restart=always
# Start main service
ExecStart=/usr/bin/milvus-minio server /var/lib/milvus/minio-data

View File

@ -0,0 +1 @@
/usr/lib/milvus

View File

@ -0,0 +1,21 @@
# targets cannot be reloaded.
[Unit]
Description=Milvus Standalone Server
Wants=milvus-etcd.service milvus-minio.service
Requires=milvus-etcd.service milvus-minio.service
After=network.target syslog.target milvus-etcd.service milvus-minio.service
[Install]
WantedBy=multi-user.target
Alias=milvus.service
[Service]
Type=simple
StandardOutput=journal
StandardError=inherit
Restart=always
Environment=MILVUSCONF=/etc/milvus/configs/
ExecStart=/usr/bin/milvus run standalone