Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joanne Hugé
slapos
Commits
b4df8a33
Commit
b4df8a33
authored
Oct 31, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Plain Diff
Fluent-bit: Getting SlapOS params and converting them to .cfg configuration file ...
See merge request
nexedi/slapos!1276
parents
1b8b0902
63d993aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
5 deletions
+63
-5
software/fluent-bit/README.md
software/fluent-bit/README.md
+27
-0
software/fluent-bit/buildout.hash.cfg
software/fluent-bit/buildout.hash.cfg
+1
-1
software/fluent-bit/instance.cfg.in
software/fluent-bit/instance.cfg.in
+35
-4
No files found.
software/fluent-bit/README.md
0 → 100644
View file @
b4df8a33
# Fluent-bit
## When instantiating Fluent-bit you can use the following example config:
```
release="https://lab.nexedi.com/nexedi/slapos/raw/master/software/fluent-bit/software.cfg"
supply(release, "COMP-****")
partition_parameter_kw = {
"service": {
"flush": 5,
"daemon": "off",
"log_level": "debug"
},
"input": {
"name": "mqtt",
"tag": "data",
"port": 1883
},
"output": {
"name": "forward",
"match": "*",
"host": "127.0.0.1",
"port": 24224
}
}
filter_kw = {"computer_guid": "COMP-****"}
request(software_release = release, partition_reference='****', partition_parameter_kw=partition_parameter_kw, filter_kw = filter_kw)
```
software/fluent-bit/buildout.hash.cfg
View file @
b4df8a33
[instance-profile]
filename = instance.cfg.in
md5sum =
6a32b81db4ea9f2f63b5a92e8a134d58
md5sum =
b2845159dd53f942f32c4d4348934ce2
software/fluent-bit/instance.cfg.in
View file @
b4df8a33
[buildout]
parts =
directory
fluent-bit-config-file
fluent-bit-service
eggs-directory = {{ buildout[
'eggs-directory'
] }}
develop-eggs-directory = {{ buildout[
'develop-eggs-directory'
] }}
eggs-directory = {{ buildout[
"eggs-directory"
] }}
develop-eggs-directory = {{ buildout[
"develop-eggs-directory"
] }}
offline = true
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
...
...
@@ -17,8 +27,29 @@ promise = ${:etc}/promise/
log = ${:var}/log
bin = ${:home}/bin
[fluent-bit-config-file]
recipe = slapos.recipe.build
location = ${directory:etc}/${:_buildout_section_name_}.cfg
ip = ${instance-parameter:ipv4-random}
install =
config = open(self.options["location"], "w")
ip = self.options["ip"]
input = ${instance-parameter:configuration.input}
output = ${instance-parameter:configuration.output}
config.write(f"[INPUT]\n")
for key in input:
config.write(f" {str(key).capitalize()} {input[key]}\n")
config.write(f" Listen {ip}\n")
config.write("\n")
config.write(f"[OUTPUT]\n")
for key in output:
config.write(f" {str(key).capitalize()} {output[key]}\n")
[fluent-bit-service]
recipe = slapos.cookbook:wrapper
command-line = {{ fluent_bit_location }}/bin/fluent-bit -
i cpu -o stdout
command-line = {{ fluent_bit_location }}/bin/fluent-bit -
c ${fluent-bit-config-file:location}
wrapper-path = ${directory:service}/fluentbit-service
output = $${:wrapper-path}
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