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

fix: Improve Airbyte CI logging #20517

Merged
merged 26 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f5b2390
add fluent-bit logging to k3s setup
xpuska513 Dec 12, 2022
0a89af7
Fix --set for helm
xpuska513 Dec 12, 2022
74f038d
add --generate-name
xpuska513 Dec 12, 2022
264342b
fix slash in multiline bash
xpuska513 Dec 12, 2022
b08d2f2
Update --set for helm
xpuska513 Dec 13, 2022
45d0d9f
Use generate-name instead
xpuska513 Dec 13, 2022
e2ac390
Add debug
xpuska513 Dec 13, 2022
0d468ce
Remove deubg for helm
xpuska513 Dec 13, 2022
9763bb2
Fix env again
xpuska513 Dec 13, 2022
1fbfd9f
Disable build
xpuska513 Dec 13, 2022
e7efe75
Remove everything
xpuska513 Dec 13, 2022
13eac9e
Disable everything again
xpuska513 Dec 13, 2022
7748328
Snap back to reallity
xpuska513 Dec 13, 2022
df99100
Update fluent_values.yaml
xpuska513 Dec 14, 2022
7d12f9b
Use role instead of AWS creds
xpuska513 Dec 14, 2022
ded553e
Use new bucket
xpuska513 Dec 15, 2022
a9ba314
Merge branch 'kskobylko/improve-airbyte-ci-logging' of github.com:air…
xpuska513 Dec 15, 2022
df7b55b
Revert changes
xpuska513 Dec 15, 2022
ead967d
Update bucket name
xpuska513 Dec 15, 2022
3e0d0a6
Play around with fluent-bit config
xpuska513 Dec 15, 2022
20a8585
Escape string in helm --set arg
xpuska513 Dec 15, 2022
8c7536e
Update fluent-bit config + update --set argument
xpuska513 Dec 15, 2022
2dfd1a4
Update fluentbit config so it"ll create s3 path correctly
xpuska513 Dec 15, 2022
acb17a6
Add logging to kustomize
xpuska513 Dec 15, 2022
e92b9a8
Revert debug mode
xpuska513 Dec 15, 2022
90249a7
Merge branch 'master' into kskobylko/improve-airbyte-ci-logging
xpuska513 Dec 27, 2022
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
1 change: 1 addition & 0 deletions .github/actions/start-aws-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ inputs:
required: false
ec2-instance-id:
required: false

outputs:
label:
value: ${{ steps.start-ec2-runner.outputs.label }}
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ on:
inputs:
debug_mode:
description: "Enable or disable tmate session for debug during helm ac tests"
type: choice
default: 'false'
options:
- 'true'
- 'false'
required: false
schedule:
- cron: "0 */1 * * *"
Expand Down Expand Up @@ -806,6 +810,16 @@ jobs:
with:
python-version: "3.9"

- name: Install unzip
shell: bash
run: sudo apt-get update && sudo apt-get install -y unzip

- uses: azure/setup-helm@v3
with:
version: 'latest'
token: ${{ secrets.GITHUB_TOKEN }}
id: install

- name: Fix EC-2 Runner
run: |
mkdir -p /home/runner
Expand Down Expand Up @@ -857,6 +871,8 @@ jobs:
HOME: /home/runner
# AWS_S3_INTEGRATION_TEST_CREDS can be found in LastPass as AWS_S3_INTEGRATION_TEST_CREDS
AWS_S3_INTEGRATION_TEST_CREDS: ${{ secrets.AWS_S3_INTEGRATION_TEST_CREDS }}
WORKFLOW_RUN_ID: ${{ github.run_id }}
AWS_S3_BUCKET: airbyte-ci-ac-tests-logs
SECRET_STORE_GCP_CREDENTIALS: ${{ secrets.SECRET_STORE_GCP_CREDENTIALS }}
SECRET_STORE_GCP_PROJECT_ID: ${{ secrets.SECRET_STORE_GCP_PROJECT_ID }}
uses: Wandalen/wretry.action@master
Expand Down Expand Up @@ -993,6 +1009,7 @@ jobs:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ env.PAT }}
iam-role-name: ${{ secrets.AWS_ASSUME_ROLE_NAME }}

helm-acceptance-test:
name: "Platform: Acceptance Tests (Helm)"
Expand Down Expand Up @@ -1023,12 +1040,8 @@ jobs:
uses: Wandalen/wretry.action@master
with:
command: |
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo apt-get remove docker.io || sudo apt-get remove docker
curl -fsSL https://get.docker.com | bash -
sudo rm -f /var/lib/dpkg/lock
sudo rm -f /var/lib/dpkg/lock-frontend
attempt_limit: 3
attempt_delay: 2000 # in ms

