Commit 9c969344 authored by Xiaowu Zhang's avatar Xiaowu Zhang

ors-amarisoft: integrate fluentbit

parent af5e0f69
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = 60945a3c51ad6704c1f02b2e43018bba
md5sum = 427fd27a547364830b879f5d3b66e0c2
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
......@@ -36,11 +36,11 @@ md5sum = e0b68a87238282568e0e04c792ec7288
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = a7448167f7433a50938bf6d3e6903065
md5sum = eea8191e5aa7153c15dd80c4fa17300a
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
md5sum = afa508e78851fe151fd25d8781aaa34a
md5sum = dfc58959986fb8ed67cb166c2b8fc004
[template-core-network]
_update_hash_filename_ = instance-core-network.jinja2.cfg
......
......@@ -128,6 +128,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -4,6 +4,7 @@ parts =
ltelogs
enb-config
enb-service
fluent-bit-service
xamari-xlog-service
amarisoft-stats-service
amarisoft-rf-info-service
......@@ -134,6 +135,37 @@ environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[fluent-bit-config-file]
recipe = slapos.recipe.build
location = ${directory:etc}/${:_buildout_section_name_}.cfg
slapparameter-dict = ${slap-configuration:configuration}
logfile = ${xamari-xlog-script:logfile}
install =
config = open(options["location"], "w")
fluent_bit_conf = (options['slapparameter-dict'].get('fluent_bit_conf') or {})
if 'input' in fluent_bit_conf and 'path' in fluent_bit_conf['input']:
if fluent_bit_conf['input']['path'] == '@LOGFILE':
fluent_bit_conf['input']['path'] = options['logfile']
service =fluent_bit_conf['service']
input = fluent_bit_conf['input']
output = fluent_bit_conf['output']
config.write(f"[SERVICE]\n")
for key in service:
config.write(f" {key} {service[key]}\n")
config.write(f"[INPUT]\n")
for key in input:
config.write(f" {key} {input[key]}\n")
config.write(f"[OUTPUT]\n")
for key in output:
config.write(f" {key} {output[key]}\n")
[fluent-bit-service]
recipe = slapos.cookbook:wrapper
command-line = {{ fluent_bit_location }}/bin/fluent-bit -e {{ fluentbit_plugin_wendelin_location }}/lib/libfluentbit_wendelin.so -c ${fluent-bit-config-file:location}
wrapper-path = ${directory:service}/fluentbit-service
output = $${:wrapper-path}
[xamari-xlog-script]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
......
......@@ -260,6 +260,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -4,6 +4,7 @@ parts =
ltelogs
gnb-config
enb-service
fluent-bit-service
xamari-xlog-service
amarisoft-stats-service
amarisoft-rf-info-service
......@@ -135,6 +136,37 @@ environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[fluent-bit-config-file]
recipe = slapos.recipe.build
location = ${directory:etc}/${:_buildout_section_name_}.cfg
slapparameter-dict = ${slap-configuration:configuration}
logfile = ${xamari-xlog-script:logfile}
install =
config = open(options["location"], "w")
fluent_bit_conf = (options['slapparameter-dict'].get('fluent_bit_conf') or {})
if 'input' in fluent_bit_conf and 'path' in fluent_bit_conf['input']:
if fluent_bit_conf['input']['path'] == '@LOGFILE':
fluent_bit_conf['input']['path'] = options['logfile']
service =fluent_bit_conf['service']
input = fluent_bit_conf['input']
output = fluent_bit_conf['output']
config.write(f"[SERVICE]\n")
for key in service:
config.write(f" {key} {service[key]}\n")
config.write(f"[INPUT]\n")
for key in input:
config.write(f" {key} {input[key]}\n")
config.write(f"[OUTPUT]\n")
for key in output:
config.write(f" {key} {output[key]}\n")
[fluent-bit-service]
recipe = slapos.cookbook:wrapper
command-line = {{ fluent_bit_location }}/bin/fluent-bit -e {{ fluentbit_plugin_wendelin_location }}/lib/libfluentbit_wendelin.so -c ${fluent-bit-config-file:location}
wrapper-path = ${directory:service}/fluentbit-service
output = $${:wrapper-path}
[xamari-xlog-script]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
......
......@@ -128,6 +128,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -260,6 +260,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -128,6 +128,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -260,6 +260,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -128,6 +128,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -260,6 +260,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -128,6 +128,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -260,6 +260,30 @@
"type": "boolean",
"default": true
},
"fluent_bit_conf": {
"title": "fluent-bit configuration",
"description": "fluent-it configuration",
"type": "object",
"properties": {
"service": {
"description": "The desired fluent-bit service, which defines in fluent-bit's configuration the service.",
"type": "object",
"default": {}
},
"input": {
"description": "The desired fluent-bit input, which defines in fluent-bit's configuration the inputs.",
"type": "object",
"default": {}
},
"output": {
"description": "The desired fluent-bit output, which defines in fluent-bit's configuration the outputs.",
"type": "object",
"default": {}
}
}
},
"max_rx_sample_db": {
"title": "Maximum RX sample value (dB)",
"description": "Maximum RX sample threshold above which RX saturated promise will fail",
......
......@@ -110,6 +110,9 @@ extra-context =
raw default_n_antenna_ul ${default-params:default-n-antenna-ul}
raw min_frequency ${default-params:min-frequency}
raw max_frequency ${default-params:max-frequency}
raw fluent_bit_location ${fluent-bit:location}
raw fluentbit_plugin_wendelin_location ${fluentbit-plugin-wendelin:location}
[dynamic-template-gnb]
< = jinja2-template-base
......@@ -138,6 +141,9 @@ extra-context =
raw min_frequency ${default-params:min-frequency}
raw max_frequency ${default-params:max-frequency}
raw python_path ${python3:location}
raw fluent_bit_location ${fluent-bit:location}
raw fluentbit_plugin_wendelin_location ${fluentbit-plugin-wendelin:location}
[dynamic-template-core-network]
< = jinja2-template-base
......
......@@ -12,7 +12,8 @@ extends =
../../component/numpy/buildout.cfg
../../component/pygolang/buildout.cfg
../../component/git/buildout.cfg
../../component/fluent-bit/buildout.cfg
../../component/fluentbit-plugin-wendelin/buildout.cfg
parts +=
template
......
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