-
Notifications
You must be signed in to change notification settings - Fork 4
Quickstart
These directions will compile and build a Docker daemon image for Ceph, Mantle, or ZLog. Once you've built your code into a Docker image, you'll want to distribute it to all nodes in your cluster -- a tutorial for distributing images is here.
-
Before you start, pull in the Docker image you want to layer your changes onto and tag it so our Docker containers know where to find it:
docker pull ceph/daemon:tag-build-master-jewel-ubuntu-14.04 docker tag ceph/daemon:tag-build-master-jewel-ubuntu-14.04 ceph/daemon:jewel
-
Customize the Docker run command:
wget https://raw.githubusercontent.com/systemslab/docker-cephdev/master/aliases.sh . aliases.sh
-
Compile Ceph and build the Docker image with the new binaries:
mkdir ceph; cd ceph dmake \ -e GIT_URL="https://github.com/ceph/ceph.git" \ -e SHA1_OR_REF="remotes/origin/jewel" \ -e RECONFIGURE="true" \ -e BUILD_THREADS=`grep processor /proc/cpuinfo | wc -l` \ cephbuilder/ceph:jewel \ build-cmake
This tells the builder to pull the source code from 'GIT_URL
', checkout
branch 'SHA1_OR_REF
', and reconfigure the source code. The RECONFIGURE
flag
differs depending on the selection of cmake
or make
(e.g., for make
this
will do ./autogen.sh
and ./configure
). The 'BUILD_THREADS
' environment
variable sets the number of cores to use during the compilation; in the example
above, we use all available cores.
By default, the Ceph source code is saved in the ceph
directory created in
Step 2.
Assuming you are in the ceph
directory created above:
-
Change permissions since the Docker container runs as the
root
user:sudo chown -R ${USER}:${USER} .
-
Make a change; for example:
diff --git a/src/common/version.cc b/src/common/version.cc index 0ca569e..33232e4 100644 --- a/src/common/version.cc +++ b/src/common/version.cc @@ -35,7 +35,7 @@ const char *git_version_to_str(void) std::string const pretty_version_to_str(void) { std::ostringstream oss; - oss << "ceph version " << CEPH_GIT_NICE_VER << " (" + oss << "CUSTOMIZED ceph version " << CEPH_GIT_NICE_VER << " (" << STRINGIFY(CEPH_GIT_VER) << ")"; return oss.str(); }
-
Recompile Ceph and build a new image:
dmake cephbuilder/ceph:jewel build-cmake
-
Verify that the new image got built:
$ docker run --entrypoint=ceph-fuse ceph-heads/remotes/origin/jewel --version CUSTOMIZED ceph version v10.2.1-39-g954af78 (954af787526a77b923fe85ed1282ba98277738e4)
To compile Ceph with LTTnG and to put the resulting binaries in an image:
cd docker-cephdev/ceph-lttng
CEPH_SRC=~/ceph-lttng ./build