]> git.proxmox.com Git - ceph.git/blob - ceph/doc/dev/corpus.rst
import 15.2.0 Octopus source
[ceph.git] / ceph / doc / dev / corpus.rst
1
2 Corpus structure
3 ================
4
5 ceph.git/ceph-object-corpus is a submodule.::
6
7 bin/ # misc scripts
8 archive/$version/objects/$type/$hash # a sample of encoded objects from a specific version
9
10 You can also mark known or deliberate incompatibilities between versions with::
11
12 archive/$version/forward_incompat/$type
13
14 The presence of a file indicates that new versions of code cannot
15 decode old objects across that $version (this is normally the case).
16
17
18 How to generate an object corpus
19 --------------------------------
20
21 We can generate an object corpus for a particular version of ceph using the
22 script of ``script/gen-corpus.sh``, or by following the instructions below:
23
24 #. Checkout a clean repo (best not to do this where you normally work)::
25
26 git clone ceph.git
27 cd ceph
28 git submodule update --init --recursive
29
30 #. Build with flag to dump objects to ``/tmp/foo``::
31
32 rm -rf /tmp/foo ; mkdir /tmp/foo
33 do_cmake.sh -DCMAKE_CXX_FLAGS="-DENCODE_DUMP_PATH=/tmp/foo"
34 cd build
35 make
36
37 #. Start via vstart::
38
39 cd build
40 MON=3 MGR=2 OSD=3 MDS=3 RGW=1 ../src/vstart.sh -n -x
41
42 #. Use as much functionality of the cluster as you can, to exercise as many object encoder methods as possible::
43
44 bin/ceph osd pool create mypool
45 bin/rados -p mypool bench 10 write -b 123
46 bin/ceph osd out 0
47 bin/ceph osd in 0
48 bin/init-ceph restart osd.1
49 for f in ../qa/workunits/cls/*.sh ; do PATH="bin:$PATH" $f ; done
50 PATH="bin:$PATH" ../qa/workunits/rados/test.sh
51 bin/ceph_test_librbd
52 bin/ceph_test_libcephfs
53 bin/init-ceph restart mds.a
54 ../qa/workunits/rgw/run-s3tests.sh
55
56 #. Stop::
57
58 ../src/stop.sh
59
60 #. Import the corpus (this will take a few minutes)::
61
62 ../src/test/encoding/import.sh /tmp/foo `bin/ceph-dencoder version` ../ceph-object-corpus/archive
63 ../src/test/encoding/import-generated.sh ../ceph-object-corpus/archive
64
65 #. Prune it! There will be a bazillion copies of various objects, and we only want a representative sample.::
66
67 pushd ../ceph-object-corpus
68 bin/prune-archive.sh
69 popd
70
71 #. Verify the tests pass::
72
73 ctest -R readable.sh
74
75 #. Commit it to the corpus repo and push::
76
77 pushd ../ceph-object-corpus
78 git checkout -b wip-new
79 git add archive/`../build/bin/ceph-dencoder version`
80 git commit -m `../build/bin/ceph-dencoder version`
81 git remote add cc git@github.com:ceph/ceph-object-corpus.git
82 git push cc wip-new
83 popd
84
85 #. Go test it out::
86
87 cd my/regular/tree
88 cd ceph-object-corpus
89 git fetch origin
90 git checkout wip-new
91 cd ../build
92 ctest -R readable.sh
93
94 #. If everything looks good, update the submodule master branch, and commit the submodule in ceph.git.
95
96
97
98