Skip to content

Commit c3d907d

Browse files
authored
Update to Version v3.3.3 (#221)
1 parent 667b0b1 commit c3d907d

38 files changed

+244
-114
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.3.3] - 2024-11-22
9+
10+
### Security
11+
12+
- Update `cross-spawn` to mitigate [CVE-2024-21538]
13+
- Update `Werzeug` to mitigate [CVE-2024-49767]
14+
15+
### Fixed
16+
17+
- Update tika-core to v3.0.0 to resolve [https://github.com/aws-solutions/distributed-load-testing-on-aws/issues/214]
18+
19+
### Updated
20+
21+
- Updates on metrics collection process
22+
823
## [3.3.2] - 2024-11-01
924

1025
### Security

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.2
1+
3.3.3

deployment/ecr/distributed-load-testing-on-aws-load-tester/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM blazemeter/taurus:1.16.34
22
# taurus includes python and pip
33
RUN /usr/bin/python3 -m pip install --upgrade pip
44
RUN pip install --no-cache-dir awscli
5-
RUN apt-get -y install --no-install-recommends xmlstarlet bc procps
5+
RUN apt-get -y install --no-install-recommends xmlstarlet bc procps jq
66

77
# Removing selenium and gatling from our image as they are not supported in DLT
88
RUN rm -rf /root/.bzt/selenium-taurus
@@ -32,7 +32,7 @@ RUN rm -rf /root/.bzt/python-packages/3.10.12/urllib3*
3232
RUN cp -r /usr/local/lib/python3.10/dist-packages/urllib3* /root/.bzt/python-packages/3.10.12/
3333

3434
# Replacing Werkzeug with more stable version to resolve vulnerabilities
35-
RUN pip install Werkzeug==3.0.3
35+
RUN pip install Werkzeug==3.0.6
3636
RUN rm -rf /root/.bzt/python-packages/3.10.12/werkzeug*
3737
RUN cp -r /usr/local/lib/python3.10/dist-packages/werkzeug* /root/.bzt/python-packages/3.10.12/
3838

deployment/ecr/distributed-load-testing-on-aws-load-tester/jar_updater.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* batik-transcoder v1.14 will be replaced with v1.17
1818
* lets-plot-batik v2.2.1 will be replaced with 4.2.0
1919
* commons-net v3.8.0 will be replaced with v3.9.0
20-
* tika-core v1.28.3 will be replaced with v2.9.2
20+
* tika-core v1.28.3 will be replaced with v3.0.0
2121
* json-path v2.7.0 will be replaced with v2.9.0
2222
* dnsjava v2.1.9 will be replaced with v3.6.1
2323
@@ -35,7 +35,7 @@
3535
"batik-transcoder": "org/apache/xmlgraphics/batik-transcoder/1.17/batik-transcoder-1.17.jar",
3636
"lets-plot-batik": "org/jetbrains/lets-plot/lets-plot-batik/4.2.0/lets-plot-batik-4.2.0.jar",
3737
"commons-net": "commons-net/commons-net/3.9.0/commons-net-3.9.0.jar",
38-
"tika-core": "org/apache/tika/tika-core/2.9.2/tika-core-2.9.2.jar",
38+
"tika-core": "org/apache/tika/tika-core/3.0.0/tika-core-3.0.0.jar",
3939
"json-path": "com/jayway/jsonpath/json-path/2.9.0/json-path-2.9.0.jar",
4040
"dnsjava": "dnsjava/dnsjava/3.6.1/dnsjava-3.6.1.jar"
4141
}

deployment/ecr/distributed-load-testing-on-aws-load-tester/load-test.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ echo "UUID:: ${UUID}"
1212
echo "LIVE_DATA_ENABLED:: ${LIVE_DATA_ENABLED}"
1313
echo "MAIN_STACK_REGION:: ${MAIN_STACK_REGION}"
1414

