Skip to content

Commit

Permalink
Update to version v3.2.6
Browse files Browse the repository at this point in the history
### Changed

- Updated version of chartjs fromv v3.0.0 to v4
- Updated version of react from v17 to v18
- Updated version of react-dom from v17 to v18
- Removed moment.js as the library was in maintenance mode. Replaced with built-in javascript date and time 
- Updated Jmeter dependencies and taurus dependencis within the docker image to enhance the security of the docker image
- Updated taurus version from v1.16.27 to v1.16.29

### Fixed

- Bug fix to resolve issue with graph not showing on scheduled tests [#158](#158)
- Bug fix created by changes of the ECS account setting and enabling Tag Resource Authorization as default settings [#162](#162)
- Bug fix to resolve issue with running the tests on OPT-IN regions [#163](#163)
  • Loading branch information
tabdunabi authored Mar 6, 2024
2 parents 78caed5 + ff2d320 commit 8738a6e
Show file tree
Hide file tree
Showing 59 changed files with 1,023 additions and 357 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.6] - 2024-03-06

### Changed

- Updated version of chartjs fromv v3.0.0 to v4
- Updated version of react from v17 to v18
- Updated version of react-dom from v17 to v18
- Removed moment.js as the library was in maintenance mode. Replaced with built-in javascript date and time
- Updated Jmeter dependencies and taurus dependencis within the docker image to enhance the security of the docker image
- Updated taurus version from v1.16.27 to v1.16.29

### Fixed

- Bug fix to resolve issue with graph not showing on scheduled tests [#158](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/158)
- Bug fix created by changes of the ECS account setting and enabling Tag Resource Authorization as default settings [#162](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/162)
- Bug fix to resolve issue with running the tests on OPT-IN regions [#163](https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/163)

## [3.2.5] - 2024-01-11

### Changed
Expand Down
10 changes: 8 additions & 2 deletions NOTICE.txt → NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Distributed Load Testing Reference Architecture
Distributed Load Testing

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License Version 2.0 (the "License"). You may not use this file except
in compliance with the License. A copy of the License is located at http://www.apache.org/licenses/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. See the License for the
specific language governing permissions and limitations under the License.

**********************
THIRD PARTY COMPONENTS
Expand All @@ -25,7 +31,7 @@ bootstrap under the Massachusetts Institute of Technology (MIT) license
bootstrap-icons under the Massachusetts Institute of Technology (MIT) license
brace under the Massachusetts Institute of Technology (MIT) license
chart.js under the Massachusetts Institute of Technology (MIT) license
chartjs-adapter-moment under the Massachusetts Institute of Technology (MIT) license
chartjs-adapter-date-fns under the Massachusetts Institute of Technology (MIT) license
constructs under the Apache License 2.0
eslint under the Massachusetts Institute of Technology (MIT) license
eslint-config-prettier under the Massachusetts Institute of Technology (MIT) license
Expand Down
1 change: 1 addition & 0 deletions VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.6
18 changes: 5 additions & 13 deletions deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ declare -A templates=(
)

cd ${source_dir}/infrastructure
npm run clean
npm install
npm ci

for template in "${!templates[@]}"; do
node_modules/aws-cdk/bin/cdk synth --asset-metadata false --path-metadata false -a "npx ts-node --prefer-ts-exts bin/${template}.ts" > ${templates[$template]}/${template}.template
Expand All @@ -76,9 +75,7 @@ done

# Setup solution utils package
cd ${source_dir}/solution-utils
rm -rf node_modules
npm install --production
rm -rf package-lock.json
npm ci --production

# Creating custom resource resources for both stacks
main_stack_custom_resource_files="index.js node_modules lib/*"
Expand All @@ -90,9 +87,7 @@ declare -a stacks=(
)

cd ${source_dir}/custom-resource
rm -rf node_modules/
npm install --production
rm package-lock.json
npm ci --production
for stack in "${stacks[@]}"; do
cp ${stack}-index.js index.js
files_to_zip=${stack}_stack_custom_resource_files
Expand Down Expand Up @@ -124,9 +119,7 @@ for package in "${packages[@]}"; do
echo "Creating $package deployment package"
echo "------------------------------------------------------------------------------"
cd ${source_dir}/${package}
rm -rf node_modules/
npm install --production
rm package-lock.json
npm ci --production
zip -q -r9 ${build_dist_dir}/${package}.zip *
if [ $? -eq 0 ]
then
Expand Down Expand Up @@ -156,8 +149,7 @@ echo "Building console"
echo "------------------------------------------------------------------------------"
cd ${source_dir}/console
[ -e build ] && rm -r build
[ -e node_modules ] && rm -rf node_modules
npm install
npm ci
npm run build
mkdir ${build_dist_dir}/console
cp -r ./build/* ${build_dist_dir}/console/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM blazemeter/taurus:1.16.27
FROM blazemeter/taurus:1.16.29
# taurus includes python and pip
RUN /usr/bin/python3 -m pip install --upgrade pip
RUN pip install --no-cache-dir awscli
RUN apt-get -y install xmlstarlet bc procps
RUN apt-get -y install --no-install-recommends xmlstarlet bc procps

# Removing selenium and gatling from our image as they are not supported in DLT
RUN rm -rf /root/.bzt/selenium-taurus
Expand All @@ -25,16 +25,34 @@ WORKDIR /usr/local/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/steep
RUN sed -i 's/7.0.4/7.0.7.1/g' Gemfile.lock
RUN gem install activesupport -v 7.0.7.1

# Replacing urllib3, Werkzeug and cryptography with more stable Versions to fix vulnerabilities
# Fixing CVE-2023-36617
WORKDIR /usr/local/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/specifications/default
RUN sed -i 's/0.12.1/0.12.2.0/g' uri-0.12.1.gemspec
RUN mv uri-0.12.1.gemspec uri-0.12.2.gemspec
RUN gem install --default uri -v 0.12.2.0

# Replacing urllib3 with more stable Versions to resolve vulnerabilities
RUN pip install urllib3==2.0.7
RUN pip install Werkzeug==3.0.1
RUN pip install cryptography==41.0.6
RUN rm -rf /root/.bzt/python-packages/3.10.12/urllib3*
RUN rm -rf /root/.bzt/python-packages/3.10.12/werkzeug*
RUN rm -rf /root/.bzt/python-packages/3.10.12/cryptography*
RUN cp -r /usr/local/lib/python3.10/dist-packages/urllib3* /root/.bzt/python-packages/3.10.12/

# Replacing Werkzeug with more stable version to resolve vulnerabilities
RUN pip install Werkzeug==3.0.1
RUN rm -rf /root/.bzt/python-packages/3.10.12/werkzeug*
RUN cp -r /usr/local/lib/python3.10/dist-packages/werkzeug* /root/.bzt/python-packages/3.10.12/

# Replacing cryptography with more stable version to resolve vulnerabilities
RUN pip install cryptography==42.0.5
RUN rm -rf /root/.bzt/python-packages/3.10.12/cryptography*
RUN cp -r /usr/local/lib/python3.10/dist-packages/cryptography* /root/.bzt/python-packages/3.10.12/

# Replacing Pillow with more stable version resolve CVE-2023-50447
RUN rm -rf /root/.local/lib/python3.10/site-packages/Pillow*
RUN pip install --upgrade pillow --target /root/.local/lib/python3.10/site-packages/

# Replaing aiohttp with more stable version to resolve CVE-2024-23334
RUN rm -rf /usr/local/lib/python3.10/dist-packages/aiohttp*
RUN pip install --upgrade aiohttp

WORKDIR /bzt-configs/
ENTRYPOINT ["./load-test.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* batik-bridge v1.14 will be replaced with v1.17
* batik-transcoder v1.14 will be replaced with v1.17
* lets-plot-batik v2.2.1 will be replaced with 4.2.0
* commons-net v3.8.0 will be replaced with v3.9.0
Also jmeter plugins manager will be updated to v1.10 to address CVEs and cmdrunner will be updated to v2.3 to accomodate with plugins manager.
"""
Expand All @@ -29,7 +30,8 @@
"batik-script": "org/apache/xmlgraphics/batik-script/1.17/batik-script-1.17.jar",
"batik-bridge": "org/apache/xmlgraphics/batik-bridge/1.17/batik-bridge-1.17.jar",
"batik-transcoder": "org/apache/xmlgraphics/batik-transcoder/1.17/batik-transcoder-1.17.jar",
"lets-plot-batik": "org/jetbrains/lets-plot/lets-plot-batik/4.2.0/lets-plot-batik-4.2.0.jar"
"lets-plot-batik": "org/jetbrains/lets-plot/lets-plot-batik/4.2.0/lets-plot-batik-4.2.0.jar",
"commons-net": "commons-net/commons-net/3.9.0/commons-net-3.9.0.jar"
}
JMETER_VERSION = "5.5"
JMETER_PLUGINS_MANAGER_VERSION = "1.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ echo "FILE_TYPE:: ${FILE_TYPE}"
echo "PREFIX:: ${PREFIX}"
echo "UUID:: ${UUID}"
echo "LIVE_DATA_ENABLED:: ${LIVE_DATA_ENABLED}"
echo "MAIN_STACK_REGION:: ${MAIN_STACK_REGION}"

sigterm_handler() {
if [ $pypid -ne 0 ]; then
Expand All @@ -22,7 +23,7 @@ sigterm_handler() {
trap 'sigterm_handler' SIGTERM

echo "Download test scenario"
aws s3 cp s3://$S3_BUCKET/test-scenarios/$TEST_ID-$AWS_REGION.json test.json
aws s3 cp s3://$S3_BUCKET/test-scenarios/$TEST_ID-$AWS_REGION.json test.json --region $MAIN_STACK_REGION

# download JMeter jmx file
if [ "$TEST_TYPE" != "simple" ]; then
Expand All @@ -32,9 +33,9 @@ if [ "$TEST_TYPE" != "simple" ]; then
cp $PWD/*.jar $JMETER_LIB_PATH

if [ "$FILE_TYPE" != "zip" ]; then
aws s3 cp s3://$S3_BUCKET/public/test-scenarios/$TEST_TYPE/$TEST_ID.jmx ./
aws s3 cp s3://$S3_BUCKET/public/test-scenarios/$TEST_TYPE/$TEST_ID.jmx ./ --region $MAIN_STACK_REGION
else
aws s3 cp s3://$S3_BUCKET/public/test-scenarios/$TEST_TYPE/$TEST_ID.zip ./
aws s3 cp s3://$S3_BUCKET/public/test-scenarios/$TEST_TYPE/$TEST_ID.zip ./ --region $MAIN_STACK_REGION
unzip $TEST_ID.zip
# only looks for the first jmx file.
JMETER_SCRIPT=`find . -name "*.jmx" | head -n 1`
Expand Down Expand Up @@ -100,7 +101,7 @@ if [ "$TEST_TYPE" != "simple" ]; then
fi

echo "Uploading $p"
aws s3 cp $f $p
aws s3 cp $f $p --region $MAIN_STACK_REGION
done
fi

Expand All @@ -114,11 +115,11 @@ if [ -f /tmp/artifacts/results.xml ]; then
fi

echo "Uploading results, bzt log, and JMeter log, out, and err files"
aws s3 cp /tmp/artifacts/results.xml s3://$S3_BUCKET/results/${TEST_ID}/${PREFIX}-${UUID}-${AWS_REGION}.xml
aws s3 cp /tmp/artifacts/bzt.log s3://$S3_BUCKET/results/${TEST_ID}/bzt-${PREFIX}-${UUID}-${AWS_REGION}.log
aws s3 cp /tmp/artifacts/jmeter.log s3://$S3_BUCKET/results/${TEST_ID}/jmeter-${PREFIX}-${UUID}-${AWS_REGION}.log
aws s3 cp /tmp/artifacts/jmeter.out s3://$S3_BUCKET/results/${TEST_ID}/jmeter-${PREFIX}-${UUID}-${AWS_REGION}.out
aws s3 cp /tmp/artifacts/jmeter.err s3://$S3_BUCKET/results/${TEST_ID}/jmeter-${PREFIX}-${UUID}-${AWS_REGION}.err
aws s3 cp /tmp/artifacts/results.xml s3://$S3_BUCKET/results/${TEST_ID}/${PREFIX}-${UUID}-${AWS_REGION}.xml --region $MAIN_STACK_REGION
aws s3 cp /tmp/artifacts/bzt.log s3://$S3_BUCKET/results/${TEST_ID}/bzt-${PREFIX}-${UUID}-${AWS_REGION}.log --region $MAIN_STACK_REGION
aws s3 cp /tmp/artifacts/jmeter.log s3://$S3_BUCKET/results/${TEST_ID}/jmeter-${PREFIX}-${UUID}-${AWS_REGION}.log --region $MAIN_STACK_REGION
aws s3 cp /tmp/artifacts/jmeter.out s3://$S3_BUCKET/results/${TEST_ID}/jmeter-${PREFIX}-${UUID}-${AWS_REGION}.out --region $MAIN_STACK_REGION
aws s3 cp /tmp/artifacts/jmeter.err s3://$S3_BUCKET/results/${TEST_ID}/jmeter-${PREFIX}-${UUID}-${AWS_REGION}.err --region $MAIN_STACK_REGION
else
echo "An error occurred while the test was running."
fi
7 changes: 3 additions & 4 deletions deployment/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ run_tests() {

if [ $component_name = "solution-utils" ]
then
rm -rf coverage package-lock.json
rm -rf coverage
else
rm -rf coverage node_modules package-lock.json
rm -rf coverage node_modules
fi
}

Expand All @@ -57,7 +57,6 @@ coverage_reports_top_path=$source_dir/test/coverage-reports

#install dependencies
cd $source_dir
npm run clean:all
npm run install:all

#run prettier
Expand Down Expand Up @@ -85,7 +84,6 @@ else
echo "******************************************************************************"
exit 1
fi
npm run clean

# Run unit tests
echo "Running unit tests"
Expand All @@ -101,6 +99,7 @@ declare -a packages=(
"task-canceler"
"task-runner"
"task-status-checker"
"console"
)

for package in "${packages[@]}"; do
Expand Down
12 changes: 6 additions & 6 deletions source/api-services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

const scenarios = require("./lib/scenarios/");
const metrics = require("./lib/metrics/");

const utils = require("solution-utils");
/**
* API Manager Class that gets API path and their method
* and calls the appropriate handler function to handle the request
Expand Down Expand Up @@ -51,10 +50,11 @@ class APIHandler {
// Handle creating test
else data = await scenarios.createTest(config);
if (process.env.SEND_METRIC === "Yes") {
await metrics.send({
testTaskConfigs: config.testTaskConfigs,
testType: config.testType,
fileType: config.fileType,
await utils.sendMetric({
Type: "TaskCreate",
TestType: config.testType,
FileType: config.fileType || (config.testType === "simple" ? "none" : "script"),
TaskCount: config.taskCount,
});
}
return data;
Expand Down
1 change: 1 addition & 0 deletions source/api-services/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

process.env.TZ = "UTC";
module.exports = {
roots: ["<rootDir>/lib"],
testMatch: ["**/*.spec.js"],
Expand Down
Loading

0 comments on commit 8738a6e

Please sign in to comment.