diff --git a/CMakeLists.txt b/CMakeLists.txt index b5974eccbf2598849bbd27cdac13e5d2d5ad686d..7c32a77ca020ad1bc7d84c1469cc24aee94ec227 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ IF(WIN32) ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "GNU") SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + SET(BUILD_SHARED_LIBS OFF) ENDIF(WIN32) #TODO: Better way then GLOBAL PROPERTY diff --git a/common/cpp/src/database/CMakeLists.txt b/common/cpp/src/database/CMakeLists.txt index 5467be48c86fca1899439167f56620cc824d487c..fd5589048a3e181df554228a86121826381636e8 100644 --- a/common/cpp/src/database/CMakeLists.txt +++ b/common/cpp/src/database/CMakeLists.txt @@ -9,9 +9,11 @@ set(SOURCE_FILES find_package (libmongoc-static-1.0 1.9 REQUIRED) message ("-- mongoc found version \"${MONGOC_STATIC_VERSION}\"") message ("-- mongoc include path \"${MONGOC_STATIC_INCLUDE_DIRS}\"") +IF (CMAKE_C_COMPILER_ID STREQUAL "GNU") + set (MONGOC_STATIC_LIBRARIES -Wl,-Bstatic ${MONGOC_STATIC_LIBRARIES} -Wl,-Bdynamic) +ENDIF() message ("-- mongoc libraries \"${MONGOC_STATIC_LIBRARIES}\"") - add_library(${TARGET_NAME} STATIC ${SOURCE_FILES} $<TARGET_OBJECTS:data_structs> $<TARGET_OBJECTS:json_parser> $<TARGET_OBJECTS:system_io>) target_include_directories(${TARGET_NAME} PUBLIC ${ASAPO_CXX_COMMON_INCLUDE_DIR} PUBLIC "${MONGOC_STATIC_INCLUDE_DIRS}") diff --git a/deploy/nomad_jobs/asapo-perfmetrics.nmd.in b/deploy/nomad_jobs/asapo-perfmetrics.nmd.in new file mode 100644 index 0000000000000000000000000000000000000000..3d9ec248de74663daa13222607a291632765e406 --- /dev/null +++ b/deploy/nomad_jobs/asapo-perfmetrics.nmd.in @@ -0,0 +1,108 @@ +job "asapo-perfmetrics" { + datacenters = ["dc1"] + +# update { +# max_parallel = 1 +# min_healthy_time = "10s" +# healthy_deadline = "3m" +# auto_revert = false +# } + + group "perfmetrics" { + count = 1 + restart { + attempts = 2 + interval = "3m" + delay = "15s" + mode = "delay" + } + + task "influxdb" { + driver = "docker" + + config { + dns_servers = ["127.0.0.1"] + network_mode = "host" + image = "influxdb" + volumes = ["/${meta.shared_storage}/influxdb:/var/lib/influxdb"] + } + + resources { + cpu = 500 + memory = 256 + network { + mbits = 10 + port "influxdb" { + static = 8086 + } + } + } + + service { + port = "influxdb" + name = "influxdb" + check { + name = "alive" + type = "http" + path = "/ping" + interval = "10s" + timeout = "1s" + } + check_restart { + limit = 2 + grace = "90s" + ignore_warnings = false + } + } + + } #influxdb + + + task "grafana" { + driver = "docker" + + env { + GF_SERVER_DOMAIN = "${attr.unique.hostname}" + GF_SERVER_ROOT_URL = "%(protocol)s://%(domain)s/performance/" + } + + config { + dns_servers = ["127.0.0.1"] + network_mode = "host" + image = "grafana/grafana" + volumes = ["/${meta.shared_storage}/grafana:/var/lib/grafana"] + } + + resources { + cpu = 500 + memory = 256 + network { + mbits = 10 + port "grafana" { + static = 3000 + } + } + } + + service { + port = "grafana" + name = "grafana" + check { + name = "alive" + type = "http" + path = "/api/health" + interval = "10s" + timeout = "1s" + } + check_restart { + limit = 2 + grace = "90s" + ignore_warnings = false + } + } + + } #grafana + + + } +} diff --git a/deploy/nomad_jobs/nginx.conf.tpl b/deploy/nomad_jobs/nginx.conf.tpl index 65a231fc44e5da41bb83070bbb3febe6f84f0839..d6fd1a2ad8e22a86db00c57ac3c1eaaea9a7bc80 100644 --- a/deploy/nomad_jobs/nginx.conf.tpl +++ b/deploy/nomad_jobs/nginx.conf.tpl @@ -21,6 +21,7 @@ http { set $authorizer_endpoint authorizer.service.asapo; set $fluentd_endpoint fluentd.service.asapo; set $kibana_endpoint kibana.service.asapo; + set $grafana_endpoint grafana.service.asapo; location /discovery/ { rewrite ^/discovery(/.*) $1 break; @@ -40,6 +41,11 @@ http { proxy_set_header Host $http_host; } + location /performance/ { + rewrite ^/performance(/.*) $1 break; + proxy_pass http://$grafana_endpoint:3000$uri$is_args$args; + } + location /authorizer/ { rewrite ^/authorizer(/.*) $1 break; proxy_pass http://$authorizer_endpoint:5007$uri$is_args$args; diff --git a/receiver/CMakeLists.txt b/receiver/CMakeLists.txt index c4b327d95e07c6c1eccdda2ed298abfe85f9b001..3390a85d7cab61dfcd39cd450408f9aae2d38e19 100644 --- a/receiver/CMakeLists.txt +++ b/receiver/CMakeLists.txt @@ -18,6 +18,7 @@ set(SOURCE_FILES ################################ # Library ################################ +#SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") add_library(${TARGET_NAME} STATIC ${SOURCE_FILES} $<TARGET_OBJECTS:system_io> $<TARGET_OBJECTS:curl_http_client> @@ -35,6 +36,9 @@ set_target_properties(${TARGET_NAME}-bin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}$<$<CONFIG:Debug>:> ) +configure_file(docker/Dockerfile . COPYONLY) + + ################################ # Testing ################################ diff --git a/receiver/docker/Dockerfile b/receiver/docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3d14f11c1dd2de9eed01f778215fcefa90d5900e --- /dev/null +++ b/receiver/docker/Dockerfile @@ -0,0 +1,3 @@ +FROM busybox:glibc +ADD receiver / +CMD ["/receiver","/var/lib/receiver/config.json"] \ No newline at end of file