-
Notifications
You must be signed in to change notification settings - Fork 133
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
runbook: add FireLens crash runbook and template, make core
build target
#533
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
398bfae
Split debug builds into multiple dockerfiles, S3 core dump uploader b…
PettitWesley 7ba76d8
core uploader: S3_BUCKET and S3_KEY_PREFIX are clear and correct names
PettitWesley a862b09
Makefile: add separate valgrind target
PettitWesley 051a264
runbooks: add FireLens crash runbook template
PettitWesley bc05302
runbook: add FireLens crash report runbook
PettitWesley ec0fc41
tools: add openssl rand configurable logger
PettitWesley 4a867fc
Dockerfile.core: do not have default S3 bucket names
PettitWesley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM amazon/aws-for-fluent-bit:debug-base | ||
|
||
ENV S3_BUCKET | ||
ENV S3_KEY_PREFIX | ||
|
||
RUN yum install -y unzip zip curl gdb | ||
|
||
WORKDIR /var/tmp | ||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(arch).zip" -o "awscliv2.zip" | ||
RUN unzip awscliv2.zip | ||
RUN ./aws/install | ||
RUN rm awscliv2.zip | ||
|
||
RUN yum remove unzip -y \ | ||
&& yum clean all \ | ||
&& rm -rf /var/cache/yum | ||
|
||
RUN mkdir /cores && chmod 777 /cores | ||
|
||
# Setting core pattern in /proc/sys/kernel/core_pattern requires privileged mode | ||
# And can only be done at container runtime | ||
# Default kernel core pattern for amazonlinux should be: '/cores/core_%e.%p' | ||
# However, we have seen that sometimes for unknown reasons cores are just dumped | ||
# to the current working directory. | ||
# S0 change working directory to the cores folder to run fluent bit from there. | ||
WORKDIR /cores | ||
|
||
# Upload coredumps to s3 on shutdown | ||
# customer must set BUCKET env var | ||
CMD /fluent-bit/bin/fluent-bit -c /fluent-bit/etc/fluent-bit.conf; ls /cores; zip /cores/core.zip *; aws s3 cp /cores/core.zip s3://${S3_BUCKET}/${S3_KEY_PREFIX}/${HOSTNAME}-${RANDOM}/ |
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,4 @@ | ||
FROM amazon/aws-for-fluent-bit:debug-base | ||
|
||
RUN yum clean all \ | ||
&& rm -rf /var/cache/yum |
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,6 @@ | ||
FROM amazonlinux | ||
ADD logger.sh /logger.sh | ||
RUN yum upgrade -y && yum install -y openssl | ||
RUN yum clean all \ | ||
&& rm -rf /var/cache/yum | ||
CMD bash /logger.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,7 @@ | ||
# custom logger that outputs events to stdout | ||
# uses openssl to generate random data, so each log emitted | ||
# is unique | ||
# | ||
# Env Vars: | ||
# LOGGER_RATE => number of logs to emit per second | ||
# LOG_SIZE => size in bytes of openssl to generate for each log |
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,12 @@ | ||
#!/bin/bash | ||
|
||
# Writes 500 log lines per second | ||
|
||
while : | ||
do | ||
for i in {0..${LOGGER_RATE}} | ||
do | ||
openssl rand -base64 ${LOG_SIZE} | ||
done | ||
sleep 1 | ||
done |
3 changes: 3 additions & 0 deletions
3
troubleshooting/tutorials/cloud-firelens-crash-repro-template/Dockerfile
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,3 @@ | ||
FROM {core dump image build} | ||
ADD extra.conf /extra.conf | ||
ADD parser.conf /parser.conf |
1 change: 1 addition & 0 deletions
1
troubleshooting/tutorials/cloud-firelens-crash-repro-template/extra.conf
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 @@ | ||
# add customer custom config content here |
11 changes: 11 additions & 0 deletions
11
troubleshooting/tutorials/cloud-firelens-crash-repro-template/logger/Dockerfile
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,11 @@ | ||
FROM amazonlinux | ||
|
||
ADD file1.log /file1.log | ||
ADD stdout.log /stdout.log | ||
ADD tcp.log /tcp.log | ||
ADD logger.sh /logger.sh | ||
RUN mkdir /tail | ||
RUN yum install -y nc | ||
|
||
CMD bash logger.sh | ||
|
2 changes: 2 additions & 0 deletions
2
troubleshooting/tutorials/cloud-firelens-crash-repro-template/logger/file1.log
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 @@ | ||
# add customer or simulated log content log content here | ||
# script writes this to '/tail/file1.log$(date "+%Y-%m-%d-%H")' |
15 changes: 15 additions & 0 deletions
15
troubleshooting/tutorials/cloud-firelens-crash-repro-template/logger/instructions.txt
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,15 @@ | ||
# Usage: Set the following env vars: | ||
# | ||
# STDOUT_LOGGER_RATE => logs per second to send to stdout | ||
# FILE1_LOGGER_RATE => logs per second to send to /tail/file1.log$(date "+%Y-%m-%d-%H") | ||
# TCP_LOGGER_RATE => logs per second to send to TCP_LOGGER_PORT | ||
# TCP_LOGGER_PORT => TCP port of TCP input in Fluent Bit, if used | ||
# | ||
# If you do not need one of these loggers, simply remove its entry from the loop | ||
# in the logger.sh | ||
# | ||
# you can easily configure additional loggers as needed | ||
# just add another entry in the while loop | ||
# and import the new file in the Dockerfile | ||
# | ||
# Build this container with `docker build`, push to ECR, and use in task def for logger |
32 changes: 32 additions & 0 deletions
32
troubleshooting/tutorials/cloud-firelens-crash-repro-template/logger/logger.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,32 @@ | ||
# Usage: Set the following env vars: | ||
# | ||
# STDOUT_LOGGER_RATE => logs per second to send to stdout | ||
# FILE1_LOGGER_RATE => logs per second to send to /tail/file1.log$(date "+%Y-%m-%d-%H-%M-%S") | ||
# TCP_LOGGER_RATE => logs per second to send to TCP_LOGGER_PORT | ||
# TCP_LOGGER_PORT => TCP port of TCP input in Fluent Bit, if used | ||
# | ||
# If you do not need one of these loggers, simply remove its entry from the loop | ||
# | ||
# you can easily configure additional loggers as needed | ||
# just add another entry in the while loop | ||
# and import the new file in the Dockerfile | ||
|
||
|
||
while true | ||
do | ||
for i in {1..$TCP_LOGGER_RATE} | ||
do | ||
cat /tcp.log | nc 127.0.0.1 $TCP_LOGGER_PORT | ||
done | ||
for i in {1..$STDOUT_LOGGER_RATE} | ||
do | ||
cat /stdout.log | ||
done | ||
for i in {1..$FILE1_LOGGER_RATE} | ||
do | ||
# this sets up automatic rotation of the active file based on the date | ||
# automatic log file clean up is not currently in this image | ||
cat /file1.log >> /tail/file1.log$(date "+%Y-%m-%d-%H") | ||
done | ||
sleep 1 | ||
done |
2 changes: 2 additions & 0 deletions
2
troubleshooting/tutorials/cloud-firelens-crash-repro-template/logger/stdout.log
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 @@ | ||
# add customer or simulated log content here that will be sent to stdout | ||
# it will be cat'd to stdout STDOUT_LOGGER_RATE times per second |
1 change: 1 addition & 0 deletions
1
troubleshooting/tutorials/cloud-firelens-crash-repro-template/logger/tcp.log
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 @@ | ||
# add customer or simulated log content here that will be sent to stdout |
3 changes: 3 additions & 0 deletions
3
troubleshooting/tutorials/cloud-firelens-crash-repro-template/parser.conf
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,3 @@ | ||
# add any custom parsing content here | ||
# Dockerfile imports this to /parser.conf | ||
# change that or change the import in the [SERVICE] section |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we need details about using --platform and targeting the desired architecture when working on MacOS (building linux/amd64 images is not default). I am not sure the correct location to state that as make core will build whatever platform default and any guide information on building an image below may also need that note.