Skip to content
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

Wip cmake make check #7912

Merged
merged 59 commits into from Apr 15, 2016
Merged

Wip cmake make check #7912

merged 59 commits into from Apr 15, 2016

Conversation

alimaredia
Copy link
Contributor

As long as these commit's don't break make check that jenkins runs, and the numerous other changes are agreed upon, there's no reason this CMake work shouldn't go be in ASAP

@alimaredia
Copy link
Contributor Author

@cbodley scrutanize away!

[ -z "$CEPH_LIB" ] && CEPH_LIB=.libs
[ -z $EC_PATH ] && EC_PATH=$CEPH_LIB
[ -z $CS_PATH ] && CS_PATH=$CEPH_LIB
[ -z $OBJCLASS_PATH ] && OBJCLASS_PATH=$CEPH_LIB
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcsp here are the changes made to vstart.sh. A good place to look at where some of these variables are defined is cmake/modules/AddCephTest.cmake

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection from me to any of the vstart stuff here (I'm assuming you've tried it and it all works) -- can you separate it into its own commit and bring it over to #7908?

Might also be worth checking that none of the other regular cmake users (@oritwas @tchaikov perhaps?) have any comments on the change to build everything in bin/ and lib/ before we merge it in #7908

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any problem with building everything in bin/ and lib/

