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
Paul Graydon
slapos
Commits
7a4a8001
Commit
7a4a8001
authored
Jul 15, 2024
by
Paul Graydon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/fluentd: Add wendelin-telecom-gateway software type
parent
78cb1683
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
177 additions
and
14 deletions
+177
-14
software/fluentd/buildout.hash.cfg
software/fluentd/buildout.hash.cfg
+6
-2
software/fluentd/instance-fluentd-wendelin-telecom-gateway.cfg
...are/fluentd/instance-fluentd-wendelin-telecom-gateway.cfg
+68
-0
software/fluentd/instance-fluentd.cfg
software/fluentd/instance-fluentd.cfg
+1
-0
software/fluentd/instance-wendelin-telecom-gateway-input-schema.json
...uentd/instance-wendelin-telecom-gateway-input-schema.json
+29
-0
software/fluentd/instance.cfg
software/fluentd/instance.cfg
+61
-11
software/fluentd/software.cfg
software/fluentd/software.cfg
+4
-0
software/fluentd/software.cfg.json
software/fluentd/software.cfg.json
+8
-1
No files found.
software/fluentd/buildout.hash.cfg
View file @
7a4a8001
...
...
@@ -14,8 +14,12 @@
# not need these here).
[instance-profile]
filename = instance.cfg
md5sum =
a88ac58fc22e804a176e4d43f917179e
md5sum =
0080d427bc3e21c34015dc18d1d22b71
[template-fluentd]
filename = instance-fluentd.cfg
md5sum = 35f9d95f6a75e28bfeafc3568ca16f05
md5sum = 1b6f5b4fb0ec9e961e3c0a1ba0075a38
[template-fluentd-wendelin-telecom-gateway]
filename = instance-fluentd-wendelin-telecom-gateway.cfg
md5sum = 1dbc57f07a7d697c296611f4b889bea3
software/fluentd/instance-fluentd-wendelin-telecom-gateway.cfg
0 → 100644
View file @
7a4a8001
[fluentd-cert]
recipe = slapos.recipe.build
fluentd-agent-conf = {{ fluentd_agent_conf }}
key-file = $${ca-directory:certs}/fluentd.key
cert-file = $${ca-directory:certs}/fluentd.crt
init =
import os
fluentd_agent_conf = options['fluentd-agent-conf']
tls_config_text = (
" <transport tls>\n"
" cert_path %s\n"
" private_key_path %s\n"
" private_key_passphrase\n"
" </transport>\n"
) % (options['cert-file'], options['key-file'])
tls_tag = "<transport tls>"
add_tls_section = True
insert_index = 5
with open(fluentd_agent_conf, "r+") as conf:
contents = conf.readlines()
if any([tls_tag in line for line in contents]):
add_tls_section = False
if add_tls_section:
contents.insert(insert_index, tls_config_text)
conf.seek(0)
conf.writelines(contents)
conf.truncate()
[service-fluentd]
recipe = slapos.cookbook:wrapper
wrapper-path = {{ directory['bin'] }}/fluentd-service
command-line = ${fluentd:location}/bin/fluentd -v -c {{ fluentd_agent_conf }}
environment =
GEM_PATH=${fluentd:location}/lib/ruby/gems/
[ca-fluentd]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = $${fluentd-cert:key-file}
cert-file = $${fluentd-cert:cert-file}
executable = $${service-fluentd:wrapper-path}
wrapper = {{ directory['service'] }}/fluentd-service
{% set part_list = [] -%}
{% for port in port_list -%}
{% set promise_section_title = 'fluentd-port-' ~ port ~ '-listening' -%}
{% do part_list.append(promise_section_title) -%}
[{{ promise_section_title }}]
<= monitor-promise-base
promise = check_socket_listening
name = {{ promise_section_title }}.py
config-host = $${slap-configuration:ipv6-random}
config-port = {{ port }}
{% endfor %}
[buildout]
extends = ${monitor-template:output}
parts =
certificate-authority-service
ca-fluentd
{%- for part in part_list %}
{{ part }}
{%- endfor %}
software/fluentd/instance-fluentd.cfg
View file @
7a4a8001
...
...
@@ -26,3 +26,4 @@ parts =
{%- endfor %}
extends = ${monitor-template:output}
software/fluentd/instance-wendelin-telecom-gateway-input-schema.json
0 → 100644
View file @
7a4a8001
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"type"
:
"object"
,
"description"
:
"Parameters to instantiate Fluentd"
,
"additionalProperties"
:
false
,
"properties"
:
{
"port"
:
{
"title"
:
"Port"
,
"description"
:
"Port on which to listen for incoming data"
,
"type"
:
"integer"
,
"default"
:
24224
},
"wendelin-frontend-url"
:
{
"title"
:
"Wendelin frontend URL"
,
"description"
:
"URL of the Wendelin Telecom instance to which the data is to be forwarded"
,
"type"
:
"string"
},
"username"
:
{
"title"
:
"Wendelin account username"
,
"description"
:
"The username of a valid account to authenticate with on the Wendelin instance"
,
"type"
:
"string"
},
"password"
:
{
"title"
:
"Wendelin account password"
,
"description"
:
"The password of the account to authenticate with on the Wendelin instance"
,
"type"
:
"string"
}
}
}
software/fluentd/instance.cfg
View file @
7a4a8001
...
...
@@ -9,14 +9,16 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-fluentd:output
wendelin-telecom-gateway = dynamic-template-fluentd-wendelin-telecom-gateway:output
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
bin = $${:home}/bin
etc = $${:home}/etc
var = $${:home}/var
service = $${:etc}/service
bin = $${:home}/bin
fluentd-buffer = $${:var}/fluentd-buffer
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
...
...
@@ -26,25 +28,73 @@ url = $${slap_connection:server_url}
key = $${slap_connection:key_file}
cert = $${slap_connection:cert_file}
[
dynamic-template-fluentd
]
[
jinja2-template-base
]
recipe = slapos.recipe.template:jinja2
extra-context =
context =
section directory directory
key fluentd_agent_conf fluentd-agent-conf:output
key port_list fluentd-conf:port-list
$${:extra-context}
[dynamic-template-fluentd]
<= jinja2-template-base
url = ${template-fluentd:output}
output =
$${buildout:directory}/
instance-fluentd.cfg
output = instance-fluentd.cfg
extensions = jinja2.ext.do
context =
key fluentd_agent_conf fluentd-agent-conf:output
key port_list fluentd-conf:port-list
section directory directory
extra-context =
[dynamic-template-fluentd-wendelin-telecom-gateway]
<= jinja2-template-base
url = ${template-fluentd-wendelin-telecom-gateway:output}
output = instance-fluentd-wendelin-telecom-gateway.cfg
extensions = jinja2.ext.do
extra-context =
[fluentd-conf]
recipe = slapos.recipe.build
slapparameter-dict = $${slap-configuration:configuration}
software-type = $${slap-configuration:slap-software-type}
buffer-file-dir = $${directory:fluentd-buffer}
init =
import re
options['text'] = options['slapparameter-dict'].get('conf-text') or ' '
options['port-list'] = re.findall(r'<source>.*port (\d+).*<\/source>', options['text'], re.DOTALL)
software_type = options['software-type'] or 'RootSoftwareInstance'
if software_type in ['RootSoftwareInstance', 'default']:
options['conf-text'] = options['slapparameter-dict'].get('conf-text') or ' '
elif software_type == 'wendelin-telecom-gateway':
port = options['slapparameter-dict'].get('port') or '24224'
wendelin_telecom_url = options['slapparameter-dict'].get('wendelin-frontend-url')
username = options['slapparameter-dict'].get('username')
password = options['slapparameter-dict'].get('password')
buffer_file_dir = options['buffer-file-dir']
options['conf-text'] = (
"<source>\n"
" @type forward\n"
" port %s\n"
" bind ::0\n"
" add_tag_prefix ors\n"
"</source>\n"
"<match ors.**>\n"
" @type wendelin\n"
" streamtool_uri %s/erp5/portal_ingestion_policies/ors_enb_log_ingestion\n"
" user %s\n"
" password %s\n"
" <buffer>\n"
" flush_mode interval\n"
" flush_interval 1m\n"
" @type file\n"
" path %s/\n"
" </buffer>\n"
"</match>"
) % (port, wendelin_telecom_url, username, password, buffer_file_dir)
options['port-list'] = re.findall(r'<source>.*port (\d+).*<\/source>', options['conf-text'], re.DOTALL)
[fluentd-agent-conf]
recipe
= slapos.recipe.template
inline = $${fluentd-conf:text}
recipe = slapos.recipe.template
inline = $${fluentd-conf:
conf-
text}
output = $${directory:etc}/fluentd-agent.conf
software/fluentd/software.cfg
View file @
7a4a8001
...
...
@@ -21,6 +21,10 @@ output = ${buildout:directory}/template.cfg
< = template-base
output = ${buildout:directory}/template-fluentd.cfg
[template-fluentd-wendelin-telecom-gateway]
< = template-base
output = ${buildout:directory}/template-fluentd-wendelin-telecom-gateway.cfg
[fluentd]
gems +=
fluent-plugin-wendelin==0.5
...
...
software/fluentd/software.cfg.json
View file @
7a4a8001
...
...
@@ -5,10 +5,17 @@
"software-type"
:
{
"default"
:
{
"title"
:
"Default"
,
"description"
:
"
Fluentd
"
,
"description"
:
"
Default Fluentd configuration
"
,
"request"
:
"instance-input-schema.json"
,
"response"
:
"instance-output-schema.json"
,
"index"
:
0
},
"wendelin-telecom-gateway"
:
{
"title"
:
"Wendelin Telecom Gateway"
,
"description"
:
"Gateway configuration for forwarding ORS eNB Xlog data to Wendelin Telecom"
,
"request"
:
"instance-wendelin-telecom-gateway-input-schema.json"
,
"response"
:
"instance-output-schema.json"
,
"index"
:
0
}
}
}
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