Skip to content

Commit 9a80d21

Browse files
committed
rollback: rollback to 2.32.0
Signed-off-by: Matthew Fala <[email protected]>
1 parent e575760 commit 9a80d21

36 files changed

+207
-2784
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.32.0.20240122
1+
2.31.12.20231011

AWS_FOR_FLUENT_BIT_STABLE_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.32.0.20240304
1+
2.32.0.20240122

AWS_FOR_FLUENT_BIT_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.32.1
1+
2.32.0.20240304

CHANGELOG.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
# Changelog
22

3-
### 2.32.1
4-
This release includes:
5-
* Fluent Bit [1.9.10](https://github.com/fluent/fluent-bit/tree/v1.9.10)
6-
* Amazon CloudWatch Logs for Fluent Bit 1.9.4
7-
* Amazon Kinesis Streams for Fluent Bit 1.10.2
8-
* Amazon Kinesis Firehose for Fluent Bit 1.7.2
9-
10-
Compared to `2.32.0` this release adds:
11-
* Enhancement - Add `aws_fluent_bit_init_ignore_firelens_config` option to ECS init tag. As shown in the [example](https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/init-ignore-firelens) and [documentation](https://github.com/aws/aws-for-fluent-bit/tree/mainline/use_cases/init-process-for-fluent-bit#how-to-ignore-the-generated-firelens-configuration), this option tells init to ignore the built-in generated FireLens configuration which allows users to fully override it with their own configuration.
12-
* Enhancement - Upgrade to latest stable Go 1.20.1. Each future AWS for Fluent Bit release will be built with the latest stable Go release. Go is used to build the init process for ECS use cases and the [Go plugins](https://github.com/aws/aws-for-fluent-bit/blob/mainline/troubleshooting/debugging.md#aws-go-plugins-vs-aws-core-c-plugins).
13-
143
### 2.32.0.20240304 Linux re-build
154

165
*This release has the same Fluent Bit contents as 2.32.0, and is simply a linux-only re-build for recent patches in dependencies installed in the image. There are no windows images for this release.*
@@ -39,8 +28,8 @@ This release includes:
3928
* Amazon Kinesis Firehose for Fluent Bit 1.7.2
4029

4130
Compared to `2.31.12` this release adds:
42-
* Enhancement - Customers can send metrics to Amazon Managed Prometheus via added sigv4 authentication on `prometheus_remote_write`. Refer to [amazon-ecs-firelens-examples](https://github.com/aws-samples/amazon-ecs-firelens-examples/blob/mainline/examples/fluent-bit/amazon-managed-service-for-prometheus/README.md) for information on how to export metrics to AMP on ECS [aws-for-fluent-bit:256](https://github.com/aws/aws-for-fluent-bit/issues/256)
43-
* Enhancement - Support multiline parsers with the init tag. Multiline parsers can be specified same as a standard parser file [aws-for-fluent-bit:537](https://github.com/aws/aws-for-fluent-bit/issues/537)
31+
* Feature - Customers can send metrics to Amazon Managed Prometheus via added sigv4 authentication on `prometheus_remote_write`. Refer to [amazon-ecs-firelens-examples](https://github.com/aws-samples/amazon-ecs-firelens-examples/blob/mainline/examples/fluent-bit/amazon-managed-service-for-prometheus/README.md) for information on how to export metrics to AMP on ECS [aws-for-fluent-bit:256](https://github.com/aws/aws-for-fluent-bit/issues/256)
32+
* Feature - Support multiline parsers with the init tag. Multiline parsers can be specified same as a standard parser file [aws-for-fluent-bit:537](https://github.com/aws/aws-for-fluent-bit/issues/537)
4433
* Enhancement - Customers can route logs to CloudWatch Logs at higher throughputs by increasing number of output workers as `cloudwatch_logs` output plugin removed sequence tokens from API requests [aws-for-fluent-bit:526](https://github.com/aws/aws-for-fluent-bit/issues/526)
4534
* Fix - Fix multiline input behavior when multiple streams are parsed (stderr, stdout) together. Multiline logs are no longer terminated when streams are switched between [fluent-bit:7469](https://github.com/fluent/fluent-bit/pull/7469)
4635
* Fix - Fix networking edgecase causing data loss and OOM related issues via net timeout event injection resolution [fluent-bit:7728](https://github.com/fluent/fluent-bit/pull/7728/files)

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ The process for pushing out new builds with CVE patches in the base image or ins
5454

5555
For Windows, every month after the [B release date/"patch tuesday"](https://learn.microsoft.com/en-us/windows/deployment/update/release-cycle#monthly-security-update-release), we re-build and update all Windows images currently found in the [windows.versions](windows.versions) file in this repo with the newest base images from Microsoft. The Fluent Bit and go plugin binaries are copied into the newly released base windows image. Thus, the windows image tags are not immutable images; only the Fluent Bit and Go plugin binaries are immutable over time.
5656

57-
At any point in time, [windows.versions](windows.versions) file will contain at least 5 versions, including latest and latest stable. AWS for Fluent Bit Windows are guaranteed to be patched for 4 months after their release date. Therefore, the [windows.versions](windows.versions) file always contains all versions released in the last 4 months, and may contain more if the latest stable release is older than 4 months.
58-
5957
For Linux, each image tag is immutable. When there is a report of high or critical CVEs reported in the base amazon linux image or installed linux packages, we will work to push out a new image [per our patching policy](#compliance-and-patching). However, we will not increment the semantic version number to simply re-build to pull in new linux dependencies. Instead, we will add a 4th version number signifying the date the image was built.
6058

6159
For example, a series of releases in time might look like:
@@ -161,7 +159,7 @@ Prior to being designated as the latest stable, a version must pass the followin
161159

162160
* It has been out for at least 2 weeks or is a CVE patch with no Fluent Bit changes. Stable designation is based on the Fluent Bit code in the image. A version released for CVE patches can be made stable if the underlying if the underlying Fluent Bit code is already designated as stable.
163161
* No bugs have been reported in Fluent Bit which we expect will have high impact for AWS customers. This means bugs in the components that are most frequently used by AWS customers, such as the AWS outputs or the tail input.
164-
* The version has passed our long running stability tests for at least 2 weeks or is a CVE patch with no Fluent Bit changes that has passed our long running stability tests for at least 1 day. The version would have already passed our simple integration and load tests when it was first released as the latest image.
162+
* The version has passed our long running stability tests for at least 2 weeks. The version would have already passed our simple integration and load tests when it was first released as the latest image.
165163

166164
#### CVE scans and latest stable
167165

init/fluent_bit_init_process.go

+30-73
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"encoding/json"
55
"io"
6+
"io/ioutil"
67
"net/http"
78
"os"
89
"path/filepath"
@@ -18,20 +19,12 @@ import (
1819
"github.com/sirupsen/logrus"
1920
)
2021

21-
// env vars for user configuration
22-
// (?i) makes the match case insensitive
23-
const (
24-
initS3ConfigFilePattern = "(?i)aws_fluent_bit_init_s3"
25-
initLocalConfigFilePattern = "(?i)aws_fluent_bit_init_file"
26-
initIgnoreFireLensConfig = "(?i)aws_fluent_bit_init_ignore_firelens"
27-
)
28-
2922
// static paths
3023
const (
31-
s3FileDirectoryPath = "/init/fluent-bit-init-s3-files/"
32-
initConfigFilePath = "/init/fluent-bit-init.conf"
33-
firelensGeneratedConfigFilePath = "/fluent-bit/etc/fluent-bit.conf"
34-
invokeFilePath = "/init/invoke_fluent_bit.sh"
24+
s3FileDirectoryPath = "/init/fluent-bit-init-s3-files/"
25+
mainConfigFile = "/init/fluent-bit-init.conf"
26+
originalMainConfigFile = "/fluent-bit/etc/fluent-bit.conf"
27+
invokeFile = "/init/invoke_fluent_bit.sh"
3528
)
3629

3730
var (
@@ -84,7 +77,7 @@ func getECSTaskMetadata(httpClient HTTPClient) ECSTaskMetadata {
8477
logrus.Fatalf("[FluentBit Init Process] Failed to get ECS Metadata via HTTP Get: %s\n", err)
8578
}
8679

87-
response, err := io.ReadAll(res.Body)
80+
response, err := ioutil.ReadAll(res.Body)
8881
if err != nil {
8982
logrus.Fatalf("[FluentBit Init Process] Failed to read ECS Metadata from HTTP response: %s\n", err)
9083
}
@@ -107,7 +100,7 @@ func getECSTaskMetadata(httpClient HTTPClient) ECSTaskMetadata {
107100
metadata.ECS_TASK_DEFINITION = metadata.ECS_FAMILY + ":" + metadata.ECS_REVISION
108101

109102
// per ECS task metadata docs, Cluster can be an ARN or the name
110-
if strings.Contains(metadata.ECS_CLUSTER, "/") {
103+
if (strings.Contains(metadata.ECS_CLUSTER, "/")) {
111104
clusterARN, err := arn.Parse(metadata.ECS_CLUSTER)
112105
if err != nil {
113106
logrus.Fatalf("[FluentBit Init Process] Failed to parse ECS Cluster ARN: %s %s\n", metadata.ECS_CLUSTER, err)
@@ -164,9 +157,6 @@ func getAllConfigFiles() {
164157
// get all env vars in the container
165158
envs := os.Environ()
166159

167-
s3Regex := regexp.MustCompile(initS3ConfigFilePattern)
168-
fileRegex := regexp.MustCompile(initLocalConfigFilePattern)
169-
170160
// find all env vars match specified prefix
171161
for _, env := range envs {
172162
var envKey string
@@ -179,59 +169,27 @@ func getAllConfigFiles() {
179169
envKey = string(env_kv[0])
180170
envValue = string(env_kv[1])
181171

182-
matchedS3 := s3Regex.MatchString(envKey)
183-
matchedFile := fileRegex.MatchString(envKey)
172+
s3_regex, _ := regexp.Compile("aws_fluent_bit_init_[sS]3")
173+
file_regex, _ := regexp.Compile("aws_fluent_bit_init_[fF]ile")
174+
175+
matched_s3 := s3_regex.MatchString(envKey)
176+
matched_file := file_regex.MatchString(envKey)
184177

185178
// if this env var's value is an arn, download the config file first, then process it
186-
if matchedS3 {
179+
if matched_s3 {
187180
s3FilePath := getS3ConfigFile(envValue)
188181
s3FileName := strings.SplitN(s3FilePath, "/", -1)
189182
processConfigFile(s3FileDirectoryPath + s3FileName[len(s3FileName)-1])
190183
}
191-
// if this env var's value is a local config fil, process is directly
192-
if matchedFile {
184+
// if this env var's value is a path of our built-in config file, process is derectly
185+
if matched_file {
193186
processConfigFile(envValue)
194187
}
195188
}
196189
}
197190

198-
func processFireLensConfigFile() {
199-
includeFireLensConfig := true
200-
envs := os.Environ()
201-
202-
ignoreRegex := regexp.MustCompile(initIgnoreFireLensConfig)
203-
204-
// docs say to use aws_fluent_bit_init_ignore_firelens
205-
// this supports case insensitive prefix matching, in case someone
206-
// tries to capitalize FireLens, or uses aws_fluent_bit_init_ignore_firelens_config
207-
for _, env := range envs {
208-
var envKey string
209-
var envValue string
210-
env_kv := strings.SplitN(env, "=", 2)
211-
if len(env_kv) != 2 {
212-
logrus.Fatalf("[FluentBit Init Process] Unrecognizable environment variables: %s\n", env)
213-
}
214-
215-
envKey = string(env_kv[0])
216-
envValue = string(env_kv[1])
217-
218-
matchedIgnore := ignoreRegex.MatchString(envKey)
219-
220-
if matchedIgnore {
221-
if strings.EqualFold(envValue, "true") || strings.EqualFold(envValue, "on") {
222-
includeFireLensConfig = false
223-
}
224-
}
225-
}
226-
227-
if includeFireLensConfig {
228-
// add @INCLUDE in main config file to include original main config file
229-
writeInclude(firelensGeneratedConfigFilePath, initConfigFilePath)
230-
}
231-
}
232-
233191
func processConfigFile(path string) {
234-
contentBytes, err := os.ReadFile(path)
192+
contentBytes, err := ioutil.ReadFile(path)
235193
if err != nil {
236194
logrus.Errorln(err)
237195
logrus.Fatalf("[FluentBit Init Process] Cannot open file: %s\n", path)
@@ -244,7 +202,7 @@ func processConfigFile(path string) {
244202
updateCommand(path)
245203
} else {
246204
// this is not a parser config file. @INCLUDE
247-
writeInclude(path, initConfigFilePath)
205+
writeInclude(path, mainConfigFile)
248206
}
249207
}
250208

@@ -349,15 +307,15 @@ func downloadS3ConfigFile(s3Downloader S3Downloader, s3FilePath, bucketName, s3F
349307
}
350308

351309
// use @INCLUDE to add config files to the main config file
352-
func writeInclude(configFilePath string, initConfigFilePath string) {
353-
initConfigFile := openFile(initConfigFilePath)
354-
defer initConfigFile.Close()
310+
func writeInclude(configFilePath, mainConfigFilePath string) {
311+
mainConfigFile := openFile(mainConfigFilePath)
312+
defer mainConfigFile.Close()
355313

356314
writeContent := "@INCLUDE " + configFilePath + "\n"
357-
_, err := initConfigFile.WriteString(writeContent)
315+
_, err := mainConfigFile.WriteString(writeContent)
358316
if err != nil {
359317
logrus.Errorln(err)
360-
logrus.Fatalf("[FluentBit Init Process] Cannot write %s in main config file: %s\n", writeContent[:len(writeContent)-2], initConfigFilePath)
318+
logrus.Fatalf("[FluentBit Init Process] Cannot write %s in main config file: %s\n", writeContent[:len(writeContent)-2], mainConfigFilePath)
361319
}
362320
}
363321

@@ -414,24 +372,23 @@ func main() {
414372
// create the invoke_fluent_bit.sh
415373
// which will declare ECS Task Metadata as environment variables
416374
// and finally invoke Fluent Bit
417-
createFile(invokeFilePath, true)
375+
createFile(invokeFile, true)
418376

419377
// get ECS Task Metadata and set the region for S3 client
420378
httpClient := &http.Client{}
421379
metadata := getECSTaskMetadata(httpClient)
422380

423381
// set ECS Task Metada as env vars in the invoke_fluent_bit.sh
424-
setECSTaskMetadata(metadata, invokeFilePath)
382+
setECSTaskMetadata(metadata, invokeFile)
425383

426384
// create main config file which will be used invoke Fluent Bit
427-
createFile(initConfigFilePath, true)
385+
createFile(mainConfigFile, true)
428386

429-
// create Fluent Bit command to use "-c" to specify new main config file
430-
createCommand(&baseCommand, initConfigFilePath)
387+
// add @INCLUDE in main config file to include original main config file
388+
writeInclude(originalMainConfigFile, mainConfigFile)
431389

432-
// include the FireLens generated config
433-
// unless the user has set aws_fluent_bit_init_ignore_firelens
434-
processFireLensConfigFile()
390+
// create Fluent Bit command to use "-c" to specify new main config file
391+
createCommand(&baseCommand, mainConfigFile)
435392

436393
// get our built in config files or files from s3
437394
// process built-in config files directly
@@ -442,5 +399,5 @@ func main() {
442399
// this function will be called at the end
443400
// any error appear above will cause exit this process,
444401
// will not write Fluent Bit command in the finvoke_fluent_bit.sh so Fluent Bit will not be invoked
445-
modifyInvokeFile(invokeFilePath)
402+
modifyInvokeFile(invokeFile)
446403
}

linux.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"linux": {
3-
"version": "2.32.1",
3+
"version": "2.32.0.20240304",
44
"latest": "true",
55
"build": "1",
66
"fluent-bit": "1.9.10",

load_tests/poetry.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)