Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calyptia: switch to YAML for Fleet config #9698

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
8f95fb1
calyptia: switch to YAML for Fleet config
patrick-stephens Dec 9, 2024
46797a4
calyptia: switch to YAML for Fleet config
patrick-stephens Dec 9, 2024
d2c32a9
cprofiles: fix macOS error
patrick-stephens Dec 9, 2024
2e7f408
calyptia: ensure machine-id config filename stays consistent
patrick-stephens Dec 9, 2024
8e689ec
calyptia: ensure fleet config is yaml
patrick-stephens Dec 9, 2024
4ab02b6
calyptia: split up input plugin files
patrick-stephens Dec 11, 2024
93c4a64
calyptia: remove bool usage
patrick-stephens Dec 11, 2024
a6a9c9c
calyptia: add support for configurable format
patrick-stephens Dec 11, 2024
02d367d
test: add basic config format check
patrick-stephens Dec 11, 2024
3ea4a53
calyptia: add support for configurable format
patrick-stephens Dec 11, 2024
12165af
test: fix memory usage
patrick-stephens Dec 11, 2024
5ef6296
in_calyptia_fleet: fix up review comments
patrick-stephens Dec 16, 2024
5d51ec8
tests: runtime: in_calyptia_fleet: add placeholders
patrick-stephens Dec 16, 2024
0d6fea1
in_calyptia_fleet: refactor to expose functions
patrick-stephens Dec 16, 2024
5c80ce7
in_calyptia_fleet: fix Windows failure
patrick-stephens Dec 16, 2024
e302b5b
in_calyptia_fleet: fix possible uninit usage
patrick-stephens Dec 16, 2024
86bf6d4
tests: runtime: in_calyptia_fleet: update mock server
patrick-stephens Dec 16, 2024
bfacebb
tests: runtime: in_calyptia_fleet: remove useless mocking
patrick-stephens Dec 17, 2024
9e2234e
tests: runtime_shell: custom_calyptia: add checks for fleet management
patrick-stephens Dec 17, 2024
17ecbde
tests: runtime_shell: custom_calyptia: fix config
patrick-stephens Dec 17, 2024
fd097a6
workflows: pin packaging to ubuntu 22
patrick-stephens Dec 17, 2024
6c0b8d7
tests: runtime_shell: custom_calyptia: fix checks
patrick-stephens Dec 17, 2024
86295d4
tests: runtime_shell: custom_calyptia: fix checks
patrick-stephens Dec 17, 2024
3b99604
tests: runtime_shell: custom_calyptia: use dummy input
patrick-stephens Dec 18, 2024
17203f0
tests: runtime_shell: custom_calyptia: use random input
patrick-stephens Dec 18, 2024
7859f9d
utils: Detect machine_id corruption and fill out a dummy value
cosmo0920 Dec 4, 2024
5d0c591
build: Use signed char in RISC-V 64bit (#9524)
cosmo0920 Dec 11, 2024
cb4fda6
update fluentbit_users.png (#9710)
erikbledsoe Dec 11, 2024
4c2427d
docs: update deployment details
edsiper Dec 11, 2024
a67e305
in_forward: Recreate connection when resumed
cosmo0920 Nov 18, 2024
566911d
in_forward: Synchronize the status of pause/resume with mutex
cosmo0920 Nov 19, 2024
2e58b29
in_forward: Remove a needless add event for handling sockets
cosmo0920 Dec 9, 2024
b4a4ffb
in_forward: Synchronize is_paused state and deleting conns
cosmo0920 Dec 12, 2024
f827a56
utf8: enhance handling of multibyte sequences
edsiper Dec 4, 2024
697a167
build: add flb_utf8.c
edsiper Dec 4, 2024
642dadf
utils: use new utf8 decoder API
edsiper Dec 4, 2024
e3d1e9b
tests: internal: utils: adjusts expected utf8 encoded bytes
edsiper Dec 4, 2024
7d6d190
tests: internal: data: pack: generators: fix json encoding ascii utf8
edsiper Dec 5, 2024
e9b642d
utf8: remove lookup table
edsiper Dec 5, 2024
c590271
utils: add utf8 encoding for codepoints beyond BMP
edsiper Dec 5, 2024
291745d
sds: use new utf8 decoder for sds_cat_utf8
edsiper Dec 5, 2024
8173465
tests: internal: sds: adjust unit test for utf8
edsiper Dec 5, 2024
e1ea896
tests: internal: utils: add missing test
edsiper Dec 5, 2024
9a5d89d
sds: utf8: remove dead code
edsiper Dec 12, 2024
11693e0
out_opentelemetry: remove strict check on severityText value
edsiper Dec 14, 2024
cdef7e1
in_opentelemetry: logs: add support for metadata in JSON payload
edsiper Dec 14, 2024
d981737
in_opentelemetry: json logs: process spanID, traceID and observedTime…
edsiper Dec 14, 2024
4a992b3
out_lib: add new option 'data_mode'
edsiper Dec 16, 2024
9639f90
tests: internal: in_opentelemetry: extend tests for group metadata an…
edsiper Dec 16, 2024
4d84658
cfl_record_accessor: Plug resource leaks (CID 516097)
cosmo0920 Dec 16, 2024
5c91c18
plugin: Detect config format and use a proper loader
cosmo0920 Dec 17, 2024
40610f1
workflows: bump helm/kind-action from 1.10.0 to 1.11.0 (#9736)
dependabot[bot] Dec 17, 2024
6a29c90
lib: c-ares: upgrade to v1.34.4
edsiper Dec 18, 2024
740cfcf
lib: cprofiles: upgrade to v0.1.0
edsiper Dec 18, 2024
8f0a122
build: added include path for the headers cprofiles generates
leonardo-albertovich Dec 18, 2024
8418353
workflows: resolve ubuntu 24 packaging problems (#9751)
patrick-stephens Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/call-build-linux-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ jobs:
call-build-linux-packages:
name: ${{ matrix.distro }} package build and stage to S3
environment: ${{ inputs.environment }}
# Ensure for OSS Fluent Bit repo we enable usage of Actuated runners for ARM builds, for forks it should keep existing ubuntu-latest usage.
runs-on: ${{ (contains(matrix.distro, 'arm' ) && (github.repository == 'fluent/fluent-bit') && 'actuated-arm64-8cpu-16gb') || 'ubuntu-latest' }}
# Ensure for OSS Fluent Bit repo we enable usage of Actuated runners for ARM builds, for forks it should keep existing usage.
runs-on: ${{ (contains(matrix.distro, 'arm' ) && (github.repository == 'fluent/fluent-bit') && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }}
permissions:
contents: read
strategy:
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
name: Create repo metadata in S3
# Only upload for staging
if: inputs.environment == 'staging'
# Need to use 18.04 as 20.04 has no createrepo available
# Need to use 22.04 as 20.04 has no createrepo available
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
needs:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}
FLB_OPT: ${{ matrix.flb_option }}
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}

run-macos-unit-tests:
# We chain this after Linux one as there are costs and restrictions associated
Expand Down Expand Up @@ -111,6 +112,7 @@ jobs:
CC: gcc
CXX: g++
FLB_OPT: ${{ matrix.flb_option }}
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}

run-aarch64-unit-tests:
# Ensure for OSS Fluent Bit repo we enable usage of Actuated runners for ARM builds, for forks it should keep existing ubuntu-latest usage.
Expand Down Expand Up @@ -167,6 +169,7 @@ jobs:
env:
CC: ${{ matrix.config.compiler }}
CXX: ${{ matrix.config.compiler }}
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}

run-qemu-ubuntu-unit-tests:
# We chain this after Linux one as there are CPU time costs for QEMU emulation
Expand Down Expand Up @@ -218,7 +221,6 @@ jobs:
make -j $nparallel
ctest -j $nparallel --build-run-dir . --output-on-failure


# Required check looks at this so do not remove
run-all-unit-tests:
if: always()
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ init/fluent-bit.service
lib/chunkio/include/chunkio/cio_version.h
lib/monkey/monkey.service
lib/monkey/include/monkey/mk_core/mk_core_info.h
lib/cprofiles/include/cprofiles/cprof_info.h

packaging/.env
packaging/packages
Expand Down
4 changes: 3 additions & 1 deletion include/fluent-bit/calyptia/calyptia_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
#define CALYPTIA_ENDPOINT_TRACE "/v1/traces/%s"

#define CALYPTIA_ENDPOINT_FLEETS "/v1/fleets"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_INI "/v1/fleets/%s/config?format=ini"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_INI "/v1/fleets/%s/config?format=ini&config_format=ini"
#define CALYPTIA_ENDPOINT_FLEET_CONFIG_YAML "/v1/fleets/%s/config?format=yaml&config_format=yaml"
#define CALYPTIA_ENDPOINT_FLEET_FILES "/v1/fleets/%s/files"
#define CALYPTIA_ENDPOINT_FLEET_BY_NAME "/v1/search?project_id=%s&resource=fleet&term=%s&exact=true"

/* Storage */
#define CALYPTIA_SESSION_FILE "session.CALYPTIA"
Expand Down
2 changes: 0 additions & 2 deletions lib/cprofiles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ if(CPROF_SYSTEM_MACOS)

if (CPACK_GENERATOR MATCHES "productbuild")
set(CPACK_SET_DESTDIR "ON")
configure_file(cpack/macos/welcome.txt.cmakein ${CMAKE_CURRENT_SOURCE_DIR}/welcome.txt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR should not touch lib/cprofiles

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No but need to fix it to test macOS so merged that in for now

configure_file(LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt)
find_program(CONVERTER textutil)
if (NOT CONVERTER)
Expand All @@ -363,7 +362,6 @@ if(CPROF_SYSTEM_MACOS)
execute_process(COMMAND ${CONVERTER} -convert html "${CMAKE_CURRENT_SOURCE_DIR}/README.md" -output "${CMAKE_CURRENT_SOURCE_DIR}/README.html")
endif()
set(CPACK_PACKAGE_FILE_NAME "${CMETRICS_PKG}")
set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_CURRENT_SOURCE_DIR}/welcome.txt)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt)
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.html)
set(CPACK_PRODUCTBUILD_IDENTIFIER "com.calyptia.${CPACK_PACKAGE_NAME}")
Expand Down
8 changes: 7 additions & 1 deletion plugins/custom_calyptia/calyptia.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ int set_fleet_input_properties(struct calyptia *ctx, struct flb_input_instance *
flb_input_set_property(fleet, "host", ctx->cloud_host);
flb_input_set_property(fleet, "port", ctx->cloud_port);
flb_input_set_property(fleet, "config_dir", ctx->fleet_config_dir);
flb_input_set_property(fleet, "fleet_config_legacy_format", ctx->fleet_config_legacy_format == 1 ? "on" : "off");

/* Set TLS properties */
flb_input_set_property(fleet, "tls", ctx->cloud_tls == 1 ? "on" : "off");
Expand Down Expand Up @@ -617,7 +618,7 @@ static int cb_calyptia_init(struct flb_custom_instance *ins,
flb_free(ctx);
return -1;
}
ctx->machine_id_auto_configured = 1;
ctx->machine_id_auto_configured = FLB_TRUE;
}

