Commit f147ba10 authored by Jérome Perrin's avatar Jérome Perrin

grafana WIP modules / systemd

build only when setting CGO_ENABLED=0 environment when running
slapos node software
parent 78fac8f7
...@@ -7,6 +7,11 @@ extends = ...@@ -7,6 +7,11 @@ extends =
../../component/openssl/buildout.cfg ../../component/openssl/buildout.cfg
../../component/curl/buildout.cfg ../../component/curl/buildout.cfg
../../component/dash/buildout.cfg ../../component/dash/buildout.cfg
../../component/intltool/buildout.cfg
../../component/libtool/buildout.cfg
../../component/gperf/buildout.cfg
buildout.hash.cfg buildout.hash.cfg
gowork.cfg gowork.cfg
...@@ -31,81 +36,57 @@ part = python3 ...@@ -31,81 +36,57 @@ part = python3
[yarn] [yarn]
<= yarn-1.22.10 <= yarn-1.22.10
# XXX this is an old version, before systemd switched
# their build system to meson
# ../intltool/buildout.cfg
[systemd]
recipe = slapos.recipe.cmmi
url = https://github.com/systemd/systemd/archive/v230.tar.gz
md5sum = f2f10a6f100c38582b4f02d60210227d
pre-configure =
./autogen.sh
environment =
PATH=${m4:location}/bin:${autoconf:location}/bin:${automake:location}/bin:${pkgconfig:location}/bin:${intltool:location}/bin:${libtool:location}/bin:${gettext:location}/bin:${perl-XML-Parser:location}/bin:${gperf:location}/bin:%(PATH)s
ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${gettext:location}/share/aclocal:${libtool:location}/share/aclocal
[gowork] [gowork]
# All the softwares installed in the go workspace have "non standard" installation
# methods, so we install them in specific parts with custom commands.
# They will be installed because they are dependencies of ${gowork.goinstall}
install = install =
${go_github.com_grafana_grafana:location}:./.
${go_github.com_grafana_loki:location}:./cmd/promtail
${go_github.com_grafana_loki:location}:./cmd/loki
${go_github.com_influxdata_telegraf:location}:./cmd/telegraf
github.com/influxdata/influxdb/...@v1.8.4
# XXX isn't there a simpler way to install telegraf ?
# installing github.com/influxdata/telegraf/./cmd/telegraf@v1.17.3
#-0-gbc8ec4384e
# github.com/influxdata/telegraf/./cmd/telegraf@v1.17.3
# 0-g24a552b90b
# XXX promtail needs systemd, to read logs from systemd (which we don't
# care about). Setting CGO_ENABLED disable the systemd dependency.
#cpkgpath = ${systemd:location}/lib/pkgconfig
telegraf-bin = ${:bin}/telegraf telegraf-bin = ${:bin}/telegraf
influx-bin = ${:bin}/influx influx-bin = ${:bin}/influx
influxd-bin = ${:bin}/influxd influxd-bin = ${:bin}/influxd
grafana-bin = ${:bin}/grafana-server grafana-bin = ${:bin}/grafana-server
grafana-homepath = ${go_github.com_grafana_grafana:location} grafana-homepath = ${grafana-yarn:homepath}
loki-bin = ${:bin}/loki loki-bin = ${:bin}/loki
promtail-bin = ${:bin}/promtail promtail-bin = ${:bin}/promtail
# use recent go # use recent go
golang = ${golang1.16:location} golang = ${golang1.16:location}
[gowork.goinstall] [grafana-yarn]
command = : recipe = plone.recipe.command
depends = command = bash -c "
${influxdb-install:recipe} cd ${:homepath} &&
${telegraf-install:recipe} ${yarn:location}/bin/yarn install --pure-lockfile && \
${grafana-install:recipe} ${yarn:location}/bin/yarn run build && \
${loki-install:recipe} ${yarn:location}/bin/yarn run plugins:build-bundled"
${promtail-install:recipe} homepath = ${go_github.com_grafana_grafana:location}
[influxdb-install]
<= gowork.goinstall
command = bash -c ". ${gowork:env.sh} && \
go install -v github.com/golang/dep/cmd/dep && \
cd ${gowork:directory}/src/github.com/influxdata/influxdb && \
go install ./..."
update-command =
[telegraf-install]
<= gowork.goinstall
command = bash -c ". ${gowork:env.sh} && \
go install -v github.com/golang/dep/cmd/dep && \
cd ${gowork:directory}/src/github.com/influxdata/telegraf && \
${make:location}/bin/make &&
cp telegraf ${gowork:bin}"
update-command =
[grafana-install]
<= gowork.goinstall
# go run build.go needs our nodejs in $PATH
command = bash -c "export PATH=${nodejs:location}/bin/:$PATH && \
. ${gowork:env.sh} && \
cd ${gowork:directory}/src/github.com/grafana/grafana && \
go run build.go setup && \
go run build.go build && \
${yarn:location}/bin/yarn install --pure-lockfile && \
${yarn:location}/bin/yarn run build && \
${yarn:location}/bin/yarn run plugins:build-bundled"
update-command =
[loki-install]
<= gowork.goinstall
# loki also uses nodejs
command = bash -c "export PATH=${nodejs:location}/bin/:$PATH && \
. ${gowork:env.sh} && \
go install -v github.com/golang/dep/cmd/dep && \
cd ${gowork:directory}/src/github.com/grafana/loki && \
go install ./cmd/loki"
update-command =
[promtail-install]
<= gowork.goinstall
# CGO_ENABLED is to disable systemd support (did not compile in my case)
command = bash -c "export CGO_ENABLED=0 && \
. ${gowork:env.sh} && \
go install -v github.com/golang/dep/cmd/dep && \
cd ${gowork:directory}/src/github.com/grafana/loki && \
go install ./cmd/promtail"
update-command =
[download-file-base] [download-file-base]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment