mirror of
https://github.com/ceph/ceph
synced 2025-02-18 16:37:41 +00:00
monitoring: build jsonnet/jb only for testing
Build jsonnet and jb in the testso that we can build ceph without internet access and still be able to run the test needed for monitoring using jsonnet tools. Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
This commit is contained in:
parent
ecaf9070ae
commit
8ff1e6b399
@ -6,35 +6,39 @@ if(WITH_GRAFANA)
|
||||
${CEPH_GRAFANA_DASHBOARDS}
|
||||
DESTINATION ${CEPH_GRAFANA_DASHBOARDS_DIR})
|
||||
if(WITH_TESTS)
|
||||
ExternalProject_Add(jsonnet-bundler
|
||||
GIT_REPOSITORY "https://github.com/jsonnet-bundler/jsonnet-bundler.git"
|
||||
GIT_TAG "v0.4.0"
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/jsonnet-bundler
|
||||
CONFIGURE_COMMAND ""
|
||||
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/src
|
||||
BUILD_COMMAND make build
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND cp <SOURCE_DIR>/_output/jb <INSTALL_DIR>)
|
||||
|
||||
ExternalProject_Add(jsonnet
|
||||
GIT_REPOSITORY "https://github.com/google/go-jsonnet.git"
|
||||
GIT_TAG "v0.18.0"
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src
|
||||
CONFIGURE_COMMAND ""
|
||||
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/src
|
||||
BUILD_COMMAND make build
|
||||
BUILD_IN_SOURCE 1
|
||||
INSTALL_COMMAND cp <SOURCE_DIR>/_output/jsonnet <INSTALL_DIR>)
|
||||
|
||||
set(CEPH_BUILD_VIRTUALENV $ENV{TMPDIR})
|
||||
if(NOT CEPH_BUILD_VIRTUALENV)
|
||||
include(AddCephTest)
|
||||
set(CEPH_BUILD_VIRTUALENV ${CMAKE_BINARY_DIR})
|
||||
|
||||
add_test(NAME jsonnet-build
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jsonnet-build.sh ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set_property(TEST jsonnet-build PROPERTY
|
||||
FIXTURES_SETUP jsonnet)
|
||||
add_test(NAME jsonnet-cleanup
|
||||
COMMAND rm -rf go-jsonnet
|
||||
${CMAKE_CURRENT_BINARY_DIR}/jsonnet
|
||||
${CMAKE_CURRENT_BINARY_DIR}/jsonnetfmt)
|
||||
set_property(TEST jsonnet-cleanup PROPERTY
|
||||
FIXTURES_CLEANUP jsonnet)
|
||||
|
||||
add_test(NAME jsonnet-bundler-build
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jsonnet-bundler-build.sh ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set_property(TEST jsonnet-bundler-build PROPERTY
|
||||
FIXTURES_SETUP jsonnet-bundler)
|
||||
add_test(NAME jsonnet-bundler-cleanup
|
||||
COMMAND rm -rf jsonnet-bundler ${CMAKE_CURRENT_BINARY_DIR}/jb)
|
||||
set_property(TEST jsonnet-bundler-cleanup PROPERTY
|
||||
FIXTURES_CLEANUP jsonnet-bundler)
|
||||
|
||||
add_tox_test(grafana-lint TOX_ENVS lint)
|
||||
add_tox_test(jsonnet-lint TOX_ENVS jsonnet-lint)
|
||||
set_property(TEST run-tox-jsonnet-lint PROPERTY
|
||||
FIXTURES_REQUIRED venv-for-jsonnet-lint jsonnet)
|
||||
add_tox_test(jsonnet-check TOX_ENVS jsonnet-check)
|
||||
set_property(TEST run-tox-jsonnet-check PROPERTY
|
||||
FIXTURES_REQUIRED venv-for-jsonnet-check jsonnet jsonnet-bundler)
|
||||
|
||||
add_tox_test(alerts-check TOX_ENVS alerts-check)
|
||||
add_tox_test(alerts-lint TOX_ENVS alerts-lint)
|
||||
add_tox_test(promql-query-test TOX_ENVS promql-query-test)
|
||||
|
10
monitoring/ceph-mixin/jsonnet-build.sh
Executable file
10
monitoring/ceph-mixin/jsonnet-build.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
JSONNET_VERSION="v0.18.0"
|
||||
OUTPUT_DIR=${1:-$(pwd)}
|
||||
|
||||
git clone -b ${JSONNET_VERSION} --depth 1 https://github.com/google/go-jsonnet.git
|
||||
cd go-jsonnet
|
||||
go build ./cmd/jsonnet
|
||||
go build ./cmd/jsonnetfmt
|
||||
mv jsonnet jsonnetfmt ${OUTPUT_DIR}
|
8
monitoring/ceph-mixin/jsonnet-bundler-build.sh
Executable file
8
monitoring/ceph-mixin/jsonnet-bundler-build.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
JSONNET_VERSION="v0.4.0"
|
||||
OUTPUT_DIR=${1:-$(pwd)}
|
||||
|
||||
git clone -b ${JSONNET_VERSION} --depth 1 https://github.com/jsonnet-bundler/jsonnet-bundler
|
||||
make -C jsonnet-bundler build
|
||||
mv jsonnet-bundler/_output/jb ${OUTPUT_DIR}
|
Loading…
Reference in New Issue
Block a user