New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osd: objclass sdk #14723
osd: objclass sdk #14723
Conversation
https://jenkins.ceph.com/job/ceph-pull-requests/22697/ @neha-ojha i don't think the build failure is relevant to your change. |
retest this please. |
Two questions:
|
|
1. that's fine; we don't have to do it all at once.
2. ok!
|
src/include/rados/objclass.h
Outdated
|
||
#include <map> | ||
#include <set> | ||
#include "../include/buffer.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small thing: change this to #include "buffer.h"
so it references the symlink in include/rados/buffer.h from the source tree, and the version installed by librados-dev when installed from packages (you've already got the dependency on that package so buffer.h will be installed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will change it.
great to see good docs and packaging included from the start! You can take DNM out of the commit message. Looks good to me beyond the small include change. |
@neha-ojha |
Would it be simpler to just leave zlog out, or do you want to get the
latest upstream into luminous?
|
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/12.0.1-1548-g6b64459/rpm/el7/BUILDROOT/ceph-12.0.1-1548.g6b64459.el7.x86_64 error: Installed (but unpackaged) file(s) found: /usr/include/rados/objclass.h during centos build |
looks like the %files section for the new package is missing from ceph.spec.in |
Per @liewegas removed as suspect breaking centos builds https://shaman.ceph.com/builds/ceph/wip-sage-testing_2017_4_27/ |
leaving |
ok. in that case, let's strip zlog out of this pr, including the
protobufs dependency. minimal works for me. thanks!
|
Sure. |
src/include/rados/objclass.h
Outdated
#ifdef __cplusplus | ||
|
||
#include <map> | ||
#include <set> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need to include set
and map
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they are not required now. I had included them for cls_cxx_getxattrs() and cls_cxx_map_get_keys(), which are no more a part of the api. I will remove them. Thanks for pointing that.
radostest | ||
${UNITTEST_LIBS} | ||
) | ||
install(TARGETS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would we install this test? i believe it's but a unittest, and is not exercised by any qa suite, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead i'd recommend add it using add_ceph_unittest()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the CMakeLists.txt for unittests of existing object classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neha-ojha, ceph_test_cls_sdk is not a "cls", it's an executable. could you point me to a unittest of existing object class unittest which installs the executable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly followed this https://github.com/ceph/ceph/blob/master/src/test/cls_hello/CMakeLists.txt#L15. But I can always incorporate your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neha-ojha oic. it's up to you to run this test as part of unit test ("make check"), or exercise it using qa/workunits/cls/test_cls_hello.sh
. i'd recommend the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov I made the following changes and it works. Is there anything else that I would need to change?
-
Removed the install section and added
add_ceph_unittest(ceph_test_cls_sdk ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph_test_cls_sdk) in CMakeLists.txt. -
Added qa/workunits/cls/test_cls_sdk.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neha-ojha you cannot do both. if you choose to run this test as part of "make check", then "add_ceph_unittest()", and there is no necessary to run it in qa/workunits/cls/test_cls_sdk.sh
, but if you choose otherwise, you need to package this test by install(TARGET ...)
, so qa/workunits/cls/test_cls_sdk.sh
can exercise it in a qa suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I'll add qa/workunits/cls/test_cls_sdk.sh. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to use add_ceph_unittest()
to add unittest.
Can you squash all of this down into one commit now that the zlog pieces are removed?
|
yes. |
ceph.spec.in
Outdated
@@ -718,6 +718,15 @@ This package contains the Java libraries for the Ceph File System. | |||
|
|||
%endif | |||
|
|||
%package -n rados-objclass-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rados-objclass-devel ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
right, the suffix is -devel for rpms
|
Creates an installable version of "src/include/rados/objclass.h" that allows object classes to be built outside of the Ceph tree. cls_sdk is an example of such an object class. Signed-off-by: Neha Ojha <nojha@redhat.com>
2017-04-28T22:01:36.530 INFO:tasks.workunit.client.0.smithi138.stdout:[==========] Running 2 tests from 1 test case. 2017-04-28T22:01:36.530 INFO:tasks.workunit.client.0.smithi138.stdout:[----------] Global test environment set-up. 2017-04-28T22:01:36.530 INFO:tasks.workunit.client.0.smithi138.stdout:[----------] 2 tests from ClsSDK 2017-04-28T22:01:36.530 INFO:tasks.workunit.client.0.smithi138.stdout:[ RUN ] ClsSDK.TestSDKCoverageWrite 2017-04-28T22:01:38.682 INFO:tasks.workunit.client.0.smithi138.stdout:/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/12.0.1-1708-gfa34740/rpm/el7/BUILD/ceph-12.0.1-1708-gfa34740/src/test/cls_sdk/test_cls_sdk.cc:1 7: Failure 2017-04-28T22:01:38.683 INFO:tasks.workunit.client.0.smithi138.stdout: Expected: 0 2017-04-28T22:01:38.683 INFO:tasks.workunit.client.0.smithi138.stdout:To be equal to: ioctx.exec("myobject", "sdk", "test_coverage_write", in, out) 2017-04-28T22:01:38.683 INFO:tasks.workunit.client.0.smithi138.stdout: Which is: -1 2017-04-28T22:01:38.683 INFO:tasks.ceph.osd.1.smithi138.stderr:2017-04-28 22:01:38.686067 7f9c65131700 -1 osd.1 98 class sdk open got (1) Operation not permitted 2017-04-28T22:01:38.686 INFO:tasks.workunit.client.0.smithi138.stdout:[ FAILED ] ClsSDK.TestSDKCoverageWrite (2156 ms) 2017-04-28T22:01:38.686 INFO:tasks.workunit.client.0.smithi138.stdout:[ RUN ] ClsSDK.TestSDKCoverageReplay 2017-04-28T22:01:40.920 INFO:tasks.workunit.client.0.smithi138.stdout:/home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/12.0.1-1708-gfa34740/rpm/el7/BUILD/ceph-12.0.1-1708-gfa34740/src/test/cls_sdk/test_cls_sdk.cc:3 0: Failure 2017-04-28T22:01:40.921 INFO:tasks.workunit.client.0.smithi138.stdout: Expected: 0 2017-04-28T22:01:40.921 INFO:tasks.workunit.client.0.smithi138.stdout:To be equal to: ioctx.exec("myobject", "sdk", "test_coverage_write", in, out) 2017-04-28T22:01:40.921 INFO:tasks.workunit.client.0.smithi138.stdout: Which is: -1 2017-04-28T22:01:40.921 INFO:tasks.ceph.osd.1.smithi138.stderr:2017-04-28 22:01:40.924241 7f9c65131700 -1 osd.1 100 class sdk open got (1) Operation not permitted 2017-04-28T22:01:40.923 INFO:tasks.workunit.client.0.smithi138.stdout:[ FAILED ] ClsSDK.TestSDKCoverageReplay (2237 ms) 2017-04-28T22:01:40.923 INFO:tasks.workunit.client.0.smithi138.stdout:[----------] 2 tests from ClsSDK (4393 ms total) /a/sage-2017-04-28_19:45:54-rados-wip-sage-testing---basic-smithi/1077690 I think we need to add sdk to the whitelist |
teuthology:1077690 12:44 AM $ cat summary.yaml so i would add an override to qa/suites/rados/basic/tasks/rados_cls_all.yaml with something like override: ceph: conf: osd: ... adding sdk to these options OPTION(osd_class_load_list, OPT_STR, "cephfs hello journal lock log numops " "rbd refcount replica_log rgw statelog timeindex user version") // list of object classes allowed to be loaded (allow all: *) OPTION(osd_class_default_list, OPT_STR, "cephfs hello journal lock log numops " "rbd refcount replica_log rgw statelog timeindex user version") // list of object classes with default execute perm (allow all: *) |
Signed-off-by: Neha Ojha <nojha@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conf overrides look good
This pull request aims at creating an object class SDK interface for building Ceph object classes outside the tree. The cls_sdk object class makes use of this interface. It has unittests that can be run to verify correctness.