Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
e342805b
Commit
e342805b
authored
Sep 19, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grafana and junk mariadb
parent
f1a11290
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
408 additions
and
84 deletions
+408
-84
software/grafana/buildout.hash.cfg
software/grafana/buildout.hash.cfg
+6
-2
software/grafana/instance.cfg.in
software/grafana/instance.cfg.in
+190
-20
software/grafana/loki-config-file.cfg.in
software/grafana/loki-config-file.cfg.in
+68
-37
software/grafana/loki-nginx-config-file.cfg.in
software/grafana/loki-nginx-config-file.cfg.in
+77
-0
software/grafana/software.cfg
software/grafana/software.cfg
+33
-9
software/grafana/test/test.py
software/grafana/test/test.py
+30
-14
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+1
-1
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+3
-1
No files found.
software/grafana/buildout.hash.cfg
View file @
e342805b
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
[instance-profile]
[instance-profile]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
51ec132522b7c425b248d7b63c0e9924
md5sum =
33e6510d84c83a46a2edf217b4f1beb5
[influxdb-config-file]
[influxdb-config-file]
filename = influxdb-config-file.cfg.in
filename = influxdb-config-file.cfg.in
...
@@ -39,4 +39,8 @@ md5sum = 5616679a9c5c2757540175ead3f5500a
...
@@ -39,4 +39,8 @@ md5sum = 5616679a9c5c2757540175ead3f5500a
[loki-config-file]
[loki-config-file]
filename = loki-config-file.cfg.in
filename = loki-config-file.cfg.in
md5sum = ad2baf4599a937d7352034a41fa24814
md5sum = 19a7f5cb904b3287b0bc7cb3e8a27429
[loki-nginx-config-file]
filename = loki-nginx-config-file.cfg.in
md5sum = b08ce1e4abb34eb79e26133459c27c3a
software/grafana/instance.cfg.in
View file @
e342805b
...
@@ -45,8 +45,13 @@ grafana-dashboards-dir = ${:grafana-dir}/dashboards
...
@@ -45,8 +45,13 @@ grafana-dashboards-dir = ${:grafana-dir}/dashboards
telegraf-dir = ${:srv}/telegraf
telegraf-dir = ${:srv}/telegraf
telegraf-extra-config-dir = ${:telegraf-dir}/extra-config
telegraf-extra-config-dir = ${:telegraf-dir}/extra-config
loki-dir = ${:srv}/loki
loki-dir = ${:srv}/loki
loki-storage-boltdb-dir = ${:loki-dir}/index/
loki-boltdb-shipper-active-index-directory = ${:loki-dir}/index
loki-storage-filesystem-dir = ${:loki-dir}/chunks/
loki-boltdb-shipper-cache-location = ${:loki-dir}/index-cache
loki-compactor-working-directory = ${:loki-dir}/compactor
loki-storage-filesystem-directory = ${:loki-dir}/chunks
loki-nginx-dir = ${:srv}/loki-nginx
loki-nginx-logs-dir = ${:loki-nginx-dir}/logs
promtail-dir = ${:srv}/promtail
promtail-dir = ${:srv}/promtail
# macros
# macros
...
@@ -165,8 +170,10 @@ wrapper-path = ${directory:service}/grafana
...
@@ -165,8 +170,10 @@ wrapper-path = ${directory:service}/grafana
<= generate-certificate
<= generate-certificate
[grafana-password]
[grafana-password]
recipe = slapos.cookbook:generate.password
# TODO
#recipe = slapos.cookbook:generate.password
username = admin
username = admin
passwd = admin
[grafana-secret-key]
[grafana-secret-key]
recipe = slapos.cookbook:generate.password
recipe = slapos.cookbook:generate.password
...
@@ -422,17 +429,158 @@ install =
...
@@ -422,17 +429,158 @@ install =
[loki]
[loki]
recipe = slapos.cookbook:wrapper
boltdb-shipper-active-index-directory = ${directory:loki-boltdb-shipper-active-index-directory}
command-line =
boltdb-shipper-cache-location = ${directory:loki-boltdb-shipper-cache-location}
bash -c 'nice -19 chrt --idle 0 ionice -c3 {{ loki_bin }} -config.file=${loki-config-file:output}'
compactor-working-directory = ${directory:loki-compactor-working-directory}
wrapper-path = ${directory:service}/loki
storage-filesystem-directory = ${directory:loki-storage-filesystem-directory}
storage-boltdb-dir = ${directory:loki-storage-boltdb-dir}
storage-filesystem-dir = ${directory:loki-storage-filesystem-dir}
ip = ${instance-parameter:ipv4-random}
ip = ${instance-parameter:ipv4-random}
port = 3100
read-1-http-port = 3101
grpc-port = 9095
read-1-grpc-port = 9096
url = http://${:ip}:${:port}
read-1-memberlist-port = 7947
read-2-http-port = 3102
read-2-grpc-port = 9097
read-2-memberlist-port = 7948
write-http-port = 3103
write-grpc-port = 9098
write-memberlist-port = 7949
query-frontend-http-port = 3104
query-frontend-grpc-port = 9099
query-frontend-memberlist-port = 7950
querier-http-port = 3105
querier-grpc-port = 9100
querier-memberlist-port = 7951
index-gateway-http-port = 3106
index-gateway-grpc-port = 9101
index-gateway-memberlist-port = 7952
query-scheduler-http-port = 3107
query-scheduler-grpc-port = 9102
query-scheduler-memberlist-port = 7953
# compactor
nginx-port = 3100
url = http://${:ip}:${:nginx-port}
ipv6 = ${instance-parameter:ipv6-random}
[loki-service-macro]
recipe = slapos.cookbook:wrapper
command-line =
bash -c 'nice -19 chrt --idle 0 ionice -c3 {{ loki_bin }} \
-config.file=${loki-config-file:output} \
\
-boltdb.shipper.compactor.ring.instance-addr=${loki:ip} \
-boltdb.shipper.compactor.ring.instance-id=${:_buildout_section_name_} \
-common.embedded-cachering.instance-addr=${loki:ip} \
-common.embedded-cachering.instance-id=${:_buildout_section_name_} \
-distributor.ring.instance-addr=${loki:ip} \
-distributor.ring.instance-id=${:_buildout_section_name_} \
-frontend.instance-addr=${loki:ip} \
-frontend.instance-port=${loki:query-frontend-grpc-port} \
-index-gateway.ring.instance-addr=${loki:ip} \
-index-gateway.ring.instance-id=${:_buildout_section_name_} \
-memberlist.advertise-port=${:memberlist-port} \
-memberlist.bind-port=${:memberlist-port} \
-memberlist.nodename=${:_buildout_section_name_} \
-query-scheduler.ring.instance-addr=${loki:ip} \
-query-scheduler.ring.instance-id=${:_buildout_section_name_} \
-ruler.ring.instance-addr=${loki:ip} \
-ruler.ring.instance-id=${:_buildout_section_name_} \
-server.grpc-listen-port=${:grpc-port} \
-server.http-listen-port=${:http-port} \
${:extra-command-line}'
wrapper-path = ${directory:service}/${:_buildout_section_name_}
extra-command-line =
# level=error ts=2022-09-24T14:40:13.636615531Z caller=scheduler_processor.go:182 org_id=fake msg="error notifying frontend about finished query" err="rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4200411 vs. 4194304)" frontend=10.0.44.65:9099
[loki-listen-promise-macro]
<= check-url-available-promise
url = http://${loki:ip}:${:port}/ready
[loki-read-1-service]
<= loki-service-macro
extra-command-line = -target=read -querier.scheduler-address=${loki:ip}:${loki:read-2-grpc-port} -query-scheduler.ring.instance-port=${loki:read-1-grpc-port}
http-port = ${loki:read-1-http-port}
grpc-port = ${loki:read-1-grpc-port}
memberlist-port = ${loki:read-1-memberlist-port}
[loki-read-1-listen-promise]
<= loki-listen-promise-macro
port = ${loki-read-1-service:http-port}
[loki-read-2-service]
<= loki-service-macro
extra-command-line = -target=read -querier.scheduler-address=${loki:ip}:${loki:read-1-grpc-port} -query-scheduler.ring.instance-port=${loki:read-2-grpc-port}
http-port = ${loki:read-2-http-port}
grpc-port = ${loki:read-2-grpc-port}
memberlist-port = ${loki:read-2-memberlist-port}
[loki-read-2-listen-promise]
<= loki-listen-promise-macro
port = ${loki-read-2-service:http-port}
[loki-write-service]
<= loki-service-macro
extra-command-line = -target=write
http-port = ${loki:write-http-port}
grpc-port = ${loki:write-grpc-port}
memberlist-port = ${loki:write-memberlist-port}
[loki-write-listen-promise]
<= loki-listen-promise-macro
port = ${loki-write-service:http-port}
[loki-querier-service]
<= loki-service-macro
extra-command-line = -target=querier -querier.scheduler-address=${loki:ip}:${loki:query-scheduler-grpc-port} -query-scheduler.ring.instance-port=${loki:querier-grpc-port}
http-port = ${loki:querier-http-port}
grpc-port = ${loki:querier-grpc-port}
memberlist-port = ${loki:querier-memberlist-port}
[loki-querier-listen-promise]
<= loki-listen-promise-macro
port = ${loki-querier-service:http-port}
[loki-index-gateway-service]
<= loki-service-macro
extra-command-line = -target=index-gateway -boltdb.shipper.query-ready-num-days=30
# XXX -boltdb.shipper.query-ready-num-days=30 useful ?
http-port = ${loki:index-gateway-http-port}
grpc-port = ${loki:index-gateway-grpc-port}
memberlist-port = ${loki:index-gateway-memberlist-port}
[loki-index-gateway-listen-promise]
<= loki-listen-promise-macro
port = ${loki-index-gateway-service:http-port}
[loki-query-frontend-service]
<= loki-service-macro
extra-command-line = -target=query-frontend -frontend.scheduler-address=${loki:ip}:${loki:query-scheduler-grpc-port}
http-port = ${loki:query-frontend-http-port}
grpc-port = ${loki:query-frontend-grpc-port}
memberlist-port = ${loki:query-frontend-memberlist-port}
[loki-query-frontend-listen-promise]
<= loki-listen-promise-macro
port = ${loki-query-frontend-service:http-port}
[loki-query-scheduler-service]
<= loki-service-macro
extra-command-line = -target=query-scheduler
http-port = ${loki:query-scheduler-http-port}
grpc-port = ${loki:query-scheduler-grpc-port}
memberlist-port = ${loki:query-scheduler-memberlist-port}
[loki-query-scheduler-listen-promise]
<= loki-listen-promise-macro
port = ${loki-query-scheduler-service:http-port}
[loki-config-file]
[loki-config-file]
...
@@ -440,9 +588,21 @@ url = http://${:ip}:${:port}
...
@@ -440,9 +588,21 @@ url = http://${:ip}:${:port}
context =
context =
section loki loki
section loki loki
[loki-listen-promise]
[loki-nginx-service]
recipe = slapos.cookbook:wrapper
command-line =
{{ nginx_bin }} -p ${directory:loki-nginx-dir} -c ${loki-nginx-config-file:output}
wrapper-path = ${directory:service}/${:_buildout_section_name_}
url = http://${loki:ip}:${loki:nginx-port}
[loki-nginx-listen-promise]
<= check-url-available-promise
<= check-url-available-promise
url = ${loki:url}/ready
url = ${loki-nginx-service:url}
[loki-nginx-config-file]
<= config-file
context =
section loki loki
[promtail]
[promtail]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
...
@@ -483,6 +643,7 @@ install =
...
@@ -483,6 +643,7 @@ install =
"http_listen_port": int(self.buildout['promtail']['http-port']),
"http_listen_port": int(self.buildout['promtail']['http-port']),
"grpc_listen_address": self.buildout['promtail']['ip'],
"grpc_listen_address": self.buildout['promtail']['ip'],
"grpc_listen_port": int(self.buildout['promtail']['grpc-port']),
"grpc_listen_port": int(self.buildout['promtail']['grpc-port']),
"graceful_shutdown_timeout": 5,
"external_url": self.buildout['promtail']['url'],
"external_url": self.buildout['promtail']['url'],
},
},
"positions": {
"positions": {
...
@@ -490,7 +651,8 @@ install =
...
@@ -490,7 +651,8 @@ install =
},
},
"clients": [
"clients": [
{
{
"url": "{}/api/prom/push".format(self.buildout['loki']['url']),
"url": "{}/loki/api/v1/push".format(self.buildout['loki']['url']),
"batchwait": "5s"
}
}
],
],
"scrape_configs": []
"scrape_configs": []
...
@@ -514,6 +676,7 @@ install =
...
@@ -514,6 +676,7 @@ install =
"labels": dict(
"labels": dict(
partition.get('static-tags', {}),
partition.get('static-tags', {}),
job=job_name,
job=job_name,
partition=partition['name'],
app=application['name'],
app=application['name'],
__path__=path.format(directory=directory),
__path__=path.format(directory=directory),
)
)
...
@@ -552,7 +715,8 @@ install =
...
@@ -552,7 +715,8 @@ install =
{
{
"labels": {
"labels": {
"level": None,
"level": None,
"component": None
# XXX do we really want `component` ? it may cause lots of cardinality
# "component": None
}
}
}
}
]
]
...
@@ -787,8 +951,14 @@ instance-promises =
...
@@ -787,8 +951,14 @@ instance-promises =
${influxdb-password-promise:wrapper-path}
${influxdb-password-promise:wrapper-path}
${influxdb-database-ready-promise:wrapper-path}
${influxdb-database-ready-promise:wrapper-path}
${grafana-listen-promise:path}
${grafana-listen-promise:path}
${loki-listen-promise:path}
${loki-query-frontend-listen-promise:path}
${promtail-listen-promise:path}
${loki-query-scheduler-listen-promise:path}
# ${loki-index-gateway-listen-promise:path}
${loki-querier-listen-promise:path}
# ${loki-read-1-listen-promise:path}
# ${loki-read-2-listen-promise:path}
${loki-write-listen-promise:path}
${loki-nginx-listen-promise:path}
${promtail-listen-promise:path}
${promtail-listen-promise:path}
${apache-frontend-available-promise:path}
${apache-frontend-available-promise:path}
...
...
software/grafana/loki-config-file.cfg.in
View file @
e342805b
# insipired from
# https://github.com/grafana/loki/blob/1489c1731277c327e3661da182bfc6c90d4559f4/tools/dev/loki-boltdb-storage-s3/docker-compose.yml
# and othe configuration examples with microservices, because the single binary
# mode assumes running on 127.0.0.1, but in slapos we want to bind on partition's
# addresses
auth_enabled: false
auth_enabled: false
http_prefix:
server:
server:
http_listen_address: {{ loki['ip'] }}
http_listen_address: {{ loki['ip'] }}
http_listen_port: {{ loki['port'] }}
grpc_listen_address: {{ loki['ip'] }}
grpc_listen_address: {{ loki['ip'] }}
grpc_listen_port: {{ loki['grpc-port'] }}
grpc_server_max_recv_msg_size: 1.048576e+08
grpc_server_max_send_msg_size: 1.048576e+08
ingester:
# # TODO ?
lifecycler:
# wal:
address: {{ loki['ip'] }}
# enabled: true
ring:
# dir: /loki/wal
kvstore:
store: inmemory
common:
replication_factor: 1
compactor_address: http://{{ loki['ip'] }}:{{ loki['write-http-port'] }}
chunk_idle_period: 15m
schema_config:
schema_config:
configs:
configs:
- from: 20
18-04
-15
- from: 20
20-05
-15
store: boltdb
store: boltdb
-shipper
object_store: filesystem
object_store: filesystem
schema: v
9
schema: v
11
index:
index:
prefix: index_
prefix: index_
period:
168
h
period:
24
h
storage_config:
storage_config:
boltdb:
boltdb
_shipper
:
directory: {{ loki['storage-boltdb-dir
'] }}
active_index_directory: {{ loki['boltdb-shipper-active-index-directory
'] }}
cache_location: {{ loki['boltdb-shipper-cache-location'] }}
filesystem:
filesystem:
directory: {{ loki['storage-filesystem-dir'] }}
directory: {{ loki['storage-filesystem-dir
ectory
'] }}
limits_config:
limits_config:
reject_old_samples: false
enforce_metric_name: false
enforce_metric_name: false
reject_old_samples: true
ingestion_rate_mb: 1024
reject_old_samples_max_age: 168h
ingestion_burst_size_mb: 1024
chunk_store_config:
max_look_back_period: 0
ingester:
lifecycler:
table_manager:
address: {{ loki['ip'] }}
chunk_tables_provisioning:
ring:
inactive_read_throughput: 0
kvstore:
inactive_write_throughput: 0
store: memberlist
provisioned_read_throughput: 0
replication_factor: 1
provisioned_write_throughput: 0
index_tables_provisioning:
compactor:
inactive_read_throughput: 0
compaction_interval: 1m
inactive_write_throughput: 0
retention_enabled: true
provisioned_read_throughput: 0
working_directory: {{ loki['compactor-working-directory'] }}
provisioned_write_throughput: 0
retention_deletes_enabled: false
frontend:
retention_period: 0
log_queries_longer_than: 5s
compress_responses: true
max_outstanding_per_tenant: 2048
tail_proxy_url: http://{{ loki['ip'] }}:{{ loki['querier-http-port']}}
frontend_worker:
scheduler_address: {{ loki['ip'] }}:{{ loki['query-scheduler-grpc-port'] }}
#testERP5Type
memberlist:
bind_addr:
- {{ loki['ip'] }}
join_members:
# - {{ loki['ip'] }}:{{ loki['read-1-memberlist-port'] }}
- {{ loki['ip'] }}:{{ loki['querier-memberlist-port'] }}
# - {{ loki['ip'] }}:{{ loki['write-memberlist-port'] }}
query_scheduler:
max_outstanding_requests_per_tenant: 1024
querier:
query_ingesters_within: 2h
software/grafana/loki-nginx-config-file.cfg.in
0 → 100644
View file @
e342805b
daemon off;
events {
worker_connections 1024;
}
error_log /dev/stdout;
http {
default_type application/octet-stream;
access_log /dev/stdout;
sendfile on;
tcp_nopush on;
upstream read {
server {{ loki['ip'] }}:{{ loki['query-frontend-http-port'] }};
}
upstream write {
server {{ loki['ip'] }}:{{ loki['write-http-port'] }};
}
upstream cluster {
server {{ loki['ip'] }}:{{ loki['write-http-port'] }};
server {{ loki['ip'] }}:{{ loki['query-frontend-http-port'] }};
server {{ loki['ip'] }}:{{ loki['querier-http-port'] }};
}
upstream query-frontend {
server {{ loki['ip'] }}:{{ loki['query-frontend-http-port'] }};
}
server {
listen {{ loki['ip'] }}:{{ loki['nginx-port'] }};
# XXX while debugging
listen [{{ loki['ipv6'] }}]:{{ loki['nginx-port'] }};
location / {
return 200 'OK';
}
location = /ring {
proxy_pass http://cluster$request_uri;
}
location = /memberlist {
proxy_pass http://cluster$request_uri;
}
location = /config {
proxy_pass http://cluster$request_uri;
}
location = /metrics {
proxy_pass http://cluster$request_uri;
}
location = /ready {
proxy_pass http://cluster$request_uri;
}
location = /loki/api/v1/push {
proxy_pass http://write$request_uri;
}
location = /loki/api/v1/tail {
proxy_pass http://read$request_uri;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ /loki/api/.* {
proxy_pass http://query-frontend$request_uri;
}
}
}
software/grafana/software.cfg
View file @
e342805b
...
@@ -7,6 +7,7 @@ extends =
...
@@ -7,6 +7,7 @@ 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/nginx/buildout.cfg
buildout.hash.cfg
buildout.hash.cfg
parts =
parts =
...
@@ -19,21 +20,30 @@ parts =
...
@@ -19,21 +20,30 @@ parts =
grafana-provisioning-datasources-config-file
grafana-provisioning-datasources-config-file
grafana-provisioning-dashboards-config-file
grafana-provisioning-dashboards-config-file
loki-config-file
loki-config-file
loki-nginx-config-file
[nodejs]
[nodejs]
<= nodejs-14.16.0
<= nodejs-16.14.0
[gowork]
golang = ${golang1.19:location}
# XXX speed up development cycle by not rebuilding workspace on every software run
# XXX does not work ?
update-command =
[go_github.com_grafana_grafana]
[go_github.com_grafana_grafana]
<= go-git-package
<= go-git-package
go.importpath = github.com/grafana/grafana
go.importpath = github.com/grafana/grafana
repository = https://github.com/grafana/grafana
repository = https://github.com/grafana/grafana
revision = v
7.5.2-0-gca413c612f
revision = v
9.1.5-0-gdf015a9301
[go_github.com_grafana_loki]
[go_github.com_grafana_loki]
<= go-git-package
<= go-git-package
go.importpath = github.com/grafana/loki
go.importpath = github.com/grafana/loki
repository = https://github.com/grafana/loki
repository = https://github.com/grafana/loki
revision = v2.3.0-0-gf5fd02966
revision = v2.1.0-2075-gafd63c598
# tag helm-loki-3.1.0 which supports golang 1.19
[go_github.com_influxdata_influxdb]
[go_github.com_influxdata_influxdb]
<= go-git-package
<= go-git-package
...
@@ -45,7 +55,7 @@ revision = v1.8.4-0-gbc8ec4384e
...
@@ -45,7 +55,7 @@ revision = v1.8.4-0-gbc8ec4384e
<= go-git-package
<= go-git-package
go.importpath = github.com/influxdata/telegraf
go.importpath = github.com/influxdata/telegraf
repository = https://github.com/influxdata/telegraf
repository = https://github.com/influxdata/telegraf
revision = v1.2
0.2-0-gf721f53d
revision = v1.2
4.0-0-g3c4a6516e
[go_github.com_perrinjerome_slapos_telegraf_input]
[go_github.com_perrinjerome_slapos_telegraf_input]
<= go-git-package
<= go-git-package
...
@@ -53,6 +63,12 @@ go.importpath = github.com/perrinjerome/telegraf-input-slapos
...
@@ -53,6 +63,12 @@ go.importpath = github.com/perrinjerome/telegraf-input-slapos
repository = https://github.com/perrinjerome/telegraf-input-slapos
repository = https://github.com/perrinjerome/telegraf-input-slapos
revision = v0.0.1-0-gf8981f3
revision = v0.0.1-0-gf8981f3
# [go_github.com_jaegertracking_jaeger]
# <= go-git-package
# go.importpath = github.com/jaegertracking/jaeger
# repository = https://github.com/jaegertracking/jaeger
# revision = v1.20.0-623-gcac21f82
[gowork]
[gowork]
# Fails with current default golang1.18
# Fails with current default golang1.18
golang = ${golang1.17:location}
golang = ${golang1.17:location}
...
@@ -80,14 +96,18 @@ promtail-bin = ${:bin}/promtail
...
@@ -80,14 +96,18 @@ promtail-bin = ${:bin}/promtail
[grafana]
[grafana]
recipe = plone.recipe.command
recipe = plone.recipe.command
command = bash -c "
command = bash -ce "
cd ${:homepath} &&
cd ${:homepath} && \
. ${gowork:env.sh} &&
. ${gowork:env.sh} && \
go install github.com/google/wire/cmd/wire@v0.5.0 && \
wire gen -tags oss ./pkg/server ./pkg/cmd/grafana-cli/runner && \
# Unlike the loki, grafana _needs_ CGO_ENABLED, so we override here
# Unlike the loki, grafana _needs_ CGO_ENABLED, so we override here
export CGO_ENABLED=1 &&
export CGO_ENABLED=1 &&
\
go run build.go setup && \
go run build.go setup && \
go run build.go build && \
go run build.go build && \
${yarn:location}/bin/yarn install --pure-lockfile && \
export NODE_OPTIONS=--max_old_space_size=8192 && \
${yarn:location}/bin/yarn install --immutable && \
${yarn:location}/bin/yarn run themes:generate && \
${yarn:location}/bin/yarn run build && \
${yarn:location}/bin/yarn run build && \
${yarn:location}/bin/yarn run plugins:build-bundled && \
${yarn:location}/bin/yarn run plugins:build-bundled && \
# Cleanup yarn and Cypress caches
# Cleanup yarn and Cypress caches
...
@@ -119,6 +139,9 @@ url = ${:_profile_base_location_}/${:filename}
...
@@ -119,6 +139,9 @@ url = ${:_profile_base_location_}/${:filename}
[loki-config-file]
[loki-config-file]
<= download-file-base
<= download-file-base
[loki-nginx-config-file]
<= download-file-base
[instance-eggs]
[instance-eggs]
recipe = zc.recipe.egg
recipe = zc.recipe.egg
eggs =
eggs =
...
@@ -140,6 +163,7 @@ context =
...
@@ -140,6 +163,7 @@ context =
key grafana_bin gowork:grafana-bin
key grafana_bin gowork:grafana-bin
key grafana_homepath gowork:grafana-homepath
key grafana_homepath gowork:grafana-homepath
key loki_bin gowork:loki-bin
key loki_bin gowork:loki-bin
raw nginx_bin ${nginx:location}/sbin/nginx
key promtail_bin gowork:promtail-bin
key promtail_bin gowork:promtail-bin
key curl_bin :curl-bin
key curl_bin :curl-bin
key dash_bin :dash-bin
key dash_bin :dash-bin
...
...
software/grafana/test/test.py
View file @
e342805b
...
@@ -192,16 +192,32 @@ class TestLoki(GrafanaTestCase):
...
@@ -192,16 +192,32 @@ class TestLoki(GrafanaTestCase):
cls
.
_logfile
=
tempfile
.
NamedTemporaryFile
(
suffix
=
'log'
)
cls
.
_logfile
=
tempfile
.
NamedTemporaryFile
(
suffix
=
'log'
)
parameter_dict
=
{
parameter_dict
=
{
"applications"
:
[
"applications"
:
[
{
"name"
:
"System"
,
"instance-root"
:
"/"
,
"partitions"
:
[
{
# no slapos for system application
# XXX example
"name"
:
"syslog"
,
"reference"
:
"syslog"
,
"files"
:
[
"/srv/slapgrid/slappart15/grosgzip/bench.log"
,
]
},
]
},
{
{
"name"
:
"ERP5"
,
"name"
:
"ERP5"
,
"instance-root"
:
"/srv/slapgrid/slappart
4/srv/slapos/inst
/"
,
"instance-root"
:
"/srv/slapgrid/slappart
15/srv/runner/instance
/"
,
"urls"
:
[
"urls"
:
[
"https://softinst12345-erp5.host.vifib.net/"
,
# TODO
# "https://XXX.host.vifib.net/erp5/",
],
],
"partitions"
:
[
"partitions"
:
[
{
{
"name"
:
"jerome-dev-mariadb"
,
"name"
:
"jerome-dev-mariadb"
,
"reference"
:
"slappart
6
"
,
"reference"
:
"slappart
3
"
,
"type"
:
"erp5/mariadb"
,
"type"
:
"erp5/mariadb"
,
#"static-tags": {
#"static-tags": {
# "XXX": "needed?"
# "XXX": "needed?"
...
@@ -209,7 +225,7 @@ class TestLoki(GrafanaTestCase):
...
@@ -209,7 +225,7 @@ class TestLoki(GrafanaTestCase):
},
},
{
{
"name"
:
"jerome-dev-zodb"
,
"name"
:
"jerome-dev-zodb"
,
"reference"
:
"slappart
7
"
,
"reference"
:
"slappart
4
"
,
"type"
:
"erp5/zeo"
,
"type"
:
"erp5/zeo"
,
#"static-tags": {
#"static-tags": {
# "XXX": "needed?"
# "XXX": "needed?"
...
@@ -217,7 +233,7 @@ class TestLoki(GrafanaTestCase):
...
@@ -217,7 +233,7 @@ class TestLoki(GrafanaTestCase):
},
},
{
{
"name"
:
"jerome-dev-balancer"
,
"name"
:
"jerome-dev-balancer"
,
"reference"
:
"slappart
9
"
,
"reference"
:
"slappart
6
"
,
"type"
:
"erp5/balancer"
,
"type"
:
"erp5/balancer"
,
#"static-tags": {
#"static-tags": {
# "XXX": "needed?"
# "XXX": "needed?"
...
@@ -225,20 +241,20 @@ class TestLoki(GrafanaTestCase):
...
@@ -225,20 +241,20 @@ class TestLoki(GrafanaTestCase):
},
},
{
{
"name"
:
"jerome-dev-zope-front"
,
"name"
:
"jerome-dev-zope-front"
,
"reference"
:
"slappart
8
"
,
"reference"
:
"slappart
5
"
,
"type"
:
"erp5/zope-front"
,
"type"
:
"erp5/zope-front"
,
#"static-tags": {
#"static-tags": {
# "XXX": "needed?"
# "XXX": "needed?"
#}
#}
},
},
{
#
{
"name"
:
"jerome-dev-zope-front"
,
#
"name": "jerome-dev-zope-front",
"reference"
:
"slappart13"
,
#
"reference": "slappart13",
"type"
:
"erp5/zope-activity"
,
#
"type": "erp5/zope-activity",
#"static-tags": {
#
#
"static-tags": {
# "XXX": "needed?"
#
#
"XXX": "needed?"
#}
#
#
}
}
#
}
]
]
}
}
],
],
...
...
stack/erp5/buildout.hash.cfg
View file @
e342805b
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
[template-mariadb]
filename = instance-mariadb.cfg.in
filename = instance-mariadb.cfg.in
md5sum =
93b2277185e4949a3d17be79d3710d2d
md5sum =
257ea9d3c76ea563430c24f5724b8ac9
[template-kumofs]
[template-kumofs]
filename = instance-kumofs.cfg.in
filename = instance-kumofs.cfg.in
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
e342805b
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
{% for database_count in range(slapparameter_dict.get('test-database-amount', 1)) -%}
{% for database_count in range(slapparameter_dict.get('test-database-amount', 1)) -%}
{% do test_database_list.append({'name': 'erp5_test_' ~ database_count, 'user': 'testuser_' ~ database_count, 'password': 'testpassword' ~ database_count}) -%}
{% do test_database_list.append({'name': 'erp5_test_' ~ database_count, 'user': 'testuser_' ~ database_count, 'password': 'testpassword' ~ database_count}) -%}
{% endfor -%}
{% endfor -%}
{% set character_set_server = slapparameter_dict.get('character-set-server', 'utf8mb4') -%}
{% set catalog_backup = slapparameter_dict.get('catalog-backup', {}) -%}
{% set catalog_backup = slapparameter_dict.get('catalog-backup', {}) -%}
{% set backup_periodicity = slapparameter_dict.get('backup-periodicity', 'daily') -%}
{% set backup_periodicity = slapparameter_dict.get('backup-periodicity', 'daily') -%}
{% set full_backup_retention_days = catalog_backup.get('full-retention-days', 7) -%}
{% set full_backup_retention_days = catalog_backup.get('full-retention-days', 7) -%}
...
@@ -99,7 +100,8 @@ time = {{ dumps(backup_periodicity) }}
...
@@ -99,7 +100,8 @@ time = {{ dumps(backup_periodicity) }}
# can be fully restored.
# can be fully restored.
# master-data: use value "2" as we are not in a replication case
# master-data: use value "2" as we are not in a replication case
#}
#}
command = "${binary-wrap-mysqldump:wrapper-path}" --all-databases --flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > "${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
command = "${binary-wrap-mysqldump:wrapper-path}" --all-databases --default-character-set={{ character_set_server }} --flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > "${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
xcommand = "${binary-wrap-mysqldump:wrapper-path}" --all-databases--flush-privileges --single-transaction --max-allowed-packet=128M {% if incremental_backup_retention_days > -1 %}--flush-logs --master-data=2 {% endif %}| {{ parameter_dict['gzip-location'] }}/bin/gzip > "${directory:mariadb-backup-full}/$({{ parameter_dict['coreutils-location'] }}/bin/date "+%Y%m%d%H%M%S").sql.gz"
{# KEEP GLOB PATTERN IN SYNC with generated filenames above
{# KEEP GLOB PATTERN IN SYNC with generated filenames above
# YYYYmmddHHMMSS -#}
# YYYYmmddHHMMSS -#}
file-glob = ??????????????.sql.gz
file-glob = ??????????????.sql.gz
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment