Skip to content

Commit

Permalink
Merge PR ceph#29427 into master
Browse files Browse the repository at this point in the history
* refs/pull/29427/head:
	mgr/rook: Make use of rook-client-python when talking to Rook
	cmake: Integrate Rook client generation
	mgr/rook: Automatically generate Rook client interface
	Add submodule to rook-client-python.git

Reviewed-by: Sage Weil <[email protected]>
Reviewed-by: Juan Miguel Olmo <[email protected]>
  • Loading branch information
liewegas committed Feb 13, 2020
2 parents 1de3145 + 846761e commit 6846894
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 166 deletions.
1 change: 1 addition & 0 deletions .githubmap
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,4 @@ ideepika Deepika Upadhyay <[email protected]>
p-se Patrick Seidensal <[email protected]>
ronen-fr Ronen Friedman <[email protected]>
yaarith Yaarit Hatuka <[email protected]>
jmolmo Juan Miguel Olmo <[email protected]>
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@
[submodule "src/spawn"]
path = src/spawn
url = https://github.com/ceph/spawn.git
[submodule "src/pybind/mgr/rook/rook-client-python"]
path = src/pybind/mgr/rook/rook-client-python
url = https://github.com/ceph/rook-client-python.git
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@ set(DASHBOARD_FRONTEND_LANGS "" CACHE STRING
"List of comma separated ceph-dashboard frontend languages to build. \
Use value `ALL` to build all languages")

# TODO: make this an option and set it to the same value as WITH_MGR_DASHBOARD_FRONTEND
set(WITH_MGR_ROOK_CLIENT WITH_MGR_DASHBOARD_FRONTEND)

include_directories(SYSTEM ${PROJECT_BINARY_DIR}/include)

find_package(Threads REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ Group: System/Filesystems
%endif
Requires: ceph-mgr = %{_epoch_prefix}%{version}-%{release}
Requires: python%{python3_pkgversion}-kubernetes
Requires: python%{python3_pkgversion}-jsonpatch
%description mgr-rook
ceph-mgr-rook is a ceph-mgr plugin for orchestration functions using
a Rook backend.
Expand Down
7 changes: 7 additions & 0 deletions make-dist
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ build_dashboard_frontend() {
tar cf dashboard_frontend.tar $outfile/src/pybind/mgr/dashboard/frontend/dist
}

generate_rook_ceph_client() {
$outfile/src/pybind/mgr/rook/generate_rook_ceph_client.sh
tar cf rook_ceph_client.tar $outfile/src/pybind/mgr/rook/rook_client/*.py
}

# clean out old cruft...
echo "cleanup..."
rm -f $outfile*
Expand Down Expand Up @@ -141,10 +146,12 @@ download_boost $boost_version 59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa
https://download.ceph.com/qa

build_dashboard_frontend
generate_rook_ceph_client
tar --concatenate -f $outfile.all.tar $outfile.version.tar
tar --concatenate -f $outfile.all.tar $outfile.boost.tar
tar --concatenate -f $outfile.all.tar $outfile.tar
tar --concatenate -f $outfile.all.tar dashboard_frontend.tar
tar --concatenate -f $outfile.all.tar rook_ceph_client.tar
mv $outfile.all.tar $outfile.tar
rm $outfile
rm -f $outfile.version.tar
Expand Down
2 changes: 2 additions & 0 deletions src/pybind/mgr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if(WITH_MGR_DASHBOARD_FRONTEND)
add_subdirectory(dashboard)
endif()
add_subdirectory(insights)
add_subdirectory(rook)

if(WITH_TESTS)
include(AddCephTest)
Expand All @@ -18,6 +19,7 @@ install(DIRECTORY
REGEX ".*\\.pyi" EXCLUDE
REGEX "hello/.*" EXCLUDE
REGEX "tests/.*" EXCLUDE
REGEX "rook/rook-client-python.*" EXCLUDE
REGEX "osd_perf_query/.*" EXCLUDE
REGEX "tox.ini" EXCLUDE
REGEX "requirements.txt" EXCLUDE)
1 change: 1 addition & 0 deletions src/pybind/mgr/rook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rook_client
18 changes: 18 additions & 0 deletions src/pybind/mgr/rook/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# if(WITH_MGR_DASHBOARD_FRONTEND AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64|arm|ARM")

if (WITH_MGR_ROOK_CLIENT)
add_custom_command(
OUTPUT rook_client/__init__.py
COMMAND ./generate_rook_ceph_client.sh
DEPENDS rook_cluster.py
COMMENT "generating mgr/rook/rook_client"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src/pybind/mgr/rook")

add_custom_target(mgr-rook-client
ALL
DEPENDS rook_client/__init__.py
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/src/pybind/mgr/rook"
)

add_dependencies(ceph-mgr mgr-rook-client)
endif (WITH_MGR_ROOK_CLIENT)
14 changes: 14 additions & 0 deletions src/pybind/mgr/rook/generate_rook_ceph_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -ex

script_location="$(dirname "$(readlink -f "$0")")"
cd "$script_location"

rm -rf rook_client


cp -r ./rook-client-python/rook_client .
rm -rf rook_client/cassandra
rm -rf rook_client/edgefs
rm -rf rook_client/tests
2 changes: 2 additions & 0 deletions src/pybind/mgr/rook/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kubernetes
jsonpatch
1 change: 1 addition & 0 deletions src/pybind/mgr/rook/rook-client-python
Submodule rook-client-python added at 0b46d5
Loading

0 comments on commit 6846894

Please sign in to comment.