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

Workflow #5

Merged
merged 127 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
dd40473
Basic functionality for backend transmitter
okankoAMZ Jun 17, 2022
4c6d98c
Merge branch 'aws:master' into master
okankoAMZ Jun 20, 2022
9789265
removed unit tests
okankoAMZ Jun 20, 2022
eed7d0d
Merge branch 'master' of https://github.com/okankoAMZ/amazon-cloudwat…
okankoAMZ Jun 20, 2022
9aa220e
playing around with github
okankoAMZ Jun 20, 2022
ca0a2e6
changed package name
okankoAMZ Jun 20, 2022
28dd6a8
seperated the test case
okankoAMZ Jun 20, 2022
9d12491
reformatted
okankoAMZ Jun 20, 2022
bdaba05
removed seperate test
okankoAMZ Jun 20, 2022
9fc4f4b
Merge pull request #1 from okankoAMZ/playground
okankoAMZ Jun 20, 2022
ebf8863
changed package
okankoAMZ Jun 20, 2022
c151136
new IntegrationTest Setup
okankoAMZ Jun 20, 2022
07c0ced
fixed integrationTest.yml
okankoAMZ Jun 20, 2022
ca829a4
applied pr feedback:
okankoAMZ Jun 21, 2022
71fb0d7
testing github hash fetch
okankoAMZ Jun 21, 2022
ed2f492
without terraform
okankoAMZ Jun 21, 2022
5a25b88
without terraform
okankoAMZ Jun 21, 2022
4047b0c
new fast test
okankoAMZ Jun 21, 2022
d833fd2
sha change
okankoAMZ Jun 21, 2022
f7e2123
typo fix
okankoAMZ Jun 21, 2022
a3cef30
typo
okankoAMZ Jun 21, 2022
6e39418
small change
okankoAMZ Jun 21, 2022
0560205
fixed path
okankoAMZ Jun 21, 2022
e0563eb
brute force test
okankoAMZ Jun 21, 2022
9a05c1e
typo
okankoAMZ Jun 21, 2022
c5dc0d8
small change
okankoAMZ Jun 21, 2022
8b69796
trying different export
okankoAMZ Jun 21, 2022
4cd00c8
trying with git command
okankoAMZ Jun 21, 2022
1f548d3
added sha date test
okankoAMZ Jun 22, 2022
e47af38
switched time to epoch time
okankoAMZ Jun 22, 2022
2394e35
implemented git integration to transmitter
okankoAMZ Jun 22, 2022
930119b
Merge branch 'aws:master' into workflow
okankoAMZ Jun 23, 2022
1ff58b1
merge first try
okankoAMZ Jun 23, 2022
609780e
added fast test
okankoAMZ Jun 23, 2022
6d095ac
fast test
okankoAMZ Jun 23, 2022
efc19e6
commens are back
okankoAMZ Jun 23, 2022
c389077
fixed
okankoAMZ Jun 23, 2022
0466268
typo
okankoAMZ Jun 23, 2022
c4cc42d
typo2
okankoAMZ Jun 23, 2022
0ee978f
created a alone performance test -changed test dir
okankoAMZ Jun 23, 2022
f2f2a8b
fixed workflow error
okankoAMZ Jun 23, 2022
2e2ce1a
changed packet name and dir name
okankoAMZ Jun 23, 2022
866ab4c
temp
okankoAMZ Jun 23, 2022
608669b
temp2
okankoAMZ Jun 23, 2022
43dc9eb
typo
okankoAMZ Jun 23, 2022
3d5c3e3
typo
okankoAMZ Jun 23, 2022
4e90bd3
temp
okankoAMZ Jun 23, 2022
ac8b183
debuggin
okankoAMZ Jun 23, 2022
300cd48
path change
okankoAMZ Jun 23, 2022
e961a18
added dyanmo
okankoAMZ Jun 23, 2022
38cb967
added sleep to transmitter
okankoAMZ Jun 23, 2022
55617ed
fixed hash bug
okankoAMZ Jun 23, 2022
73ea349
added export
okankoAMZ Jun 23, 2022
46d0127
testing export
okankoAMZ Jun 23, 2022
3afdcc6
Moved env vars to terraform
okankoAMZ Jun 24, 2022
387818a
typo fix in main.tf
okankoAMZ Jun 24, 2022
3978892
sanity check
okankoAMZ Jun 24, 2022
c98e690
changed export pos
okankoAMZ Jun 24, 2022
3201e40
added \ and changed locatin of var
okankoAMZ Jun 24, 2022
fd461fc
debugging
okankoAMZ Jun 24, 2022
a5ac8a1
type fix
okankoAMZ Jun 24, 2022
11131aa
Running Test for 10 mins
okankoAMZ Jun 24, 2022
388e95b
switched back to 5 mins
okankoAMZ Jun 24, 2022
a46f4a9
increased timeout in go test
okankoAMZ Jun 24, 2022
b25f8bb
added commit date as a sort key
okankoAMZ Jun 24, 2022
0efb4ba
fix
okankoAMZ Jun 24, 2022
5a95903
changing const
okankoAMZ Jun 24, 2022
9953e1e
testing new create table
okankoAMZ Jun 28, 2022
542ddfe
typo
okankoAMZ Jun 28, 2022
fe36e57
typo
okankoAMZ Jun 28, 2022
ea17719
fix
okankoAMZ Jun 28, 2022
b161b4c
changed backend
okankoAMZ Jun 30, 2022
0c71b04
demo-0
okankoAMZ Jun 30, 2022
0be1641
demo-1
okankoAMZ Jun 30, 2022
13b2cae
demo-2
okankoAMZ Jun 30, 2022
94954d1
small bug with min and max
okankoAMZ Jun 30, 2022
d091aa6
demo-3
okankoAMZ Jun 30, 2022
fd59d15
demo-4
okankoAMZ Jul 1, 2022
48caf65
demo-5
okankoAMZ Jul 1, 2022
78ae890
matrix test
okankoAMZ Jul 12, 2022
644caf8
testing parallel running performancetest
okankoAMZ Jul 13, 2022
5bde19d
typo fix
okankoAMZ Jul 13, 2022
46e95a2
typo fix
okankoAMZ Jul 13, 2022
8a4ac52
change test name in go generator
okankoAMZ Jul 13, 2022
579ae66
rename
okankoAMZ Jul 13, 2022
7c27c81
rename file
okankoAMZ Jul 13, 2022
b546e68
typo fix
okankoAMZ Jul 13, 2022
627127e
debug
okankoAMZ Jul 13, 2022
1998c6a
debug2
okankoAMZ Jul 13, 2022
3e51501
typo
okankoAMZ Jul 13, 2022
8f82eb3
optim
okankoAMZ Jul 13, 2022
9d4389f
typo
okankoAMZ Jul 13, 2022
34913fa
test
okankoAMZ Jul 13, 2022
f8af2da
test
okankoAMZ Jul 13, 2022
8d0e219
test
okankoAMZ Jul 13, 2022
5869353
debug 3
okankoAMZ Jul 13, 2022
c65232a
debug pure performance removed everything else
okankoAMZ Jul 13, 2022
d87f974
with linux
okankoAMZ Jul 13, 2022
b558962
:(
okankoAMZ Jul 13, 2022
962fb64
typo fix
okankoAMZ Jul 13, 2022
cabd1b5
added performance n logs config
okankoAMZ Jul 13, 2022
75a50fe
coma fix
okankoAMZ Jul 13, 2022
1168549
releaseTest
okankoAMZ Jul 15, 2022
c1479d4
reverted to old terraform
okankoAMZ Jul 15, 2022
1d99bda
proper test
okankoAMZ Jul 15, 2022
30198f3
release typo
okankoAMZ Jul 15, 2022
868ed6c
changed command
okankoAMZ Jul 15, 2022
abc699e
retry
okankoAMZ Jul 15, 2022
f9ab079
uses added
okankoAMZ Jul 15, 2022
a6329a5
release changed
okankoAMZ Jul 15, 2022
03e6248
fix
okankoAMZ Jul 15, 2022
76b487e
fix
okankoAMZ Jul 15, 2022
adb25c1
fix
okankoAMZ Jul 15, 2022
7c5a13d
added creds
okankoAMZ Jul 15, 2022
da5d472
added error msgs
okankoAMZ Jul 15, 2022
2dc1ced
print
okankoAMZ Jul 15, 2022
98e2ae3
switched from short to long hash
okankoAMZ Jul 15, 2022
7f4207d
release checker test
okankoAMZ Jul 15, 2022
4affa87
float bug fix
okankoAMZ Jul 15, 2022
61d5b9f
added tps, etc. and made dynamic update item
okankoAMZ Jul 18, 2022
1376892
update terraform vars
okankoAMZ Jul 18, 2022
5e5246d
testing concurrent SendItem
okankoAMZ Jul 18, 2022
4bb4d56
trying concurrent tests
okankoAMZ Jul 18, 2022
0648e82
fixed
okankoAMZ Jul 18, 2022
471995b
added debug print
okankoAMZ Jul 18, 2022
49dc026
fixed generator
okankoAMZ Jul 18, 2022
ae36caf
Merge branch 'master' into workflow
okankoAMZ Jul 19, 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
275 changes: 275 additions & 0 deletions .github/workflows/fastPeformanceTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: Fast Performance Test
env:
PRIVATE_KEY: ${{ secrets.AWS_PRIVATE_KEY }}
TERRAFORM_AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
TERRAFORM_AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
S3_INTEGRATION_BUCKET: ${{ secrets.S3_INTEGRATION_BUCKET }}
KEY_NAME: ${{ secrets.KEY_NAME }}
VPC_SECURITY_GROUPS_IDS: ${{ secrets.VPC_SECURITY_GROUPS_IDS }}
IAM_ROLE: ${{ secrets.IAM_ROLE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_TTY: $(tty)
ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test"

on:
push:
branches:
- workflow

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
MakeBinary:
name: 'MakeBinary'
runs-on: ubuntu-latest
steps:
# Set up building environment, patch the dev repo code on dispatch events.
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ~1.18.3

- name: Install rpm
run: sudo apt install rpm

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'true'

- name: Cache go
id: cached_go
uses: actions/cache@v2
env:
cache-name: cached_go_modules
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}

- name: Cache binaries
id: cached_binaries
uses: actions/cache@v2
with:
key: "cached_binaries_${{ github.sha }}"
path: go.mod

- name: Build Binaries
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: make build package-rpm package-deb package-win package-darwin

- uses: olafurpg/setup-gpg@v3

- name: Sign packages
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: |
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import -
for f in $(find build/bin/); do if [ ! -d $f ]; then echo "Signing file $f" && echo "${PASSPHRASE}" | gpg --detach-sign --passphrase-fd 0 --batch --default-key "${GPG_KEY_NAME}" $f ; fi ; done

- name: Upload to s3
if: steps.cached_binaries.outputs.cache-hit != 'true'
run: aws s3 cp build/bin s3://${S3_INTEGRATION_BUCKET}/integration-test/binary/${{ github.sha }} --recursive

GenerateTestMatrix:
name: 'GenerateTestMatrix'
runs-on: ubuntu-latest
outputs:
ec2_linux_matrix: ${{ steps.set-matrix.outputs.ec2_linux_matrix }}
ec2_performance_matrix: ${{steps.set-matrix.outputs.ec2_performance_matrix}}
ec2_windows_matrix: ${{ steps.set-matrix.outputs.ec2_windows_matrix }}
ecs_fargate_matrix: ${{ steps.set-matrix.outputs.ecs_fargate_matrix }}
steps:
- uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ~1.18.3

- name: Generate matrix
id: set-matrix
run: |
go run --tags=generator integration/generator/test_case_generator.go
echo "::set-output name=ec2_linux_matrix::$(echo $(cat integration/generator/resources/ec2_linux_complete_test_matrix.json))"
echo "::set-output name=ec2_performance_matrix::$(echo $(cat integration/generator/resources/ec2_performance_complete_test_matrix.json))"
echo "::set-output name=ec2_windows_matrix::$(echo $(cat integration/generator/resources/ec2_windows_complete_test_matrix.json))"
echo "::set-output name=ecs_fargate_matrix::$(echo $(cat integration/generator/resources/ecs_fargate_complete_test_matrix.json))"

- name: Echo test plan matrix
run: |
echo ${{ steps.set-matrix.outputs.ec2_linux_matrix }}
echo ${{ steps.set-matrix.outputs.ec2_performance_matrix}}
echo ${{ steps.set-matrix.outputs.ec2_windows_matrix }}
echo ${{ steps.set-matrix.outputs.ecs_fargate_matrix }}
- name: Echo performance matrix
run: |
echo ${{ steps.set-matrix.outputs.ec2_performance_matrix}}

StartLocalStack:
name: 'StartLocalStack'
runs-on: ubuntu-latest
defaults:
run:
working-directory: integration/terraform/ec2/localstack
outputs:
local_stack_host_name: ${{ steps.localstack.outputs.local_stack_host_name }}
steps:
- uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Verify Terraform version
run: terraform --version

- name: Terraform init
run: terraform init

- name: Terraform apply
id: localstack
run: >
echo run terraform and execute test code &&
terraform apply --auto-approve
-var="ssh_key=${PRIVATE_KEY}"
-var="github_repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
-var="github_sha=${GITHUB_SHA}"
-var="s3_bucket=${S3_INTEGRATION_BUCKET}"
-var="vpc_security_group_ids=${VPC_SECURITY_GROUPS_IDS}"
-var="key_name=${KEY_NAME}"
-var="iam_instance_profile=${IAM_ROLE}" &&
LOCAL_STACK_HOST_NAME=$(terraform output -raw public_dns) &&
echo $LOCAL_STACK_HOST_NAME &&
echo "::set-output name=local_stack_host_name::$LOCAL_STACK_HOST_NAME" &&
aws s3 cp terraform.tfstate s3://${S3_INTEGRATION_BUCKET}/integration-test/local-stack-terraform-state/${GITHUB_SHA}/terraform.tfstate

StopLocalStack:
name: 'StopLocalStack'
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [StartLocalStack, PerformanceTrackingTest]
defaults:
run:
working-directory: integration/terraform/ec2/localstack
steps:
- uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Copy state
run: aws s3 cp s3://${S3_INTEGRATION_BUCKET}/integration-test/local-stack-terraform-state/${GITHUB_SHA}/terraform.tfstate .

- name: Verify Terraform version
run: terraform --version

- name: Terraform init
run: terraform init

- name: Terraform destroy
run: terraform destroy --auto-approve

PerformanceTrackingTest:
name: "PerformanceTrackingTest"
needs: [MakeBinary, StartLocalStack, GenerateTestMatrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_performance_matrix) }}
steps:
- uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Cache if success
id: performance-tracking
uses: actions/cache@v2
with:
path: go.mod
key: performance-tracking-test-${{ github.sha }}

