Examples of build ceph *.deb pkgs from source code and install


Examples of build ceph *.deb pkgs from source code and install:

OS: Ubuntu 16.04

Ceph Version: ceph version 13.0.2-1994-gc335bc1 (c335bc16a4d8083fa1d7bfad51195e380934f635) mimic (dev) ( ### from myself build )

benlu@ubuntu_build_05: ( on this build server, run build as regular user benlu)

$ mkdir ceph
$ cd ceph
$ pwd

benlu@ubuntu_build_05:~/ceph$ pwd
/home/benlu/ceph

$ git clone https://github.com/ceph/ceph.git
$ ls -ltr
$ cd ceph
$ git describe –tags
$ ls -ltr
$ ./install-deps.sh
$ ls -l
$ ./do_cmake.sh
$ ls -ltr
$ ./make-debs.sh
…..
dh_builddeb -O–buildsystem=cmake -O–parallel
dpkg-deb –build debian/ceph ..
dpkg-deb: building package ‘ceph’ in ‘../ceph_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-base ..
dpkg-deb: building package ‘ceph-base’ in ‘../ceph-base_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-mds ..
dpkg-deb: building package ‘ceph-mds’ in ‘../ceph-mds_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-mgr ..
dpkg-deb: building package ‘ceph-mgr’ in ‘../ceph-mgr_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-mon ..
dpkg-deb: building package ‘ceph-mon’ in ‘../ceph-mon_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-osd ..
dpkg-deb: building package ‘ceph-osd’ in ‘../ceph-osd_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-fuse ..
dpkg-deb: building package ‘ceph-fuse’ in ‘../ceph-fuse_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/rbd-fuse ..
dpkg-deb: building package ‘rbd-fuse’ in ‘../rbd-fuse_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/rbd-mirror ..
dpkg-deb: building package ‘rbd-mirror’ in ‘../rbd-mirror_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/rbd-nbd ..
dpkg-deb: building package ‘rbd-nbd’ in ‘../rbd-nbd_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-common ..
dpkg-deb: building package ‘ceph-common’ in ‘../ceph-common_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-resource-agents ..
dpkg-deb: building package ‘ceph-resource-agents’ in ‘../ceph-resource-agents_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/librados2 ..
dpkg-deb: building package ‘librados2’ in ‘../librados2_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/librados-dev ..
dpkg-deb: building package ‘librados-dev’ in ‘../librados-dev_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/libradosstriper1 ..
dpkg-deb: building package ‘libradosstriper1’ in ‘../libradosstriper1_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/libradosstriper-dev ..
dpkg-deb: building package ‘libradosstriper-dev’ in ‘../libradosstriper-dev_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/librbd1 ..
dpkg-deb: building package ‘librbd1’ in ‘../librbd1_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/librbd-dev ..
dpkg-deb: building package ‘librbd-dev’ in ‘../librbd-dev_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/libcephfs2 ..
dpkg-deb: building package ‘libcephfs2’ in ‘../libcephfs2_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/libcephfs-dev ..
dpkg-deb: building package ‘libcephfs-dev’ in ‘../libcephfs-dev_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/librgw2 ..
dpkg-deb: building package ‘librgw2’ in ‘../librgw2_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/librgw-dev ..
dpkg-deb: building package ‘librgw-dev’ in ‘../librgw-dev_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/radosgw ..
dpkg-deb: building package ‘radosgw’ in ‘../radosgw_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/ceph-test ..
dpkg-deb: building package ‘ceph-test’ in ‘../ceph-test_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python-ceph ..
dpkg-deb: building package ‘python-ceph’ in ‘../python-ceph_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python-rados ..
dpkg-deb: building package ‘python-rados’ in ‘../python-rados_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python3-rados ..
dpkg-deb: building package ‘python3-rados’ in ‘../python3-rados_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python-rbd ..
dpkg-deb: building package ‘python-rbd’ in ‘../python-rbd_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python3-rbd ..
dpkg-deb: building package ‘python3-rbd’ in ‘../python3-rbd_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python-rgw ..
dpkg-deb: building package ‘python-rgw’ in ‘../python-rgw_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python3-rgw ..
dpkg-deb: building package ‘python3-rgw’ in ‘../python3-rgw_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python-cephfs ..
dpkg-deb: building package ‘python-cephfs’ in ‘../python-cephfs_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python3-cephfs ..
dpkg-deb: building package ‘python3-cephfs’ in ‘../python3-cephfs_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/python3-ceph-argparse ..
dpkg-deb: building package ‘python3-ceph-argparse’ in ‘../python3-ceph-argparse_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/libcephfs-java ..
dpkg-deb: building package ‘libcephfs-java’ in ‘../libcephfs-java_13.0.2-1994-gc335bc1-1_all.deb’.
dpkg-deb –build debian/libcephfs-jni ..
dpkg-deb: building package ‘libcephfs-jni’ in ‘../libcephfs-jni_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-deb –build debian/rados-objclass-dev ..
dpkg-deb: building package ‘rados-objclass-dev’ in ‘../rados-objclass-dev_13.0.2-1994-gc335bc1-1_amd64.deb’.
dpkg-genchanges >../ceph_13.0.2-1994-gc335bc1-1_amd64.changes
dpkg-genchanges: including full source code in upload
dpkg-source –after-build ceph-13.0.2-1994-gc335bc1
dpkg-buildpackage: full upload; Debian-native package (full source is included)
+ cd ../..
+ mkdir -p xenial/conf
+ cat
++ dpkg –print-architecture
+ ‘[‘ ‘!’ -e conf ‘]’
+ ln -s xenial/conf conf
++ pwd
+ reprepro –basedir /tmp/release/Ubuntu include xenial WORKDIR/ceph_13.0.2-1994-gc335bc1-1_amd64.changes
./make-debs.sh: line 87: reprepro: command not found

benlu@ubuntu_build_05:~/ceph$ find / -name “*.deb”
……

benlu@ubuntu_build_05:~/ceph$ ls -l /var/cache/apt/archives/*.deb > deb_pkg_location

benlu@ubuntu_build_05:~/ceph$ ls -l /tmp/release/Ubuntu/WORKDIR/*.deb >> deb_pkg_location

$ mkdir all_generated_deb_pkgs

$ cp /tmp/release/Ubuntu/WORKDIR/*.deb /home/benlu/ceph/all_generated_deb_pkgs

$ tar -czvf /tmp/all_generated_deb_pkgs.tar.gz /home/benlu/ceph/all_generated_deb_pkgs

$ sudo tar -czvf /tmp/usr.tar.gz /usr

$ scp /tmp/*tar.gz benlu@192.168.56.102:~/ceph/

$ ssh benlu@192.168.56.102

$ cd ceph

$ tar -xzvf all_generated_deb_pkgs.tar.gz

$ cd all_generated_deb_pkgs

$ ls -l | grep .deb | awk ‘{print $9}’ | xargs sudo dpkg -i ## this is to install all pkgs into new hosts

### verify installed pkgs:

$ benlu@ceph-admin:~/ceph$ dpkg -l | grep ceph | awk ‘{print $2, $3, $4}’
ceph 13.0.2-1994-gc335bc1-1 amd64
ceph-base 13.0.2-1994-gc335bc1-1 amd64
ceph-common 13.0.2-1994-gc335bc1-1 amd64
ceph-fuse 13.0.2-1994-gc335bc1-1 amd64
ceph-mds 13.0.2-1994-gc335bc1-1 amd64
ceph-mgr 13.0.2-1994-gc335bc1-1 amd64
ceph-mon 13.0.2-1994-gc335bc1-1 amd64
ceph-osd 13.0.2-1994-gc335bc1-1 amd64
ceph-resource-agents 13.0.2-1994-gc335bc1-1 amd64
ceph-test 13.0.2-1994-gc335bc1-1 amd64
libcephfs-dev 13.0.2-1994-gc335bc1-1 amd64
libcephfs-java 13.0.2-1994-gc335bc1-1 all
libcephfs-jni 13.0.2-1994-gc335bc1-1 amd64
libcephfs2 13.0.2-1994-gc335bc1-1 amd64
python-ceph 13.0.2-1994-gc335bc1-1 amd64
python-cephfs 13.0.2-1994-gc335bc1-1 amd64
python3-cephfs 13.0.2-1994-gc335bc1-1 amd64
benlu@ceph-admin:~/ceph$

benlu@ceph-admin:~/ceph$ which ceph
/usr/bin/ceph

$ ceph –-version ( compains with errors )

untar /usr/* from build server to cover depends missing

$ sudo cp /home/benlu/ceph/usr.tar.gz /
$ ls -ltr /
$ cd /
$ sudo tar -xzvf usr.tar.gz

benlu@ceph-admin:~/ceph$ ceph –version
ceph version 13.0.2-1994-gc335bc1 (c335bc16a4d8083fa1d7bfad51195e380934f635) mimic (dev)
benlu@ceph-admin:~/ceph$

Now is good to go for next step: Config CEPH !!!!

===========================================================

## Below arm64 dpkg build and install was tested sucessfully on ubuntu18.04 arm64 server image in AWS:

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev phantomjs
sudo apt autoremove
sudo dpkg –add-architecture arm64
debuild — clean
sudo pbuilder –update

## start to build

mkdir ~/ceph_build
cd ~/ceph_build
wget http://download.ceph.com/tarballs/ceph_13.2.5.orig.tar.gz
tar -xzvf ceph_13.2.5.orig.tar.gz
rm -f ceph_13.2.5.orig.tar.gz
cd ceph-13.2.5
sudo dpkg-buildpackage

## the build above will fail for many pkgs missing, run missing pkgs install as below:

sudo apt install cython3 dh-exec dh-python dh-systemd gperf javahelper jq libaio-dev libbabeltrace-ctf-dev libbabeltrace-dev libblkid-dev libcunit1-dev libcurl4-openssl-dev libfuse-dev libgoogle-perftools-dev libkeyutils-dev libldap2-dev libleveldb-dev liblttng-ust-dev liblz4-dev libnss3-dev liboath-dev libsnappy-dev libudev-dev python-cherrypy3 python-nose python-pecan python-bcrypt python-tox python-coverage python-prettytable python-werkzeug python3-all-dev socat uuid-dev valgrind xfslibs-dev xmlstarlet

## run dpkg build again:

sudo dpkg-buildpackage

## if everything runing through, it will build all arm64 ceph dpkgs for version: ceph-13.2.5-1 in one dir up at ../ceph_build/

mkdir /tmp/arm64.deb_all_build_pkgs
cd ../ceph_build/

scp *.deb /tmp/arm64.deb_all_build_pkgs/ ## this is copy all build pkgs over to /tmp/arm64.deb_all_build_pkgs/

scp /var/cache/apt/archives/*.deb /tmp/arm64.deb_all_build_pkgs/ ## this is copy all build deps dpkgs to /tmp/arm64.deb_all_build_pkgs/

ls -l /tmp/arm64.deb_all_build_pkgs/*.deb | wc -l

cd /tmp/arm64.deb_all_build_pkgs/

tar czvf ceph_13.2.5-1_build_out.tar.gz *.deb ## this is to create the tar.gz file which include all dpkgs for install on other node

## fresh installation steps on other ubuntu18.04 node

sudo apt update && sudo apt upgrade
tar -xzvf ceph_13.2.5-1_build_out.tar.gz
rm -f ceph_13.2.5-1_build_out.tar.gz
ls -l | grep .deb | awk ‘{print $9}’ | xargs sudo dpkg -i

## you may need to run two commands below to clean up system to have above “dpkg -i” pass
sudo apt autoremove
sudo apt –fix-broken install

## verify, system will give output as below

$ which ceph
/usr/bin/ceph
$ ceph –version
ceph version 13.2.5 (cbff874f9007f1869bfd3821b7e33b2a6ffd4988) mimic (stable)