set_block_device_sandbox_dir(root);
string root;
if (i == 0) {
string CEPH_ROOT = getenv("CEPH_ROOT");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protect against getenv returning nullptr.

@alimaredia
Copy link
Contributor Author

@dachary @tchaikov As long as make check passes in jenkins with automake, do you anticipate any of these changes breaking any parts of the Ceph CI processes (ex: teuthology)?

add_executable(ceph_test_cls_rbd
test_cls_rbd.cc
${CMAKE_SOURCE_DIR}/src/common/TextTable.cc
${CMAKE_SOURCE_DIR}/src/common/secret.c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these two not part of libcommon? we shouldn't have to recompile them here

@ghost
Copy link

ghost commented Mar 4, 2016

As long as make check passes in jenkins with automake, do you anticipate any of these changes breaking any parts of the Ceph CI processes (ex: teuthology)?

The only thing that could break teuthology is if you change files in the qa directory or in what is found in the ceph packages.

@cbodley
Copy link
Contributor

cbodley commented Mar 4, 2016

@alimaredia there are some linker errors with the test_librgw_file* targets with undefined references to heap profiler stuff

they only try to build under make, not make check, so they need to be updated to use add_ceph_unittest()

@cbodley
Copy link
Contributor

cbodley commented Mar 4, 2016

The only thing that could break teuthology is if you change files in the qa directory or in what is found in the ceph packages.

@dachary qa/workunits/ceph-helpers.sh was changed to support out-of-tree builds (relative paths to binaries were replaced with environment variables). It was pointing to stuff in .libs (which wouldn't come from installed ceph packages), so I would assume that it isn't used by teuthology?

@cbodley
Copy link
Contributor

cbodley commented Mar 4, 2016

the diff for src/test/CMakeLists.txt is too big for github, so comments here..

464: add_ceph_test(test-ceph-helpers.sh ${CMAKE_SOURCE_DIR}/src/test/test-ceph-helpers.sh)
use ${CMAKE_CURRENT_SOURCE_DIR}

478: add_dependencies(check run-tox) should be run-tox-ceph-disk?

481: add_dependencies(check run-tox) should be run-tox-ceph-detect-init?

483: set_property(TEST run-tox-ceph-disk ...
use add_ceph_test() if it works, or update PYTHONPATH= for cython path

@ghost
Copy link

ghost commented Mar 4, 2016

qa/workunits/ceph-helpers.sh was changed to support out-of-tree builds (relative paths to binaries were replaced with environment variables). It was pointing to stuff in .libs (which wouldn't come from installed ceph packages), so I would assume that it isn't used by teuthology?

It is used by teuthology, reason why it is in qa/workunits:

workunits/cephtool/test.sh:3:source $(dirname $0)/../ceph-helpers.sh
workunits/rbd/journal.sh:3:. $(dirname $0)/../ceph-helpers.sh
workunits/rbd/rbd-nbd.sh:3:. $(dirname $0)/../ceph-helpers.sh
workunits/rbd/test_admin_socket.sh:7:. $(dirname $0)/../ceph-helpers.sh

@alimaredia alimaredia force-pushed the wip-cmake-make-check branch 3 times, most recently from de1619f to 96ea965 Compare March 4, 2016 20:45
Added a CMakeLists.txt into test/rgw.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Added a CMakeLists.txt into test/system.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Added src/librbd and test/librbd CMakeLists.txt's,
various previously missing libraries and targets,
revised unittest_librbd.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in test/mon/osd-crush.sh
with CEPH_VAR environment variables set in cmake.

NOTE: test is not passing yet, possibly due to the
filesystem. this commit is a work in progress

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in test/cephtool-test-rados.sh,
qa/workunits/rados/test_rados_tool.sh,
src/test/vstart_wrapper.sh, with CEPH_FOO environment
variables set in cmake. Also edited the CMake path
finding logic in vstart.sh with the CEPH_FOO variables.

NOTE: test is not passing yet, possibly due to the
filesystem. this commit is a work in progress

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in test/cephtool-test-mon.sh,
qa/workunits/cephtool/test.sh, and test/cephtool-test-mon.sh
to work with CEPH_FOO environment variables set in cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in unittest_bufferlist.sh
to work with CEPH_FOO environment variables set in
cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in shell scripts in
test/ceph_objectstore_tool.py and init-ceph.in to
work with CEPH_FOO environment variables set in cmake.
Also added CEPH_BUILD_DIR environment variable set
to CMAKE_BINARY_DIR. It is used in init-ceph and
ceph_objectstore_tool.py.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in test-erausure-eio.sh
test-erasure-code.sh, and replaced .libs in
erasure_code unittests with CEPH_VAR environment
variables set in cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in test_objectstore_memstore.sh
with CEPH_VAR environment variables set in cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced .libs in TestClassHandler.cc with CEPH_LIB

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Added missing dependencies and link libraries for
erasure-decode-non-regression.sh and added absolute
paths to ceph_erasure_code_non_regression.cc.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Replaced relative paths in test_pidfile.sh
with CEPH_VAR environment variables set in cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Added rbd_mirror libraries, unit tests, executables

Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
)
set_target_properties(ceph_test_rados_api_list PROPERTIES COMPILE_FLAGS
${UNITTEST_CXX_FLAGS})
target_link_libraries(ceph_test_rados_api_list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to link against "global", see 769c0af

see 769c0af

Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor

@alimaredia i am trying to get your branch to pass the build at http://gitbuilder.sepia.ceph.com/gitbuilder-ceph-tarball-trusty-amd64-cmake/#origin/wip-cmake-make-check, so i added my fix on top of yours, please feel free to squash it into your corresponding commit(s) (83ff750).

@cbodley cbodley merged commit 69f8174 into master Apr 15, 2016
DIR *dir = ::opendir(".libs");
const char* env = getenv("CEPH_LIB");
std::string CEPH_LIB(env ? env : "lib");
DIR *dir = ::opendir(CEPH_LIB.c_str());
if (dir == NULL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alimaredia @cbodley Now if CEPH_LIB env is not set, "lib" is used instead of previously used ".libs". Was it intentionally?

% ./unittest_rbd_mirror               
2016-04-18 09:10:23.392541 7fb9f8fdeb00 -1 WARNING: the following dangerous and experimental features are enabled: *
[==========] Running 58 tests from 11 test cases.
[----------] Global test environment set-up.
[----------] 1 test from TestMockImageReplayer
[ RUN      ] TestMockImageReplayer.Blah
test/librados_test_stub/TestClassHandler.cc: In function 'void librados::TestClassHandler::open_all_classes()' thread 7fb9f8fdeb00 time 2016-04-18 09:10:23.500613
test/librados_test_stub/TestClassHandler.cc: 52: FAILED assert(false)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny This was done intentionally. ".libs" is an autotools convention and since we are moving toward using CMake. The "lib" was chosen because all the libraries in a CMake build go to ${CMAKE_BUILD_DIR}/lib.

I would love it if you transitioned to CMake and CTest (the environment variables are predefined there all you have to do is run ctest -V -R unittest_rbd_mirror but I understand your concern.

One thing I can do is add a check for if opendir(".libs") is true i can set *dir to that to make sure this test and others with the similar revisions work without running make check in the automake build. How does that sound?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alimaredia If it is intentional, I am fine with it. Not sure it is necessary to do any additional checks for compatibility, it might only increase the transition period. A more useful thing I think is to announce the new way to developers. It may already be done and I just missed it? At least a message in ceph-dev would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny @alimaredia I added the automatic setting of CEPH_LIB using .libs in my pull request #8649 just for the ceph_objectstore_tool.py test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny I've made the appropriate adjustments in #8770. I did end up changing "lib" to ".libs" since that is a good default that CEPH_LIB should revert back to for the time being

@tchaikov tchaikov deleted the wip-cmake-make-check branch April 19, 2016 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet