Merge pull request #1362 from bassam/pr-simplify-ceph-build
remove ceph builds from rook and use upstream ceph instead
This commit is contained in:
23 files changed
+54
-609
No files matched your search
-18
@@ -119,21 +119,6 @@ Linux 7ed5f0d0b618 4.10.0-21-generic #23-Ubuntu SMP Fri Apr 28 16:14:22 UTC 2017
|
||||
|
||||
# Improving Build Speed
|
||||
|
||||
## Using CCache
|
||||
|
||||
C++ code can take time to compile. CCache can increase the speed of compilation. To enable, make sure you have `ccache` installed:
|
||||
|
||||
```
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends ccache
|
||||
```
|
||||
|
||||
On a Mac, `ccache` can be installed using brew:
|
||||
```
|
||||
brew install --HEAD ccache
|
||||
```
|
||||
|
||||
when building container images we will use `CCACHE_DIR` or `${HOME}/.ccache` by default.
|
||||
|
||||
## Apt Package Caching
|
||||
|
||||
When building container images numerous apt-get operations are performed which can slow down the build significantly. To speed things up install the apt-cacher-ng package which will cache apt packages on the host.
|
||||
@@ -157,8 +142,6 @@ Our base container image enables transparent proxy detection and will use the ap
|
||||
|
||||
Doing a complete build of Rook and the dependent packages can take a long time (more than an hour on a typical macbook). To speed things up we rely heavily on image caching in docker. Docker support content-addressable images by default and we use that effectively when building images. Images are factored to increase reusability across builds. We also tag and timestamp images that should remain in the cache to help future builds.
|
||||
|
||||
Not all parts of our build, however, can rely on content-addressable image caching. For example to build Ceph using `docker build` would mean that we could not `ccache` and the build could take much longer. Instead we build Ceph by running the build process with `docker run` using a base image that has all the Ceph code and tools. To avoid building Ceph over and over, we create a container image with the output of the ceph build and add it to the docker image cache.
|
||||
|
||||
### Pruning the cache
|
||||
|
||||
To prune the number of cached images run `make prune`. There are two options that control the level of pruning performed:
|
||||
@@ -181,4 +164,3 @@ Or users may want to skip build all together for trivial changes like documentat
|
||||
2. [smoke only] - if this text is found in the body of PR, then Jenkins will only run Smoke Test during integration test phase
|
||||
|
||||
The above flags work only on PRs,The full regression is run on every merge to master.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- Monitoring is now done through the Ceph MGR service for Ceph storage.
|
||||
|
||||
## Breaking Changes
|
||||
- `armhf` build of Rook have been removed. Ceph is not supported or tested on `armhf`. arm64 support continues.
|
||||
|
||||
### Cluster CRD
|
||||
- Removed the `versionTag` property. The container version to launch in all pods will be the same as the version of the operator container.
|
||||
|
||||
@@ -35,17 +35,12 @@ GOHOSTOS := $(shell go env GOHOSTOS)
|
||||
GOHOSTARCH := $(shell go env GOHOSTARCH)
|
||||
HOST_PLATFORM := $(GOHOSTOS)_$(GOHOSTARCH)
|
||||
|
||||
ALL_PLATFORMS ?= darwin_amd64 windows_amd64 linux_arm linux_amd64 linux_arm64
|
||||
ALL_PLATFORMS ?= darwin_amd64 windows_amd64 linux_amd64 linux_arm64
|
||||
|
||||
ifeq ($(PLATFORM),linux_amd64)
|
||||
CROSS_TRIPLE = x86_64-linux-gnu
|
||||
DEBIAN_ARCH = amd64
|
||||
endif
|
||||
ifeq ($(PLATFORM),linux_arm)
|
||||
GOARM=7
|
||||
DEBIAN_ARCH = armhf
|
||||
CROSS_TRIPLE = arm-linux-gnueabihf
|
||||
endif
|
||||
ifeq ($(PLATFORM),linux_arm64)
|
||||
DEBIAN_ARCH = arm64
|
||||
CROSS_TRIPLE = aarch64-linux-gnu
|
||||
|
||||
@@ -56,7 +56,6 @@ Binaries go to an S3 bucket `rook-release` (and https://release.rook.io) and hav
|
||||
/v0.3.0-2-g770ebbc
|
||||
darwin_amd64/rookctl
|
||||
linux_amd64/rookctl
|
||||
linux_arm/rookctl
|
||||
linux_arm64/rookctl
|
||||
windows_amd64/rookctl
|
||||
version
|
||||
|
||||
@@ -75,7 +75,6 @@ if [ "`uname -s`" != "Linux" ]; then
|
||||
# /.aws (bind mounted to host ${HOME}/.aws)
|
||||
# /.docker (bind mounted to host ${HOME}/.docker)
|
||||
# /.cache (bind mounted to host ${CACHE_DIR} if set)
|
||||
# /.ccache
|
||||
# /go/src/github.com/rook/rook (rsync'd from host <source>)
|
||||
|
||||
# now copy the source tree to the container volume. Note this also
|
||||
@@ -89,8 +88,6 @@ if [ "`uname -s`" != "Linux" ]; then
|
||||
|
||||
MOUNT_OPTS="${MOUNT_OPTS} -v ${CROSS_IMAGE_VOLUME}:${BUILDER_HOME}"
|
||||
|
||||
CCACHE_ARGS="-e CCACHE_DIR=${BUILDER_HOME}/.ccache \
|
||||
-e CCACHE_DIR_HOST=${BUILDER_HOME}/.ccache -e CCACHE_LOG"
|
||||
else
|
||||
|
||||
# On linux bind mounts are cheap so we dont need to rsync
|
||||
@@ -101,7 +98,6 @@ else
|
||||
# /.netrc (bind mounted to host ${HOME}/.netrc)
|
||||
# /.aws (bind mounted to host ${HOME}/.aws)
|
||||
# /.docker (bind mounted to host ${HOME}/.docker)
|
||||
# /.cache (bind mounted to host ${CCACHE_DIR})
|
||||
# /go
|
||||
# /pkg (bind mounted to <source>/.work/cross_pkg)
|
||||
# /src/github.com/rook/rook (bind mounted to <source>)
|
||||
@@ -109,18 +105,6 @@ else
|
||||
MOUNT_OPTS="${MOUNT_OPTS} \
|
||||
-v ${scriptdir}/../.work/cross_pkg:${BUILDER_HOME}/go/pkg
|
||||
-v ${scriptdir}/..:${BUILDER_HOME}/go/src/${BUILD_REPO}"
|
||||
|
||||
# if CCACHE_DIR is not set, set it to the default
|
||||
if [[ -z "${CCACHE_DIR}" ]]; then
|
||||
CCACHE_DIR="${HOME}/.ccache"
|
||||
fi
|
||||
|
||||
if [[ -d "${CCACHE_DIR}" ]]; then
|
||||
CCACHE_ARGS="-e CCACHE_DIR=${BUILDER_HOME}/.ccache \
|
||||
-e CCACHE_DIR_HOST=${CCACHE_DIR} \
|
||||
-e CCACHE_LOG \
|
||||
-v ${CCACHE_DIR}:${BUILDER_HOME}/.ccache"
|
||||
fi
|
||||
fi
|
||||
|
||||
# if CACHE_DIR is not set bind mount it
|
||||
@@ -179,7 +163,6 @@ docker run \
|
||||
${TTY_ARGS} \
|
||||
${KUBE_ARGS} \
|
||||
${KUBEADM_DIND_ARGS} \
|
||||
${CCACHE_ARGS} \
|
||||
${DOWNLOAD_ARGS} \
|
||||
${NETRC_ARGS} \
|
||||
${AWS_ARGS} \
|
||||
|
||||
+2
-8
@@ -14,7 +14,7 @@
|
||||
|
||||
include image.mk
|
||||
|
||||
PLATFORMS ?= linux_amd64 linux_arm linux_arm64
|
||||
PLATFORMS ?= linux_amd64 linux_arm64
|
||||
|
||||
# ====================================================================================
|
||||
# Image Targets
|
||||
@@ -26,17 +26,11 @@ apt-cacher.%: base.%
|
||||
base.%:
|
||||
@$(MAKE) -C base PLATFORM=$*
|
||||
|
||||
ceph.%: cross-gnu.linux_amd64
|
||||
@$(MAKE) -C ceph PLATFORM=$*
|
||||
|
||||
cross: cross.linux_amd64
|
||||
cross.%: base.linux_amd64
|
||||
@$(MAKE) -C cross PLATFORM=$*
|
||||
|
||||
cross-gnu.%: base.%
|
||||
@$(MAKE) -C cross-gnu PLATFORM=$*
|
||||
|
||||
rook.%: ceph.% base.%
|
||||
rook.%: base.%
|
||||
@$(MAKE) -C rook PLATFORM=$*
|
||||
|
||||
toolbox.%: rook.%
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
FROM BASEIMAGE
|
||||
|
||||
SHELL ["/bin/bash","-c"]
|
||||
|
||||
# APT caching to speed up apt-get downloads
|
||||
# see http://www.stuartaxon.com/2015/02/02/docker-and-caching-apt-get-for-guests-on-the-same-host/
|
||||
RUN HOST_IP=$(route -n | awk '/^0.0.0.0/ {print $2}') && \
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
FROM BASEIMAGE
|
||||
|
||||
SHELL ["/bin/bash","-c"]
|
||||
|
||||
RUN sed -i -e 's/^deb-src/#deb-src/' /etc/apt/sources.list && \
|
||||
# update and upgrade
|
||||
DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
@@ -23,23 +25,14 @@ RUN sed -i -e 's/^deb-src/#deb-src/' /etc/apt/sources.list && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -yy --no-install-recommends && \
|
||||
# cleanup
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean -y
|
||||
|
||||
RUN \
|
||||
# keep the copyright files
|
||||
tar -czf /usr/share/copyrights.tar.xz /usr/share/doc/*/copyright && \
|
||||
# remove unecessary files
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean -y && \
|
||||
rm -rf \
|
||||
/usr/share/doc \
|
||||
/usr/share/man \
|
||||
/usr/share/info \
|
||||
/usr/share/locale \
|
||||
/etc/{selinux,systemd,udev} \
|
||||
/lib/{lsb,udev} \
|
||||
/tmp/* \
|
||||
/usr/lib/{locale,systemd,udev} \
|
||||
/usr/share/{doc,info,man} \
|
||||
/var/cache/debconf/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/log/* \
|
||||
/var/cache/debconf/* \
|
||||
/etc/systemd \
|
||||
/lib/lsb \
|
||||
/lib/udev \
|
||||
/usr/lib/x86_64-linux-gnu/gconv/IBM* \
|
||||
/usr/lib/x86_64-linux-gnu/gconv/EBC* && \
|
||||
mkdir -p /usr/share/man/man{1..8}
|
||||
/var/tmp/*
|
||||
@@ -1,28 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
# make all install targets OPTIONAL by default by overriding the install function
|
||||
function(install)
|
||||
_install(${ARGN} OPTIONAL)
|
||||
endfunction()
|
||||
|
||||
include(CMakeLists.original.txt)
|
||||
|
||||
# the ceph targets we need for rook. be careful bringing
|
||||
# in new targets as the container might mushroom in size
|
||||
add_custom_target(rook DEPENDS
|
||||
ceph-authtool
|
||||
ceph-common
|
||||
ceph-mds
|
||||
ceph-mgr
|
||||
ceph-mon
|
||||
ceph-osd
|
||||
cephfs
|
||||
cls_rbd
|
||||
crushtool
|
||||
monmaptool
|
||||
rados
|
||||
radosgw
|
||||
radosgw-admin
|
||||
rbd
|
||||
rgw
|
||||
)
|
||||
@@ -1,106 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM BASEIMAGE
|
||||
|
||||
# clone the repo. we do this first so that this layer can be reused across archs.
|
||||
ARG CEPH_GIT_REPO
|
||||
RUN git clone ${CEPH_GIT_REPO} ceph
|
||||
|
||||
# install libraries and tools needed during build
|
||||
ARG ARCH
|
||||
ARG CROSS_TRIPLE
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -yy -q --no-install-recommends \
|
||||
python-setuptools \
|
||||
gperf \
|
||||
cython:${ARCH} \
|
||||
python:${ARCH} \
|
||||
libaio-dev:${ARCH} \
|
||||
libatomic-ops-dev:${ARCH} \
|
||||
libbabeltrace-dev:${ARCH} \
|
||||
libblkid-dev:${ARCH} \
|
||||
libboost-context-dev:${ARCH} \
|
||||
libboost-coroutine-dev:${ARCH} \
|
||||
libboost-date-time-dev:${ARCH} \
|
||||
libboost-filesystem-dev:${ARCH} \
|
||||
libboost-iostreams-dev:${ARCH} \
|
||||
libboost-program-options-dev:${ARCH} \
|
||||
libboost-python-dev:${ARCH} \
|
||||
libboost-random-dev:${ARCH} \
|
||||
libboost-regex-dev:${ARCH} \
|
||||
libboost-system-dev:${ARCH} \
|
||||
libboost-thread-dev:${ARCH} \
|
||||
libcurl4-gnutls-dev:${ARCH} \
|
||||
libexpat1-dev:${ARCH} \
|
||||
libgoogle-perftools-dev:${ARCH} \
|
||||
libgoogle-perftools4:${ARCH} \
|
||||
libibverbs-dev:${ARCH} \
|
||||
libjemalloc-dev:${ARCH} \
|
||||
libkeyutils-dev:${ARCH} \
|
||||
libldap2-dev:${ARCH} \
|
||||
libnss3-dev:${ARCH} \
|
||||
libpython-dev:${ARCH} \
|
||||
libsnappy-dev:${ARCH} \
|
||||
libssl-dev:${ARCH} \
|
||||
libtcmalloc-minimal4:${ARCH} \
|
||||
libudev-dev:${ARCH} \
|
||||
libunwind-dev:${ARCH} \
|
||||
zlib1g-dev:${ARCH} && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# checkout the commit hash and update submodules
|
||||
ARG CEPH_GIT_COMMIT
|
||||
RUN cd /build/ceph && \
|
||||
git fetch --all --prune && \
|
||||
git checkout -b ceph-builder ${CEPH_GIT_COMMIT} && \
|
||||
git submodule update --init --recursive
|
||||
|
||||
# create a wrapper CMakelists.txt to enable partial building
|
||||
# and installation of targets. We dont want to build all of
|
||||
# ceph -- just a subset of targets that we need.
|
||||
# see http://stackoverflow.com/questions/17164731/installing-only-one-target-and-its-dependencies-out-of-a-complex-project-with
|
||||
RUN mv /build/ceph/CMakeLists.txt /build/ceph/CMakeLists.original.txt
|
||||
ADD CMakeLists.txt /build/ceph
|
||||
|
||||
# configure ceph
|
||||
ARG CEPH_BUILD_TYPE
|
||||
ARG CEPH_ALLOCATOR
|
||||
RUN mkdir -p /build/ceph/build && cd /build/ceph/build && \
|
||||
cmake \
|
||||
-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DCMAKE_BUILD_TYPE=${CEPH_BUILD_TYPE} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/usr/local/toolchain/${CROSS_TRIPLE}.cmake \
|
||||
-DALLOCATOR=${CEPH_ALLOCATOR} \
|
||||
-DWITH_SYSTEM_BOOST=ON \
|
||||
-DWITH_EMBEDDED=OFF \
|
||||
-DWITH_FUSE=OFF \
|
||||
-DWITH_LEVELDB=OFF \
|
||||
-DWITH_LTTNG=OFF \
|
||||
-DWITH_MANPAGE=OFF \
|
||||
-DWITH_PROFILER=OFF \
|
||||
-DWITH_PYTHON3=OFF \
|
||||
-DWITH_RADOSGW_FCGI_FRONTEND=OFF \
|
||||
..
|
||||
|
||||
WORKDIR /build/ceph/build
|
||||
|
||||
# now do the actual building. Note we dont build inside the Dockerfile
|
||||
# since we are unable to bind a volume and use ccache
|
||||
ADD build-ceph.sh /build/
|
||||
CMD ["/build/build-ceph.sh"]
|
||||
@@ -1,16 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM scratch
|
||||
COPY ceph-install.tar /
|
||||
@@ -1,92 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include ../image.mk
|
||||
|
||||
# the git repo and branch to build from
|
||||
CEPH_GIT_REPO ?= https://github.com/rook/ceph
|
||||
|
||||
# the git commit hash to build
|
||||
ifeq ($(origin CEPH_GIT_COMMIT), undefined)
|
||||
CEPH_GIT_COMMIT := $(shell cat commit_hash)
|
||||
endif
|
||||
|
||||
# set to release or relwithdebinfo (make sure its lower case)
|
||||
CEPH_BUILD_TYPE ?= release
|
||||
|
||||
# set to tcmalloc, tcmalloc_minimal, jemalloc or libc
|
||||
ifeq ($(GOARCH),amd64)
|
||||
CEPH_ALLOCATOR ?= tcmalloc
|
||||
else
|
||||
CEPH_ALLOCATOR ?= libc
|
||||
endif
|
||||
|
||||
ifeq ($(filter libc tcmalloc tcmalloc_minimal jemalloc, $(CEPH_ALLOCATOR)),)
|
||||
$(error unsupported memory allocator $(CEPH_ALLOCATOR))
|
||||
endif
|
||||
|
||||
CEPH_CONFIG ?= $(GOARCH)-$(CEPH_ALLOCATOR)-$(CEPH_BUILD_TYPE)
|
||||
|
||||
CEPH_TARBALL = ceph-install.tar
|
||||
|
||||
CCACHE_DIR_HOST ?= $(HOME)/.ccache
|
||||
|
||||
CEPH_BUILDER_IMAGE := $(BUILD_REGISTRY)/ceph-builder-$(CEPH_CONFIG)
|
||||
CEPH_BUILDER_BASEIMAGE := $(BUILD_REGISTRY)/cross-gnu-$(GOHOSTARCH)
|
||||
|
||||
CEPH_IMAGE := $(BUILD_REGISTRY)/ceph-$(CEPH_CONFIG)-$$(docker images -q $(CEPH_BUILDER_IMAGE))
|
||||
|
||||
IMAGES = $(CEPH_BUILDER_IMAGE) $(CEPH_IMAGE)
|
||||
CACHE_IMAGES = $(IMAGES)
|
||||
|
||||
TEMP := $(shell mktemp -d)
|
||||
|
||||
# ====================================================================================
|
||||
# Targets
|
||||
|
||||
do.build:
|
||||
@echo === docker build $(CEPH_BUILDER_IMAGE)
|
||||
@cp -a . $(TEMP)
|
||||
@cd $(TEMP) && $(SED_CMD) 's|BASEIMAGE|$(CEPH_BUILDER_BASEIMAGE)|g' Dockerfile
|
||||
@docker build $(BUILD_ARGS) \
|
||||
--build-arg ARCH=$(DEBIAN_ARCH) \
|
||||
--build-arg CEPH_GIT_COMMIT=$(CEPH_GIT_COMMIT) \
|
||||
--build-arg CEPH_GIT_REPO=$(CEPH_GIT_REPO) \
|
||||
--build-arg CEPH_ALLOCATOR=$(CEPH_ALLOCATOR) \
|
||||
--build-arg CEPH_BUILD_TYPE=$(CEPH_BUILD_TYPE) \
|
||||
--build-arg CROSS_TRIPLE=$(CROSS_TRIPLE) \
|
||||
-t $(CEPH_BUILDER_IMAGE) \
|
||||
$(TEMP)
|
||||
# lookup the rootfs image from the cache or make it if its not there
|
||||
@$(MAKE) cache.lookup LOOKUP_IMAGE=$(CEPH_IMAGE) MISS_TARGET=ceph
|
||||
|
||||
ceph:
|
||||
@echo === building ceph from $(CEPH_BUILDER_IMAGE)
|
||||
@docker run \
|
||||
-i \
|
||||
--cidfile $(TEMP)/cid \
|
||||
-v $(CCACHE_DIR_HOST):/root/.ccache \
|
||||
$(CEPH_BUILDER_IMAGE)
|
||||
@docker cp `cat $(TEMP)/cid`:/build/$(CEPH_TARBALL) $(TEMP)/$(CEPH_TARBALL)
|
||||
@docker rm -f `cat $(TEMP)/cid`
|
||||
@rm -fr $(TEMP)/cid
|
||||
# now cache the ceph tarball in a docker image
|
||||
@cp Dockerfile.ceph $(TEMP)/Dockerfile
|
||||
@docker build $(BUILD_ARGS) -t $(CEPH_IMAGE) $(TEMP)
|
||||
@rm -fr $(TEMP)
|
||||
|
||||
%/$(CEPH_TARBALL): build
|
||||
@CID=`docker create $(CEPH_IMAGE) /dev/null` &&\
|
||||
docker cp $$CID:$(CEPH_TARBALL) $@ &&\
|
||||
docker rm -f $$CID
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
CEPH_INSTALL_DIR=${CEPH_INSTALL_DIR:-/build/ceph-install}
|
||||
CEPH_TARBALL=${CEPH_INSTALL_DIR}.tar
|
||||
|
||||
NPROC=$(( $(nproc) - 1 ))
|
||||
if [ "$NPROC" -eq 0 ]; then
|
||||
NPROC=1
|
||||
fi
|
||||
|
||||
makeargs=-j$NPROC
|
||||
|
||||
# build and install
|
||||
make ${makeargs} rook
|
||||
make ${makeargs} DESTDIR="${CEPH_INSTALL_DIR}" install
|
||||
|
||||
# create the ceph tar file
|
||||
tar --numeric-owner --create --file "${CEPH_TARBALL}" --directory "${CEPH_INSTALL_DIR}" --transform='s,^./,,' .
|
||||
@@ -1 +0,0 @@
|
||||
4b2cb7c67015e40d9bb7eb847564c8d247180ff0
|
||||
@@ -1,53 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM BASEIMAGE
|
||||
|
||||
# install build tools, compilers and cross compilers for all supported platforms
|
||||
RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu zesty main universe restricted" > /etc/apt/sources.list &&\
|
||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu zesty-updates main universe restricted" >> /etc/apt/sources.list &&\
|
||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu zesty-security main universe restricted" >> /etc/apt/sources.list &&\
|
||||
echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu zesty-backports main universe restricted" >> /etc/apt/sources.list &&\
|
||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ zesty main universe restricted" >> /etc/apt/sources.list &&\
|
||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ zesty-updates main universe restricted" >> /etc/apt/sources.list &&\
|
||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ zesty-security main universe restricted" >> /etc/apt/sources.list &&\
|
||||
echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ zesty-backports main universe restricted" >> /etc/apt/sources.list &&\
|
||||
dpkg --add-architecture armhf && \
|
||||
dpkg --add-architecture arm64 && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -yy -q --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
ccache \
|
||||
cmake \
|
||||
crossbuild-essential-arm64 \
|
||||
crossbuild-essential-armhf \
|
||||
curl \
|
||||
git \
|
||||
jq \
|
||||
patch \
|
||||
yasm \
|
||||
zip && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# add cmake toolchains
|
||||
ADD toolchain /usr/local/toolchain
|
||||
|
||||
# set the working directory
|
||||
WORKDIR /build
|
||||
|
||||
ENV TERM=xterm
|
||||
@@ -1,30 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include ../image.mk
|
||||
|
||||
IMAGE = $(BUILD_REGISTRY)/cross-gnu-$(GOARCH)
|
||||
IMAGES := $(IMAGE)
|
||||
CACHE_IMAGES = $(IMAGES)
|
||||
|
||||
BASEIMAGE = $(BUILD_REGISTRY)/base-$(GOARCH)
|
||||
|
||||
TEMP := $(shell mktemp -d)
|
||||
|
||||
do.build:
|
||||
@echo === docker build $(IMAGE)
|
||||
@cp -a . $(TEMP)
|
||||
@cd $(TEMP) && $(SED_CMD) 's|BASEIMAGE|$(BASEIMAGE)|g' Dockerfile
|
||||
@docker build $(BUILD_ARGS) -t $(IMAGE) $(TEMP)
|
||||
@rm -fr $(TEMP)
|
||||
@@ -1,37 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
set(cross_triple "aarch64-linux-gnu")
|
||||
|
||||
set(CMAKE_C_COMPILER "/usr/lib/ccache/${cross_triple}-gcc" CACHE PATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER "/usr/lib/ccache/${cross_triple}-g++" CACHE PATH "C++ compiler")
|
||||
set(CMAKE_ASM_COMPILER "/usr/bin/${cross_triple}-gcc" CACHE PATH "assembler")
|
||||
set(CMAKE_STRIP "/usr/bin/${cross_triple}-strip" CACHE PATH "strip")
|
||||
set(CMAKE_AR "/usr/bin/${cross_triple}-ar" CACHE PATH "archive")
|
||||
set(CMAKE_LINKER "/usr/bin/${cross_triple}-ld" CACHE PATH "linker")
|
||||
set(CMAKE_NM "/usr/bin/${cross_triple}-nm" CACHE PATH "nm")
|
||||
set(CMAKE_OBJCOPY "/usr/bin/${cross_triple}-objcopy" CACHE PATH "objcopy")
|
||||
set(CMAKE_OBJDUMP "/usr/bin/${cross_triple}-objdump" CACHE PATH "objdump")
|
||||
set(CMAKE_RANLIB "/usr/bin/${cross_triple}-ranlib" CACHE PATH "ranlib")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-aarch64-static)
|
||||
@@ -1,37 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR armhf)
|
||||
|
||||
set(cross_triple "arm-linux-gnueabihf")
|
||||
|
||||
set(CMAKE_C_COMPILER "/usr/lib/ccache/${cross_triple}-gcc" CACHE PATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER "/usr/lib/ccache/${cross_triple}-g++" CACHE PATH "C++ compiler")
|
||||
set(CMAKE_ASM_COMPILER "/usr/bin/${cross_triple}-gcc" CACHE PATH "assembler")
|
||||
set(CMAKE_STRIP "/usr/bin/${cross_triple}-strip" CACHE PATH "strip")
|
||||
set(CMAKE_AR "/usr/bin/${cross_triple}-ar" CACHE PATH "archive")
|
||||
set(CMAKE_LINKER "/usr/bin/${cross_triple}-ld" CACHE PATH "linker")
|
||||
set(CMAKE_NM "/usr/bin/${cross_triple}-nm" CACHE PATH "nm")
|
||||
set(CMAKE_OBJCOPY "/usr/bin/${cross_triple}-objcopy" CACHE PATH "objcopy")
|
||||
set(CMAKE_OBJDUMP "/usr/bin/${cross_triple}-objdump" CACHE PATH "objdump")
|
||||
set(CMAKE_RANLIB "/usr/bin/${cross_triple}-ranlib" CACHE PATH "ranlib")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm-static)
|
||||
@@ -1,37 +0,0 @@
|
||||
# Copyright 2016 The Rook Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(cross_triple "x86_64-linux-gnu")
|
||||
|
||||
set(CMAKE_C_COMPILER "/usr/lib/ccache/${cross_triple}-gcc" CACHE PATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER "/usr/lib/ccache/${cross_triple}-g++" CACHE PATH "C++ compiler")
|
||||
set(CMAKE_ASM_COMPILER "/usr/bin/${cross_triple}-gcc" CACHE PATH "assembler")
|
||||
set(CMAKE_STRIP "/usr/bin/${cross_triple}-strip" CACHE PATH "strip")
|
||||
set(CMAKE_AR "/usr/bin/${cross_triple}-ar" CACHE PATH "archive")
|
||||
set(CMAKE_LINKER "/usr/bin/${cross_triple}-ld" CACHE PATH "linker")
|
||||
set(CMAKE_NM "/usr/bin/${cross_triple}-nm" CACHE PATH "nm")
|
||||
set(CMAKE_OBJCOPY "/usr/bin/${cross_triple}-objcopy" CACHE PATH "objcopy")
|
||||
set(CMAKE_OBJDUMP "/usr/bin/${cross_triple}-objdump" CACHE PATH "objdump")
|
||||
set(CMAKE_RANLIB "/usr/bin/${cross_triple}-ranlib" CACHE PATH "ranlib")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-x86_64-static)
|
||||
@@ -47,7 +47,7 @@ ENV PATH /usr/local/go/bin:$PATH
|
||||
|
||||
# precompile the go standard library for all supported platforms and configurations
|
||||
# the install suffixes match those in golang.mk so please keep them in sync
|
||||
RUN platforms="darwin_amd64 windows_amd64 linux_arm linux_amd64 linux_arm64" && \
|
||||
RUN platforms="darwin_amd64 windows_amd64 linux_amd64 linux_arm64" && \
|
||||
for p in $platforms; do CGO_ENABLED=0 GOOS=${p%_*} GOARCH=${p##*_} GOARM=7 go install -installsuffix static -a std; done
|
||||
|
||||
COPY run.sh rsyncd.sh /build/
|
||||
|
||||
+23
-39
@@ -14,48 +14,32 @@
|
||||
|
||||
FROM BASEIMAGE
|
||||
|
||||
ARG EXTRALIBS
|
||||
|
||||
# install runtime dependencies for ceph and rook
|
||||
RUN BOOST_VERSION=1.62.0 && \
|
||||
# add Ceph and other packages needed
|
||||
ADD 'https://download.ceph.com/keys/release.asc' /tmp/release.asc
|
||||
RUN CEPH_VERSION=luminous && \
|
||||
apt-key add /tmp/release.asc && \
|
||||
echo "deb http://download.ceph.com/debian-$CEPH_VERSION/ xenial main" | tee /etc/apt/sources.list.d/ceph-$CEPH_VERSION.list && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -yy -q --no-install-recommends \
|
||||
ca-certificates \
|
||||
gdisk \
|
||||
ceph-common \
|
||||
ceph-mon \
|
||||
ceph-osd \
|
||||
ceph-mds \
|
||||
ceph-mgr \
|
||||
kmod \
|
||||
libaio1 \
|
||||
libboost-context${BOOST_VERSION} \
|
||||
libboost-coroutine${BOOST_VERSION} \
|
||||
libboost-date-time${BOOST_VERSION} \
|
||||
libboost-filesystem${BOOST_VERSION} \
|
||||
libboost-iostreams${BOOST_VERSION} \
|
||||
libboost-program-options${BOOST_VERSION} \
|
||||
libboost-python${BOOST_VERSION} \
|
||||
libboost-random${BOOST_VERSION} \
|
||||
libboost-regex${BOOST_VERSION} \
|
||||
libboost-system${BOOST_VERSION} \
|
||||
libboost-thread${BOOST_VERSION} \
|
||||
libcurl3-gnutls \
|
||||
libexpat1 \
|
||||
libibverbs1 \
|
||||
libldap-2.4-2 \
|
||||
libnss3 \
|
||||
libpython2.7 \
|
||||
libsnappy1v5 \
|
||||
python-prettytable \
|
||||
python2.7-minimal \
|
||||
python-cherrypy3:${ARCH} \
|
||||
python-pecan:${ARCH} \
|
||||
python-openssl:${ARCH} \
|
||||
${EXTRALIBS} && \
|
||||
radosgw \
|
||||
rbd-mirror && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# add the ceph binaries
|
||||
ADD ceph-install.tar /
|
||||
|
||||
# ensure dynamic libraries are updated
|
||||
RUN ldconfig
|
||||
|
||||
ENV PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean && \
|
||||
rm -rf \
|
||||
/etc/{selinux,systemd,udev} \
|
||||
/lib/{lsb,udev} \
|
||||
/tmp/* \
|
||||
/usr/lib/{locale,systemd,udev} \
|
||||
/usr/share/{doc,info,man} \
|
||||
/var/cache/debconf/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/log/* \
|
||||
/var/tmp/*
|
||||
+3
-31
@@ -26,42 +26,14 @@ BASEIMAGE = $(BUILD_REGISTRY)/base-$(GOARCH)
|
||||
|
||||
TEMP := $(shell mktemp -d)
|
||||
|
||||
# ====================================================================================
|
||||
# Build Ceph
|
||||
|
||||
CEPH_BUILD_TYPE ?= release
|
||||
|
||||
ifeq ($(GOARCH),amd64)
|
||||
CEPH_ALLOCATOR ?= tcmalloc
|
||||
else
|
||||
CEPH_ALLOCATOR ?= libc
|
||||
endif
|
||||
|
||||
ifeq ($(CEPH_ALLOCATOR),tcmalloc)
|
||||
EXTRA_LIBS += libgoogle-perftools4
|
||||
endif
|
||||
ifeq ($(CEPH_ALLOCATOR),tcmalloc_minimal)
|
||||
EXTRA_LIBS += libtcmalloc_minimal4
|
||||
endif
|
||||
ifeq ($(CEPH_ALLOCATOR),jemalloc)
|
||||
EXTRA_LIBS += libjemalloc1
|
||||
endif
|
||||
|
||||
CEPH_TARBALL_FILENAME = ceph-install.tar
|
||||
CEPH_TARBALL = $(TEMP)/$(CEPH_TARBALL_FILENAME)
|
||||
|
||||
$(CEPH_TARBALL):
|
||||
@echo === building ceph for $(ROOK_IMAGE)
|
||||
@$(MAKE) -C ../ceph GOARCH=$(GOARCH) CEPH_ALLOCATOR=$(CEPH_ALLOCATOR) CEPH_BUILD_TYPE=$(CEPH_BUILD_TYPE) $(CEPH_TARBALL)
|
||||
|
||||
# ====================================================================================
|
||||
# Build Rook
|
||||
|
||||
rook-base-image: $(CEPH_TARBALL)
|
||||
rook-base-image:
|
||||
@echo === docker build $(ROOK_BASE_IMAGE)
|
||||
@cp Dockerfile.base $(TEMP)/Dockerfile
|
||||
@cd $(TEMP) && $(SED_CMD) 's|BASEIMAGE|$(BASEIMAGE)|g' Dockerfile
|
||||
@docker build $(BUILD_ARGS) --build-arg EXTRALIBS=$(EXTRA_LIBS) -t $(ROOK_BASE_IMAGE) $(TEMP)
|
||||
@docker build $(BUILD_ARGS) -t $(ROOK_BASE_IMAGE) $(TEMP)
|
||||
|
||||
# since this is a leaf image we avoid leaving around a lot of dangling images
|
||||
# by removing the last build of the final rook image
|
||||
@@ -82,4 +54,4 @@ do.build: rook-base-image
|
||||
mkdir -p $(IMAGE_OUTPUT_DIR); \
|
||||
docker save $(ROOK_IMAGE) | gzip -c > $(IMAGE_FILENAME); \
|
||||
fi
|
||||
@rm -fr $(TEMP)
|
||||
@rm -fr $(TEMP)
|
||||
@@ -15,7 +15,7 @@
|
||||
FROM BASEIMAGE
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -yy -q --no-install-recommends \
|
||||
binutils \
|
||||
s3cmd \
|
||||
curl \
|
||||
@@ -31,4 +31,13 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
rm -rf \
|
||||
/etc/{selinux,systemd,udev} \
|
||||
/lib/{lsb,udev} \
|
||||
/tmp/* \
|
||||
/usr/lib/{locale,systemd,udev} \
|
||||
/usr/share/{doc,info,man} \
|
||||
/var/cache/debconf/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/log/* \
|
||||
/var/tmp/*
|
||||
Reference in new issue
Block a user