- name: Echo Test Info
run: echo run performance-tracking
- name: Verify Terraform version
run: terraform --version
- name: Get SHA
id: sha
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Get git date
id: sha_date
run: echo "::set-output name=sha_date::$(git show -s --format=%ct ${{ steps.sha.outputs.sha_short }} )"
- name: Check env
run: echo "SHA ${{ steps.sha.outputs.sha_short }} | Date ${{ steps.sha_date.outputs.sha_date }} "
#
- name: Terraform apply
if: steps.ec2-linux-integration-test.outputs.cache-hit != 'true'
uses: nick-invision/retry@v2
with:
max_attempts: 1
timeout_minutes: 30
retry_wait_seconds: 5
command: |
cd integration/terraform/ec2/linux
terraform init
if terraform apply --auto-approve \
-var="ssh_key=${PRIVATE_KEY}" -var="github_repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \
-var="github_sha=${GITHUB_SHA}" -var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="user=${{ matrix.arrays.username }}" \
-var="ami=${{ matrix.arrays.ami }}" \
-var="ca_cert_path=${{ matrix.arrays.caCertPath }}" \
-var="arc=${{ matrix.arrays.arc }}" \
-var="binary_name=${{ matrix.arrays.binaryName }}" \
-var="local_stack_host_name=${{ needs.StartLocalStack.outputs.local_stack_host_name }}" \
-var="s3_bucket=${S3_INTEGRATION_BUCKET}" \
-var="vpc_security_group_ids=${VPC_SECURITY_GROUPS_IDS}" \
-var="key_name=${KEY_NAME}" \
-var="sha=${GITHUB_SHA}" \
-var="sha_date=${{ steps.sha_date.outputs.sha_date }}" \
-var="test_name=cw-integ-test-${{ matrix.arrays.os }}" \
-var="iam_instance_profile=${IAM_ROLE}" \
-var="performance_number_of_logs=${{ matrix.arrays.performance_number_of_logs}}"\
-var="test_dir=${{ matrix.arrays.test_dir }}" ; then terraform destroy -auto-approve
else
terraform destroy -auto-approve && exit 1
fi

