mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* feat(ecs): route awsfirelens logs through a generated Fluent Bit router Start the router first, point awsfirelens containers at the generated unix socket, and store firelensConfiguration as registered. * feat(ecs): carry FireLens config through CloudFormation and aim outputs at Floci AWS::ECS::TaskDefinition provisioning now keeps each container LogConfiguration and FirelensConfiguration, so a stack that registers a FireLens router reaches the same launch path as RegisterTaskDefinition. The generated router points each awsfirelens output at Floci container-reachable base URL through Endpoint, and the app container awsfirelens log config uses fluentd-async, which Docker 28 accepts, instead of the removed fluentd-async-connect. Only s3, cloudwatch and firehose receive that endpoint: they are the AWS-written Go plugins and parse the value as a URL. The upstream C plugins (cloudwatch_logs, kinesis_firehose, kinesis_streams) hand it to getaddrinfo as a bare host name and always dial TLS, with no output-level switch for either, so a URL is a guaranteed DNS failure on Fluent Bit 1.9 and 5.0.9 alike, and a bare host plus port only reaches Floci plain HTTP port before certificate verification fails. Those outputs keep whatever the task definition gave them. * feat(ecs): support fluentd FireLens routers and s3-hosted FireLens config A fluentd FireLens router is now acted on at launch instead of being stored and ignored. Floci generates the config the ECS agent generates for that type: unix and forward sources, a grep filter per include-pattern and exclude-pattern, a record_transformer filter for the ECS metadata, the include of an external config, and one match block per awsfirelens container keyed on its @type. Fluentd takes its output plugin name from the log option @type rather than Name, its tags end in ** rather than *, and it gets neither the healthcheck sections nor Mem_Buf_Limit, both of which the agent emits for Fluent Bit only. The router image is handed /fluentd/etc/fluent.conf, so the config archive contents and its destination directory are now chosen per router type. config-file-type=s3 now reads the object from Floci's own S3 instead of ignoring the option, and writes it to the fixed external.conf path next to the generated config, /fluent-bit/etc/external.conf or /fluentd/etc/external.conf, which is where the agent mounts what it downloads. The object is read before any container is created, so a missing bucket or key stops the task with the agent's own wording as the stopped reason, Unable to download firelens s3 config file: unable to download s3 config <key> from bucket <bucket>: <detail>, rather than leaving a router running behind a task that already failed. RegisterTaskDefinition enforces the same split ECS does. A Fargate-compatible task definition cannot take its config from S3, and is rejected with Fargate launch type does not support FirelensConfiguration config file from 's3'; a config-file-value that does not name an S3 object is rejected as Invalid arn syntax. An EC2-compatible task definition keeps s3, and a Fargate task can still source its config from S3 the way AWS documents, through the aws-for-fluent-bit init process and its aws_fluent_bit_init_s3_* environment variables, which ECS never inspects and Floci passes through. Floci serves no ECS task metadata endpoint, so that init path fetches nothing locally yet, which docs/services/ecs.md now states. * fix(ecs): rejoin awsvpc tasks to the security-group namespace The FireLens launch loop stopped calling withNetworkMode(container:<helper>) and dropped the workload label, so prepareNetwork's ENI/nftables had nothing to isolate. Cover the join with a firewallManager-wired unit test. * test(ecs): assert FireLens router and app both join the SG namespace * test(ecs): verify FireLens router and app lifecycle in SG namespace test * refactor(ecs): reuse extractTaskId for FireLens cluster name * docs(ecs): note the launchType/compatibilities gap next to FireLens S3 * docs(ecs): scope the FireLens TCP-listen rationale to non-shared namespaces * fix(ecs): reject a FireLens type that is missing or not fluentd/fluentbit AWS requires firelensConfiguration.type and accepts only fluentd or fluentbit. parseFirelensConfiguration returned null for a missing type, registering the container as if FireLens were absent, and persisted any other string, so an unknown type only became ineffective later when findFirelensRouter recognized neither value. Both are now rejected at the RegisterTaskDefinition JSON boundary with the smithy validation wording, and are covered in EcsJsonHandlerRuntimePlatformLogConfigurationTest.