From 066d27181e9a797ad9f8fc43b49fc9a10ff2f707 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 3 Mar 2019 13:42:34 +0000 Subject: gentoo resync : 03.03.2019 --- www-apps/trickster-bin/Manifest | 6 ++ www-apps/trickster-bin/files/trickster.conf | 113 ++++++++++++++++++++++ www-apps/trickster-bin/files/trickster.initd | 20 ++++ www-apps/trickster-bin/files/trickster.service | 17 ++++ www-apps/trickster-bin/metadata.xml | 8 ++ www-apps/trickster-bin/trickster-bin-0.1.7.ebuild | 42 ++++++++ 6 files changed, 206 insertions(+) create mode 100644 www-apps/trickster-bin/Manifest create mode 100644 www-apps/trickster-bin/files/trickster.conf create mode 100755 www-apps/trickster-bin/files/trickster.initd create mode 100644 www-apps/trickster-bin/files/trickster.service create mode 100644 www-apps/trickster-bin/metadata.xml create mode 100644 www-apps/trickster-bin/trickster-bin-0.1.7.ebuild (limited to 'www-apps/trickster-bin') diff --git a/www-apps/trickster-bin/Manifest b/www-apps/trickster-bin/Manifest new file mode 100644 index 000000000000..d76a303aa93a --- /dev/null +++ b/www-apps/trickster-bin/Manifest @@ -0,0 +1,6 @@ +AUX trickster.conf 4756 BLAKE2B 54694dca2c99568eeef5499dc48315d320c0dd07bcdb516bde64672897eca44f501ab098e015018728e58239c13e7e56d59ee1a0ba8a862bc80350216c26ff5c SHA512 18eb8df59ae41f5f982432f4b13e77b27494817fcba5c2e716e810265854ccaaf2790d0262c41ef72cef439b0b88ad68aff475bca6cd53a79d3555a2ff11d3e0 +AUX trickster.initd 467 BLAKE2B 0e9d67543d054db9b196b0be25bce8f92d3f76f63acaa747c8110b2119194da8d3d1d329b3f53266b102786559a1bf18f5001bb9f3618d73616a38a0ea26f917 SHA512 253729023241ab7de6d2703ccd6701942b303ec7e07461eaecc401623ab6e3c603c4dd449f8c255199c40bed431255dcda2942c2047e471ed382e0a95afbab65 +AUX trickster.service 361 BLAKE2B 25c7d6f167efcc8a435b38115d8aafb990807e020d25e86a227ffec25603bdea66907976f9832b94b5902dce6ab317b47a304fefca3f776fcc3c548a69a80db0 SHA512 0032d84483419da66c984b17d9e686953497c39dfb405f7c0719e57650acf538693c48dcdbb3a27906b380a073f550fd30f0fc89b78d57f1eb00aed9f63f5e9d +DIST trickster-0.1.7.linux-amd64.gz 6440487 BLAKE2B 70884e04852aadf1c0a723dfdb8c39ea081e7ee15a69062e43c80bf0a75e80791e93825ddb691cc1323bdc2ae8efbef57e66871e2ed33397b29dce8d1320b12f SHA512 f8099108ad0b11d3dddd6043ceaef3451131e30aeb1973231e86c0b3b4ff378dd0e559c56903c3f2b35a5e83f2a06e8c72e95a4c1408aedb8ea6ddfb3525b67c +EBUILD trickster-bin-0.1.7.ebuild 982 BLAKE2B 2b369ffb22aee8c947e864043c16b2b017f2d39376f4ef71a77ae25efce488770a2f9b271ee5c6e5911db00e57de5a64c64915a8f538fe12de4b0332318beeb1 SHA512 04e271ffaa4365c0eed45bde572c8d365f4ce4c61eb6737afb00c8eac0752a1d496edd6ac0eea31d7d14ad881e61ae5f62c8ad0709446d18fb5f01d8e9c11583 +MISC metadata.xml 248 BLAKE2B 5d9c3678c604aac0f24c5d5015e28f02b9ce83bb6a179755a44adeb3d69e4dd50be4acc30a6317649f5be23bcf13ac210bbe4712aa403e9c4cf2de351b39c941 SHA512 dc5b06a888be6367909895d5891a08189f4657bcee602e5ff0021be2ad3677e58ec7387ff244625be66a142138666e7eac790d2a7b1e298f0ad644725b5e57e0 diff --git a/www-apps/trickster-bin/files/trickster.conf b/www-apps/trickster-bin/files/trickster.conf new file mode 100644 index 000000000000..004a3e906423 --- /dev/null +++ b/www-apps/trickster-bin/files/trickster.conf @@ -0,0 +1,113 @@ +[main] +# instance_id allows you to run multiple trickster processes on the same host and log to separate files +# Useful for baremetal, not so much for elastic deployments, so only uncomment if you really need it +#instance_id = 1 + +# Configuration options for the Proxy Server +[proxy_server] +# listen_port defines the port on which Trickster's Proxy server listens. +# since this is a proxy for Prometheus, we use 9090 by default, just like Prometheus does +# listen_port = 9090 +# listen_address defines the ip on which Trickster's Proxy server listens. +# empty by default, listening on all interfaces +# listen_address = + +[cache] +# cache_type defines what kind of cache Trickster uses +# options are 'boltdb', 'filesystem', 'memory', and 'redis'. +# The default is 'memory'. +cache_type = 'memory' + +# record_ttl_secs defines the relative expiration of cached queries. default is 6 hours (21600 seconds) +# record_ttl_secs = 21600 + +# reap_sleep_ms defines how long the cache reaper waits between reap cycles. Default is 1000 (1s) +# reap_sleep_ms = 1000 + +# compression determines whether the cache should be compressed. default is true +# compression = true + + ### Configuration options when using a Redis Cache + # [cache.redis] + # protocol defines the protocol for connecting to redis ('unix' or 'tcp') 'tcp' is default + # protocol = 'tcp' + # endpoint defines the fqdn+port or path to a unix socket file for connecting to redis + # default is 'redis:6379' + # endpoint = 'redis:6379' + + ### Configuration options when using a Filesystem Cache + # [cache.filesystem] + # cache_path defines the directory location under which the Trickster cache will be maintained + # default is '/tmp/trickster' + # cache_path = '/tmp/trickster' + + # Configuration options when using a BoltDb Cache + #[cache.boltdb] + + # filename defines the file where the Trickster cache will be maintained + # default is 'trickster.db' + # filename = 'trickster.db' + + # bucket defines the name of the BotlDb bucket (similar to a namespace) under which our key value store lives + # default is 'trickster' + # bucket = 'trickster' + +# Configuration options for mapping Origin(s) +[origins] + ### The default origin + [origins.default] + + # origin_url defines the URL of the origin. Default is http://prometheus:9090 + origin_url = 'http://prometheus:9090' + + # timeout_secs defines how many seconds Trickster will wait before aborting and upstream http request. Default: 180s + # timeout_secs = 180 + + # api path defines the path of the Prometheus API (usually '/api/v1') + api_path = '/api/v1' + + # ignore_no_cache_header disables a client's ability to send a no-cache to refresh a cached query. Default is false + # ignore_no_cache_header = false + + # max_value_age_secs defines the maximum age of specific datapoints in seconds. Default is 86400 (24 hours) + max_value_age_secs = 86400 + + # fast_forward_disable, when set to true, will turn off the 'fast forward' feature for any requests proxied to this origin + # fast_forward_disable = false + + # For multi-origin support, origins are named, and the name is the second word of the configuration section name. + # In this example, an origin is named "foo". Clients can indicate this origin in their path (http://trickster.example.com:9090/foo/query_range?.....) + # there are other ways for clients to indicate which origin to use in a multi-origin setup. See the documentation for more information + + # [origins.foo] + # origin_url = 'http://prometheus-foo:9090' + # api_path = '/api/v1' + # default_step = 300 + # ignore_no_cache_header = false + # max_value_age_secs = 86400 + # timeout_secs = 180 + +# Configuration Options for Metrics Instrumentation +[metrics] +# listen_port defines the port that Trickster's metrics server listens on at /metrics +listen_port = 8082 +# listen_address defines the ip that Trickster's metrics server listens on at /metrics +# empty by default, listening on all interfaces +# listen_address = + +# Configruation Options for Profiler +[profiler] +# enabled indicates whether to start the profiler server when Trickster starts up. Default: false +# enabled = false +# listen_port defines the port that Trickster's profiler server listens on at /debug/pprof. Default: 6060 +# listen_port = 6060 + +# Configuration Options for Logging Instrumentation +[logging] +# log_level defines the verbosity of the logger. Possible values are 'debug', 'info', 'warn', 'error' +# default is info +log_level = 'info' + +# log_file defines the file location to store logs. These will be auto-rolled and maintained for you. +# not specifying a log_file (this is the default behavior) will print logs to STDOUT +# log_file = '/some/path/to/trickster.log' diff --git a/www-apps/trickster-bin/files/trickster.initd b/www-apps/trickster-bin/files/trickster.initd new file mode 100755 index 000000000000..e443653fcbc2 --- /dev/null +++ b/www-apps/trickster-bin/files/trickster.initd @@ -0,0 +1,20 @@ +#!/sbin/openrc-run +command=/usr/bin/trickster +command_background=yes +command_group=trickster +command_user=trickster +description="Dashboard Accelerator for Prometheus" +error_log=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log +output_log=/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log +extra_started_commands=reload +pidfile=/var/run/trickster.pid + +depend() { +after net +} + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${PIDFILE}" + EEND $? +} diff --git a/www-apps/trickster-bin/files/trickster.service b/www-apps/trickster-bin/files/trickster.service new file mode 100644 index 000000000000..02363a906786 --- /dev/null +++ b/www-apps/trickster-bin/files/trickster.service @@ -0,0 +1,17 @@ +# -*- mode: conf -*- + +[Unit] +Description=Dashboard Accelerator for Prometheus +Documentation=https://github.com/Comcast/trickster +After=network.target + +[Service] +EnvironmentFile=-/etc/default/trickster +User=trickster +ExecStart=/usr/bin/trickster \ + $TRICKSTER_OPTS +ExecReload=/bin/kill -HUP $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/www-apps/trickster-bin/metadata.xml b/www-apps/trickster-bin/metadata.xml new file mode 100644 index 000000000000..c36c37139fad --- /dev/null +++ b/www-apps/trickster-bin/metadata.xml @@ -0,0 +1,8 @@ + + + + + williamh@gentoo.org + William Hubbs + + diff --git a/www-apps/trickster-bin/trickster-bin-0.1.7.ebuild b/www-apps/trickster-bin/trickster-bin-0.1.7.ebuild new file mode 100644 index 000000000000..44a02e42fe8e --- /dev/null +++ b/www-apps/trickster-bin/trickster-bin-0.1.7.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +MY_PN=${PN%-bin} +MY_P=${MY_PN}-${PV} + +inherit user systemd + +DESCRIPTION="Dashboard Accelerator for Prometheus" +HOMEPAGE="https://github.com/Comcast/trickster" +SRC_URI="https://github.com/Comcast/trickster/releases/download/v${PV}/${MY_P}.linux-amd64.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +QA_PREBUILT="usr/bin/*" + +S="${WORKDIR}" + +pkg_setup() { + enewgroup ${MY_PN} + enewuser ${MY_PN} -1 -1 -1 ${MY_PN} +} + +src_install() { +dobin ${MY_P}.linux-amd64 +dosym ${MY_P}.linux-amd64 /usr/bin/${MY_PN} +insinto /etc/trickster +doins "${FILESDIR}"/trickster.conf +newinitd "${FILESDIR}"/${MY_PN}.initd ${MY_PN} +systemd_dounit "${FILESDIR}"/trickster.service +keepdir /var/log/${MY_PN} +fowners ${MY_PN}:${MY_PN} /var/log/${MY_PN} +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "Please edit ${EROOT}/etc/trickster/trickster.conf for your setup." + fi +} -- cgit v1.2.3