#This is here just in case workflow cancel
- name: Terraform destroy
if: ${{ cancelled() && steps.ec2-linux-integration-test.outputs.cache-hit != 'true' }}
uses: nick-invision/retry@v2
with:
max_attempts: 1
timeout_minutes: 8
retry_wait_seconds: 5
command: cd integration/terraform/ec2/linux && terraform destroy --auto-approve
3 changes: 3 additions & 0 deletions .github/workflows/integrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ jobs:
matrix:
arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.ec2_linux_matrix) }}
steps:
- name: TEMP TEST LOOKUP
run: echo "${{ matrix.arrays.test_dir}}"
- uses: actions/checkout@v2

- name: Configure AWS Credentials
Expand Down Expand Up @@ -687,3 +689,4 @@ jobs:
timeout_minutes: 8
retry_wait_seconds: 5
command: cd integration/terraform/ec2/linux && terraform destroy --auto-approve

52 changes: 52 additions & 0 deletions .github/workflows/releaseTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT

name: Fast Performance Test
env:
PRIVATE_KEY: ${{ secrets.AWS_PRIVATE_KEY }}
TERRAFORM_AWS_ACCESS_KEY_ID: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
TERRAFORM_AWS_SECRET_ACCESS_KEY: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
S3_INTEGRATION_BUCKET: ${{ secrets.S3_INTEGRATION_BUCKET }}
KEY_NAME: ${{ secrets.KEY_NAME }}
VPC_SECURITY_GROUPS_IDS: ${{ secrets.VPC_SECURITY_GROUPS_IDS }}
IAM_ROLE: ${{ secrets.IAM_ROLE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_TTY: $(tty)
ECR_INTEGRATION_TEST_REPO: "cwagent-integration-test"

on:
release:
types: [created]

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
UpdatePerformanceMetrics:
name: "UpdatePerformanceMetrics"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ~1.18.3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Run Golang Update Function
run: |
cd integration/test/performancetest
export IS_RELEASE=true
export SHA=$GITHUB_SHA
go test -run TestUpdateCommit -p 1 -v --tags=integration
Loading