Corpus structure

ceph.git/ceph-object-corpus is a submodule.:

  1. bin/ # misc scripts
  2. archive/$version/objects/$type/$hash # a sample of encoded objects from a specific version

You can also mark known or deliberate incompatibilities between versions with:

  1. archive/$version/forward_incompat/$type

The presence of a file indicates that new versions of code cannotdecode old objects across that $version (this is normally the case).

How to generate an object corpus

We can generate an object corpus for a particular version of ceph using thescript of script/gen-corpus.sh, or by following the instructions below:

  • Checkout a clean repo (best not to do this where you normally work):
  1. git clone ceph.git
  2. cd ceph
  3. git submodule update --init --recursive
  • Build with flag to dump objects to /tmp/foo:
  1. rm -rf /tmp/foo ; mkdir /tmp/foo
  2. do_cmake.sh -DCMAKE_CXX_FLAGS="-DENCODE_DUMP_PATH=/tmp/foo"
  3. cd build
  4. make
  • Start via vstart:
  1. cd build
  2. MON=3 MGR=2 OSD=3 MDS=3 RGW=1 ../src/vstart.sh -n -x
  • Use as much functionality of the cluster as you can, to exercise as many object encoder methods as possible:
  1. bin/ceph osd pool create mypool
  2. bin/rados -p mypool bench 10 write -b 123
  3. bin/ceph osd out 0
  4. bin/ceph osd in 0
  5. bin/init-ceph restart osd.1
  6. for f in ../qa/workunits/cls/*.sh ; do PATH="bin:$PATH" $f ; done
  7. PATH="bin:$PATH" ../qa/workunits/rados/test.sh
  8. bin/ceph_test_librbd
  9. bin/ceph_test_libcephfs
  10. bin/init-ceph restart mds.a
  11. ../qa/workunits/rgw/run-s3tests.sh
  • Stop:
  1. ../src/stop.sh
  • Import the corpus (this will take a few minutes):
  1. ../src/test/encoding/import.sh /tmp/foo `bin/ceph-dencoder version` ../ceph-object-corpus/archive
  2. ../src/test/encoding/import-generated.sh ../ceph-object-corpus/archive
  • Prune it! There will be a bazillion copies of various objects, and we only want a representative sample.:
  1. pushd ../ceph-object-corpus
  2. bin/prune-archive.sh
  3. popd
  • Verify the tests pass:
  1. ctest -R readable.sh
  • Commit it to the corpus repo and push:
  1. pushd ../ceph-object-corpus
  2. git checkout -b wip-new
  3. git add archive/`../build/bin/ceph-dencoder version`
  4. git commit -m `../build/bin/ceph-dencoder version`
  5. git remote add cc git@github.com:ceph/ceph-object-corpus.git
  6. git push cc wip-new
  7. popd
  • Go test it out:
  1. cd my/regular/tree
  2. cd ceph-object-corpus
  3. git fetch origin
  4. git checkout wip-new
  5. cd ../build
  6. ctest -R readable.sh
  • If everything looks good, update the submodule master branch, and commit the submodule in ceph.git.