Expand Down Expand Up @@ -1065,11 +1078,7 @@ jobs:
uses: Wandalen/wretry.action@master
with:
command: |
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo apt-get -y install tmate
sudo rm -f /var/lib/dpkg/lock
sudo rm -f /var/lib/dpkg/lock-frontend
attempt_limit: 3
attempt_delay: 2000 # in ms

Expand Down Expand Up @@ -1124,6 +1133,8 @@ jobs:
# HOME: /home/runner
# AWS_S3_INTEGRATION_TEST_CREDS can be found in LastPass as AWS_S3_INTEGRATION_TEST_CREDS
AWS_S3_INTEGRATION_TEST_CREDS: ${{ secrets.AWS_S3_INTEGRATION_TEST_CREDS }}
WORKFLOW_RUN_ID: ${{ github.run_id }}
AWS_S3_BUCKET: airbyte-ci-ac-tests-logs
SECRET_STORE_GCP_CREDENTIALS: ${{ secrets.SECRET_STORE_GCP_CREDENTIALS }}
SECRET_STORE_GCP_PROJECT_ID: ${{ secrets.SECRET_STORE_GCP_PROJECT_ID }}
timeout-minutes: 20
Expand Down
11 changes: 11 additions & 0 deletions tools/bin/acceptance_test_kube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ if [ -n "$CI" ]; then
wait
fi

echo "Deploying fluentbit"
helm repo add fluent https://fluent.github.io/helm-charts
helm repo update fluent
sed -i "s/PLACEHOLDER/${WORKFLOW_RUN_ID}/" tools/bin/fluent_values.yaml
helm install --values tools/bin/fluent_values.yaml --set env[1].name="AWS_ACCESS_KEY_ID" --set env[1].value=$(echo "$AWS_S3_INTEGRATION_TEST_CREDS" | jq -r .aws_access_key_id) \
--set env[2].name="AWS_SECRET_ACCESS_KEY" --set env[2].value=$(echo "$AWS_S3_INTEGRATION_TEST_CREDS" | jq -r .aws_secret_access_key) \
--set env[3].name="AWS_S3_BUCKET" --set env[3].value=${AWS_S3_BUCKET} \
--set env[4].name="SUITE_TYPE" --set env[4].value="kustomize-logs" \
--generate-name fluent/fluent-bit


echo "Starting app..."

echo "Applying dev-integration-test manifests to kubernetes..."
Expand Down
10 changes: 10 additions & 0 deletions tools/bin/acceptance_test_kube_helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ kubectl patch configmap/coredns \
-p '{"data":{"NodeHosts": "${DOCKER_HOST_IP} host.docker.internal" }}'


echo "Deploying fluentbit"
helm repo add fluent https://fluent.github.io/helm-charts
helm repo update fluent
sed -i "s/PLACEHOLDER/${WORKFLOW_RUN_ID}/" tools/bin/fluent_values.yaml
helm install --values tools/bin/fluent_values.yaml --set env[1].name="AWS_ACCESS_KEY_ID" --set env[1].value=$(echo "$AWS_S3_INTEGRATION_TEST_CREDS" | jq -r .aws_access_key_id) \
--set env[2].name="AWS_SECRET_ACCESS_KEY" --set env[2].value=$(echo "$AWS_S3_INTEGRATION_TEST_CREDS" | jq -r .aws_secret_access_key) \
--set env[3].name="AWS_S3_BUCKET" --set env[3].value=${AWS_S3_BUCKET} \
--set env[4].name="SUITE_TYPE" --set env[4].value="helm-logs" \
--generate-name fluent/fluent-bit

echo "Replacing default Chart.yaml and values.yaml with a test one"
mv charts/airbyte/Chart.yaml charts/airbyte/Chart.yaml.old
mv charts/airbyte/Chart.yaml.test charts/airbyte/Chart.yaml
Expand Down
15 changes: 15 additions & 0 deletions tools/bin/fluent_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
config:
outputs: |
[OUTPUT]
Name s3
Match kube.*
bucket ${AWS_S3_BUCKET}
region us-east-2
total_file_size 1M
upload_timeout 2m
use_put_object On
log_key log
s3_key_format /${SUITE_TYPE}/${WORKFLOW_RUN_ID}/$TAG[4]/$UUID.log
env:
- name: WORKFLOW_RUN_ID
value: 'PLACEHOLDER'