15+
cat /proc/self/cgroup
16+
TASK_ID=$(cat /proc/self/cgroup | grep -oE '[a-f0-9]{32}' | head -n 1)
17+
echo $TASK_ID
18+
1519
sigterm_handler() {
1620
if [ $pypid -ne 0 ]; then
1721
echo "container received SIGTERM."
@@ -146,6 +150,23 @@ if [ "$TEST_TYPE" != "simple" ]; then
146150
fi
147151

148152
if [ -f /tmp/artifacts/results.xml ]; then
153+
154+
# Insert the Task ID at the same level as <FinalStatus>
155+
curl -s $ECS_CONTAINER_METADATA_URI_V4/task
156+
Task_CPU=$(curl -s $ECS_CONTAINER_METADATA_URI_V4/task | jq '.Limits.CPU')
157+
Task_Memory=$(curl -s $ECS_CONTAINER_METADATA_URI_V4/task | jq '.Limits.Memory')
158+
START_TIME=$(curl -s "$ECS_CONTAINER_METADATA_URI_V4/task" | jq -r '.Containers[0].StartedAt')
159+
# Convert start time to seconds since epoch
160+
START_TIME_EPOCH=$(date -d "$START_TIME" +%s)
161+
# Calculate elapsed time in seconds
162+
CURRENT_TIME_EPOCH=$(date +%s)
163+
ECS_DURATION=$((CURRENT_TIME_EPOCH - START_TIME_EPOCH))
164+
165+
xmlstarlet ed -P -L -s "/FinalStatus" -t elem -n "TaskId" -v "$TASK_ID" /tmp/artifacts/results.xml
166+
xmlstarlet ed -P -L -s "/FinalStatus" -t elem -n "TaskCPU" -v "$Task_CPU" /tmp/artifacts/results.xml
167+
xmlstarlet ed -P -L -s "/FinalStatus" -t elem -n "TaskMemory" -v "$Task_Memory" /tmp/artifacts/results.xml
168+
xmlstarlet ed -P -L -s "/FinalStatus" -t elem -n "ECSDuration" -v "$ECS_DURATION" /tmp/artifacts/results.xml
169+
149170
echo "Validating Test Duration"
150171
TEST_DURATION=`xmlstarlet sel -t -v "/FinalStatus/TestDuration" /tmp/artifacts/results.xml`
151172

source/api-services/index.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ class APIHandler {
2828
throw this.errorMsg;
2929
}
3030

31+
async sendMetrics(config, data) {
32+
if (process.env.SEND_METRIC === "Yes") {
33+
let taskCountObj = {};
34+
for (const testTaskConfig of config.testTaskConfigs) {
35+
taskCountObj[testTaskConfig.region] = testTaskConfig.taskCount;
36+
}
37+
await utils.sendMetric({
38+
Type: "TestCreate",
39+
TestType: config.testType,
40+
FileType: config.fileType || (config.testType === "simple" ? "none" : "script"),
41+
TaskCountPerRegion: taskCountObj,
42+
TestId: data.testId,
43+
TestScheduleStep: config.scheduleStep,
44+
HoldFor: config.testScenario.execution[0]["hold-for"],
45+
RampUp: config.testScenario.execution[0]["ramp-up"],
46+
CronValue: config.cronValue,
47+
TestEventBridgeScheduled: config.eventBridge,
48+
});
49+
}
50+
}
3151
// Handle the /scenarios endpoint
3252
async handleScenarios(config, queryParams, body, functionName, functionArn) {
3353
let data;
@@ -53,18 +73,7 @@ class APIHandler {
5373
}
5474
// Handle creating test
5575
else data = await scenarios.createTest(config, functionName);
56-
if (process.env.SEND_METRIC === "Yes") {
57-
await utils.sendMetric({
58-
Type: "TaskCreate",
59-
TestType: config.testType,
60-
FileType: config.fileType || (config.testType === "simple" ? "none" : "script"),
61-
TaskCount: config.taskCount,
62-
TestId: data.testId,
63-
TestScheduleStep: config.scheduleStep,
64-
CronValue: config.cronValue,
65-
TestEventBridgeScheduled: config.eventBridge,
66-
});
67-
}
76+
await this.sendMetrics(config, data);
6877
return data;
6978
default:
7079
throw this.errorMsg;

source/api-services/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/api-services/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api-services",
3-
"version": "3.3.2",
3+
"version": "3.3.3",
44
"description": "REST API micro services",
55
"repository": {
66
"type": "git",

source/console/package-lock.json

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/console/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "distributed-load-testing-on-aws-ui",
3-
"version": "3.3.2",
3+
"version": "3.3.3",
44
"private": true,
55
"license": "Apache-2.0",
66
"author": {

source/custom-resource/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/custom-resource/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "custom-resource",
3-
"version": "3.3.2",
3+
"version": "3.3.3",
44
"description": "cfn custom resources for distributed load testing on AWS workflow",
55
"repository": {
66
"type": "git",

source/infrastructure/lib/back-end/step-functions.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
WaitTime,
1616
JsonPath,
1717
DefinitionBody,
18+
TaskInput,
1819
} from "aws-cdk-lib/aws-stepfunctions";
1920
import { LambdaInvoke } from "aws-cdk-lib/aws-stepfunctions-tasks";
2021
import { Aws, CfnResource, Duration } from "aws-cdk-lib";
@@ -61,6 +62,16 @@ export class TaskRunnerStepFunctionConstruct extends Construct {
6162
const mapEnd = new Pass(this, "Map End");
6263
const parseResult = new LambdaInvoke(this, "Parse result", {
6364
lambdaFunction: props.resultsParser,
65+
payload: TaskInput.fromObject({
66+
"testTaskConfig.$": "$.testTaskConfig",
67+
"testId.$": "$.testId",
68+
"testType.$": "$.testType",
69+
"fileType.$": "$.fileType",
70+
"showLive.$": "$.showLive",
71+
"testDuration.$": "$.testDuration",
72+
"prefix.$": "$.prefix",
73+
"executionStart.$": "$$.Execution.StartTime",
74+
}),
6475
});
6576
parseResult.next(done);
6677

source/infrastructure/package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/infrastructure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "distributed-load-testing-on-aws-infrastructure",
3-
"version": "3.3.2",
3+
"version": "3.3.3",
44
"author": {
55
"name": "Amazon Web Services",
66
"url": "https://aws.amazon.com/solutions"

source/infrastructure/test/__snapshots__/distributed-load-testing-on-aws-stack.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4600,7 +4600,7 @@ exports[`Distributed Load Testing stack test 1`] = `
46004600
"Arn",
46014601
],
46024602
},
4603-
"","Payload.$":"$"}},"Done":{"Type":"Succeed"}}}",
4603+
"","Payload":{"testTaskConfig.$":"$.testTaskConfig","testId.$":"$.testId","testType.$":"$.testType","fileType.$":"$.fileType","showLive.$":"$.showLive","testDuration.$":"$.testDuration","prefix.$":"$.prefix","executionStart.$":"$$.Execution.StartTime"}}},"Done":{"Type":"Succeed"}}}",
46044604
],
46054605
],
46064606
},

source/infrastructure/test/__snapshots__/step-functions.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ exports[`DLT API Test 1`] = `
121121
"Arn",
122122
],
123123
},
124-
"","Payload.$":"$"}},"Done":{"Type":"Succeed"}}}",
124+
"","Payload":{"testTaskConfig.$":"$.testTaskConfig","testId.$":"$.testId","testType.$":"$.testType","fileType.$":"$.fileType","showLive.$":"$.showLive","testDuration.$":"$.testDuration","prefix.$":"$.prefix","executionStart.$":"$$.Execution.StartTime"}}},"Done":{"Type":"Succeed"}}}",
125125
],
126126
],
127127
},

source/integration-tests/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)