-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests for out_s3 (#75)
- Loading branch information
1 parent
5509d7c
commit 4b0b086
Showing
13 changed files
with
219 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fluent-bit-integ-test-1264 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM amazonlinux | ||
|
||
RUN yum upgrade -y | ||
RUN yum install -y openssl | ||
|
||
COPY logscript.sh / | ||
|
||
CMD ["bash", "/logscript.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Writes 7717 unique log lines | ||
# intermixed with 1 KB lines of random data | ||
# these logs are written over the course of a little over 1 minute | ||
# because we want to test S3's local buffering | ||
# Why 7717? Its a prime number. And I like that. | ||
# Finally we sleep for 90s- ensuring the upload timeout hits for the last chunk | ||
# then exit | ||
|
||
for i in {0..7716} | ||
do | ||
echo $i | ||
openssl rand -base64 1000 | tr '\n' '-' && echo "" | ||
sleep 0.0001 | ||
done | ||
|
||
sleep 200 | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: "2" | ||
|
||
services: | ||
fluent-bit: | ||
image: amazon/aws-for-fluent-bit:latest | ||
environment: | ||
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" | ||
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" | ||
- "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" | ||
- "S3_BUCKET_NAME=${S3_BUCKET_NAME}" | ||
- "ARCHITECTURE=${ARCHITECTURE}" | ||
- FLB_LOG_LEVEL=debug | ||
volumes: | ||
- /var/run/:/var/run | ||
- ./:/fluent-bit/etc/ | ||
logger-multipart-test: | ||
build: ${PROJECT_ROOT}/integ/s3-logger | ||
depends_on: | ||
- fluent-bit | ||
logging: | ||
driver: fluentd | ||
options: | ||
tag: "multipart-upload-test-${TAG}" | ||
fluentd-address: unix:///var/run/fluent.sock | ||
fluentd-async-connect: "true" | ||
logger-put-object-test: | ||
build: ${PROJECT_ROOT}/integ/s3-logger | ||
depends_on: | ||
- fluent-bit | ||
logging: | ||
driver: fluentd | ||
options: | ||
tag: "put-object-test-${TAG}" | ||
fluentd-address: unix:///var/run/fluent.sock | ||
fluentd-async-connect: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "2" | ||
|
||
services: | ||
validate-s3-multipart: | ||
build: ${PROJECT_ROOT}/integ/s3 | ||
environment: | ||
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" | ||
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" | ||
- "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" | ||
- "AWS_REGION=${AWS_REGION}" | ||
- "S3_BUCKET_NAME=${S3_BUCKET_NAME}" | ||
- "S3_ACTION=${S3_ACTION}" | ||
- "S3_PREFIX=${S3_PREFIX_MULTIPART}" | ||
- "EXPECTED_EVENTS_LEN=${EXPECTED_EVENTS_LEN}" | ||
- "TEST_FILE=${TEST_FILE}" | ||
volumes: | ||
- ${PROJECT_ROOT}/integ/out:/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "2" | ||
|
||
services: | ||
validate-s3-put-object: | ||
build: ${PROJECT_ROOT}/integ/s3 | ||
environment: | ||
- "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" | ||
- "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" | ||
- "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" | ||
- "AWS_REGION=${AWS_REGION}" | ||
- "S3_BUCKET_NAME=${S3_BUCKET_NAME}" | ||
- "S3_ACTION=${S3_ACTION}" | ||
- "S3_PREFIX=${S3_PREFIX_PUT_OBJECT}" | ||
- "EXPECTED_EVENTS_LEN=${EXPECTED_EVENTS_LEN}" | ||
- "TEST_FILE=${TEST_FILE}" | ||
volumes: | ||
- ${PROJECT_ROOT}/integ/out:/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[SERVICE] | ||
Log_Level debug | ||
|
||
[INPUT] | ||
Name forward | ||
unix_path /var/run/fluent.sock | ||
|
||
[OUTPUT] | ||
Name s3 | ||
Match multipart* | ||
bucket ${S3_BUCKET_NAME} | ||
region us-west-2 | ||
store_dir /fluent-bit/buffer | ||
total_file_size 100M | ||
s3_key_format /logs/${ARCHITECTURE}/multipart/$TAG[1]/logs/$TAG/%Y/%m/%d/%H/%M/%S | ||
s3_key_format_tag_delimiters .- | ||
upload_timeout 2m | ||
|
||
[OUTPUT] | ||
Name s3 | ||
Match put-object* | ||
bucket ${S3_BUCKET_NAME} | ||
region us-west-2 | ||
store_dir /fluent-bit/buffer | ||
total_file_size 1M | ||
s3_key_format /logs/${ARCHITECTURE}/put$TAG[1]/logs/$TAG/%Y/%m/%d/%H/%M/%S | ||
s3_key_format_tag_delimiters .- | ||
use_put_object On | ||
upload_timeout 30s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin | ||
integ/out |