Commit b6d8fd50 authored by Ophélie Gagnard's avatar Ophélie Gagnard

Clean and simplify the fluent-bit SR.

parent 0e5fcd42
......@@ -6,6 +6,9 @@ extends =
../cmake/buildout.cfg
../flex/buildout.cfg
parts =
fluent-bit
[fluent-bit]
recipe = slapos.recipe.cmmi
shared = true
......
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[template]
filename = instance.cfg
md5sum = 63233a53d9d3cce66d9446277e2251fd
[template-fluent_bit]
filename = instance-fluent_bit.cfg
md5sum = 0d252aa2ebcdb1ec6ce65f8ffc9a586b
[buildout]
parts =
service-fluent_bit
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[directory]
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
var = $${buildout:directory}/var
script = $${:etc}/run/
service = $${:etc}/service
promise = $${:etc}/promise/
log = $${:var}/log
[service-fluent_bit]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:service}/fluent_bit-service
command-line = ${fluent-bit:location}/bin/fluent-bit
-v
[buildout]
parts =
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = fluent-bit:template
RootSoftwareInstance = $${:default}
[fluent-bit]
template = ${template-fluent_bit:output}
[slap-configuration]
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}
[buildout]
extends =
buildout.hash.cfg
../../component/fluent-bit/buildout.cfg
../../stack/slapos.cfg
../../component/defaults.cfg
../../component/gcc/buildout.cfg
../../component/fmtlib/buildout.cfg
../../component/openssl/buildout.cfg
../../component/golang/buildout.cfg
parts =
template
slapos-cookbook
fmtlib
openssl
golang1.17
metadata-collect-agent
fluent-bit
[python]
part = python3
[template-base]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
[template]
< = template-base
output = ${buildout:directory}/template.cfg
[template-fluent_bit]
< = template-base
output = ${buildout:directory}/template-fluent_bit.cfg
[metadata-collect-agent]
recipe = slapos.recipe.cmmi
path = ${mca-gitclone:location}
configure-command = :
make-targets =
no-dracut
install-no-dracut
environment =
# TODO: extend the path name or find the name of the includes directory
# (the next line works as it is at least for python3.7)
# PYTHON_PATH=${python3:location}
PREFIX=@@LOCATION@@
# PATH=${fmtlib:location}:%(PATH)s
# CPATH=${fmtlib:location}/include:${openssl:location}/include
OPENSSL_PATH=${openssl:location}
FMTLIB_PATH=${fmtlib:location}
PATH=${golang1.17:location}/bin:%(PATH)s
[mca-gitclone]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/metadata-collect-agent.git
branch = minimal-installation
revision = 21b1082681600b3981f9c9ccd7a6f625b59f1821
Tests for fluent-bit Software Release
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from setuptools import setup, find_packages
version = '0.0.1.dev0'
name = 'slapos.test.fluent-bit'
with open("README.md") as f:
long_description = f.read()
setup(name=name,
version=version,
description="Test for SlapOS' fluent-bit",
long_description=long_description,
long_description_content_type='text/markdown',
maintainer="Nexedi",
maintainer_email="info@nexedi.com",
url="https://lab.nexedi.com/nexedi/slapos",
packages=find_packages(),
install_requires=[
'slapos.core',
'slapos.libnetworkcache',
'erp5.util',
'supervisor',
],
zip_safe=True,
test_suite='test',
)
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class FluentBitTestCase(SlapOSInstanceTestCase):
__partition_reference__ = 'fluent-bit'
def test_process(self):
expected_process_name_list = [
'fluentd-service-on-watch',
]
with self.slap.instance_supervisor_rpc as supervisor:
process_names = [process['name']
for process in supervisor.getAllProcessInfo()]
for expected_process_name in expected_process_name_list:
self.assertIn(expected_process_name, process_names)
\ No newline at end of file
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