Skip to content
Michael Sevilla edited this page Jun 7, 2016 · 12 revisions

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.

Ceph

  1. Customize the Docker run command:

    wget https://raw.githubusercontent.com/ivotron/docker-cephdev/master/aliases.sh
    . aliases.sh
  2. 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` \
      systemslab/builder-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.

Modify Source Code and Rebuild

Assuming you are in the ceph directory created above:

  1. Change permissions since the Docker container runs as the root user:

    sudo chown -R ${USER}:${USER} .
  2. 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();
     }
  3. Recompile Ceph and build a new image:

    dmake systemslab/builder-ceph:jewel build-cmake
  4. 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)

Mantle

  1. Customize the Docker run command:

    wget https://raw.githubusercontent.com/ivotron/docker-cephdev/master/aliases.sh
    . aliases.sh
  2. Compile Ceph and build the Docker image with the new binaries:

    mkdir ceph; cd ceph
    dmake \
      -e GIT_URL="https://github.com/michaelsevilla/ceph.git" \
      -e SHA1_OR_REF="remotes/origin/cls-lua-mantle-jewel" \
      -e RECONFIGURE="true" \
      -e BUILD_THREADS=`grep proc /proc/cpuinfo | wc -l` \
      systemslab/builder-mantle:jewel \
      build-make
  3. Make some changes to the source code, then recompile and build a new image:

    dmake systemslab/builder-mantle:jewel build-make
  4. Verify that the new image got built:

    $ docker run --entrypoint=ceph-fuse mantle:latest --version
    MSEVILLA's ceph version 9.0.0-11612-ga018acb (a018acbd46aefacf3a540e94a850ce3aaae4312d)

For a description of these commands and for directions on making changes to the source code and recompiling, please see the Ceph section above.

Clone this wiki locally