@@ -60,56 +60,55 @@ phases:
6060
6161 if [ "${PUBLISH_ENABLED}" = "false" ]; then
6262 echo "Publishing is disabled for BUILD_VERSION=${BUILD_VERSION}, skipping load tests"
63- exit 0
64- fi
65- # Set stack names based on BUILD_VERSION.
66- # Do not add BUILD_VERSION for BUILD_VERSION=2 to make load test work with existing resources.
67- # This can be changed once naming is aligned and resources are resynthesized for BUILD_VERSION=2
68- - |
69- if [ "$BUILD_VERSION" = "2" ]; then
70- export TESTING_RESOURCES_STACK_NAME='load-test-fluent-bit-testing-resources'
71- export LOG_STORAGE_STACK_NAME='load-test-fluent-bit-log-storage'
72- export EKS_CLUSTER_NAME='load-test-fluent-bit-eks-cluster'
73- else
74- export TESTING_RESOURCES_STACK_NAME="load-test-fluent-bit-testing-resources-v${BUILD_VERSION}"
75- export LOG_STORAGE_STACK_NAME="load-test-fluent-bit-log-storage-v${BUILD_VERSION}"
76- export EKS_CLUSTER_NAME="load-test-fluent-bit-eks-cluster-v${BUILD_VERSION}"
77- fi
78- echo "Using TESTING_RESOURCES_STACK_NAME: $TESTING_RESOURCES_STACK_NAME"
79- echo "Using LOG_STORAGE_STACK_NAME: $LOG_STORAGE_STACK_NAME"
80- echo "Using EKS_CLUSTER_NAME: $EKS_CLUSTER_NAME"
81- # Execute load test commands (common logic for all supported BUILD_VERSIONs)
82- - |
83- if [ "$BUILD_VERSION" = "2" ] || [ "$BUILD_VERSION" = "3" ]; then
84- # need this for multiline code blocks to raise any errors to codebuild
85- set -e
86- echo "Running load tests for AWS for Fluent Bit version $BUILD_VERSION"
87-
88- # Activate Python virtual environment and install the AWS CDK core dependencies
89- python -m venv venv
90- source venv/bin/activate
91- pip install -r ./load_tests/requirements.txt
92- if [ "${PLATFORM}" == "EKS" ]; then
93- aws eks update-kubeconfig --name $EKS_CLUSTER_NAME
94- fi
95- CREDS=$(aws sts assume-role --role-arn $LOAD_TEST_CFN_ROLE_ARN --role-session-name load-test-cfn --duration-seconds 3600)
96- export CREDS
97- export AWS_ACCESS_KEY_ID=$(echo "${CREDS}" | jq -r '.Credentials.AccessKeyId')
98- export AWS_SECRET_ACCESS_KEY=$(echo "${CREDS}" | jq -r '.Credentials.SecretAccessKey')
99- export AWS_SESSION_TOKEN=$(echo "${CREDS}" | jq -r '.Credentials.SessionToken')
100- # Create and set up related testing resources
101- python ./load_tests/load_test.py create_testing_resources
102- source ./load_tests/setup_test_environment.sh
103- export AWS_ACCESS_KEY_ID=""
104- export AWS_SECRET_ACCESS_KEY=""
105- export AWS_SESSION_TOKEN=""
106- # Run load tests on corresponding platform
107- python ./load_tests/load_test.py ${PLATFORM}
108-
10963 else
110- echo "Unsupported BUILD_VERSION: $BUILD_VERSION"
111- echo "Supported versions are: 2, 3"
112- exit 1
64+ # Set stack names based on BUILD_VERSION.
65+ # Do not add BUILD_VERSION for BUILD_VERSION=2 to make load test work with existing resources.
66+ # This can be changed once naming is aligned and resources are resynthesized for BUILD_VERSION=2
67+ if [ "$BUILD_VERSION" = "2" ]; then
68+ export TESTING_RESOURCES_STACK_NAME='load-test-fluent-bit-testing-resources'
69+ export LOG_STORAGE_STACK_NAME='load-test-fluent-bit-log-storage'
70+ export EKS_CLUSTER_NAME='load-test-fluent-bit-eks-cluster'
71+ else
72+ export TESTING_RESOURCES_STACK_NAME="load-test-fluent-bit-testing-resources-v${BUILD_VERSION}"
73+ export LOG_STORAGE_STACK_NAME="load-test-fluent-bit-log-storage-v${BUILD_VERSION}"
74+ export EKS_CLUSTER_NAME="load-test-fluent-bit-eks-cluster-v${BUILD_VERSION}"
75+ fi
76+ echo "Using TESTING_RESOURCES_STACK_NAME: $TESTING_RESOURCES_STACK_NAME"
77+ echo "Using LOG_STORAGE_STACK_NAME: $LOG_STORAGE_STACK_NAME"
78+ echo "Using EKS_CLUSTER_NAME: $EKS_CLUSTER_NAME"
79+
80+ # Execute load test commands (common logic for all supported BUILD_VERSIONs)
81+ if [ "$BUILD_VERSION" = "2" ] || [ "$BUILD_VERSION" = "3" ]; then
82+ # need this for multiline code blocks to raise any errors to codebuild
83+ set -e
84+ echo "Running load tests for AWS for Fluent Bit version $BUILD_VERSION"
85+
86+ # Activate Python virtual environment and install the AWS CDK core dependencies
87+ python -m venv venv
88+ source venv/bin/activate
89+ pip install -r ./load_tests/requirements.txt
90+ if [ "${PLATFORM}" == "EKS" ]; then
91+ aws eks update-kubeconfig --name $EKS_CLUSTER_NAME
92+ fi
93+ CREDS=$(aws sts assume-role --role-arn $LOAD_TEST_CFN_ROLE_ARN --role-session-name load-test-cfn --duration-seconds 3600)
94+ export CREDS
95+ export AWS_ACCESS_KEY_ID=$(echo "${CREDS}" | jq -r '.Credentials.AccessKeyId')
96+ export AWS_SECRET_ACCESS_KEY=$(echo "${CREDS}" | jq -r '.Credentials.SecretAccessKey')
97+ export AWS_SESSION_TOKEN=$(echo "${CREDS}" | jq -r '.Credentials.SessionToken')
98+ # Create and set up related testing resources
99+ python ./load_tests/load_test.py create_testing_resources
100+ source ./load_tests/setup_test_environment.sh
101+ export AWS_ACCESS_KEY_ID=""
102+ export AWS_SECRET_ACCESS_KEY=""
103+ export AWS_SESSION_TOKEN=""
104+ # Run load tests on corresponding platform
105+ python ./load_tests/load_test.py ${PLATFORM}
106+
107+ else
108+ echo "Unsupported BUILD_VERSION: $BUILD_VERSION"
109+ echo "Supported versions are: 2, 3"
110+ exit 1
111+ fi
113112 fi
114113 finally :
115114 # Clear up testing resources
0 commit comments