/* input collector */
Expand Down Expand Up @@ -774,6 +775,11 @@ static struct flb_config_map config_map[] = {
0, FLB_TRUE, offsetof(struct calyptia, register_retry_on_flush),
"Retry agent registration on flush if failed on init."
},
{
FLB_CONFIG_MAP_BOOL, "fleet_config_legacy_format", "true",
0, FLB_TRUE, offsetof(struct calyptia, fleet_config_legacy_format),
"If set, use legacy (TOML) format for configuration files."
},
/* EOF */
{0}
};
Expand Down
5 changes: 2 additions & 3 deletions plugins/custom_calyptia/calyptia.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#ifndef FLB_CALYPTIA_H
#define FLB_CALYPTIA_H

#include <stdbool.h>

struct calyptia {
/* config map options */
flb_sds_t api_key;
Expand Down Expand Up @@ -55,7 +53,8 @@ struct calyptia {
flb_sds_t fleet_max_http_buffer_size;
flb_sds_t fleet_interval_sec;
flb_sds_t fleet_interval_nsec;
bool register_retry_on_flush; /* retry registration on flush if failed */
int register_retry_on_flush; /* retry registration on flush if failed */
int fleet_config_legacy_format; /* Fleet config format to use: INI (true) or YAML (false) */
};

int set_fleet_input_properties(struct calyptia *ctx, struct flb_input_instance *fleet);
Expand Down
Loading
Loading