Skip to content

Commit 211f51f

Browse files
authored
Merge pull request #162 from ts-amz/fix_fleet_sim
fix(simulation-manager): applied change - fixed, several minor issues…
2 parents 8bfacd8 + 0b8dcb7 commit 211f51f

File tree

14 files changed

+116
-56
lines changed

14 files changed

+116
-56
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@cdf/installer",
5+
"comment": "updated jmeter version",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@cdf/installer",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@cdf/simulation-launcher",
5+
"comment": "updated java version and jmeter version",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@cdf/simulation-launcher",
10+
"email": "[email protected]"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@cdf/simulation-manager",
5+
"comment": "fixed minor issues in the runService and updated documentation",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@cdf/simulation-manager",
10+
"email": "[email protected]"
11+
}

source/infrastructure/cloudformation/cfn-networking.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,19 @@ Resources:
265265
From: 1024
266266
To: 65535
267267

268+
PrivateSubnetMqttOutboundRule:
269+
Condition: Deploy
270+
Type: AWS::EC2::NetworkAclEntry
271+
Properties:
272+
NetworkAclId: !Ref PrivateSubnetNacl
273+
RuleNumber: 103
274+
Protocol: 6
275+
Egress: true
276+
RuleAction: allow
277+
CidrBlock: 0.0.0.0/0
278+
PortRange:
279+
From: 8883
280+
To: 8883
268281

269282
PublicSubnetOne:
270283
Condition: Deploy

source/packages/services/installer/src/commands/modules/service/fleetSimulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class FleetSimulatorInstaller implements RestModule {
9696
propertyName: 's3Prefix',
9797
},
9898
{
99-
defaultConfiguration: '/opt/apache-jmeter-5.1.1/bin/cdf',
99+
defaultConfiguration: '/opt/apache-jmeter-5.4.3/bin/cdf',
100100
question: 'Local location where to store jmeter execution results',
101101
propertyName: 'runnerDataDir',
102102
},

source/packages/services/simulation-launcher/infrastructure/cfn-simulation-launcher.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@ Parameters:
5353
Description: The KMS key ID used to encrypt the SNS topic
5454
Type: String
5555

56-
LoggingLevel:
57-
Description: Application logging level
58-
Type: String
59-
Default: info
60-
AllowedValues:
61-
- error
62-
- warn
63-
- info
64-
- debug
65-
- silly
66-
67-
Conditions:
68-
LoggingLevelProvided: !Not [!Equals [!Ref LoggingLevel, '']]
69-
7056
Resources:
7157
ECSCluster:
7258
Type: AWS::ECS::Cluster
@@ -198,7 +184,7 @@ Resources:
198184
- 's3:Get*'
199185
- 's3:List*'
200186
- 's3:Put*'
201-
Resource: 'arn:aws:s3:::${BucketName}/*'
187+
Resource: !Sub 'arn:aws:s3:::${BucketName}/*'
202188
- Sid: lambda
203189
Action:
204190
- lambda:InvokeFunction
@@ -308,7 +294,6 @@ Resources:
308294
AWS_ECS_CLUSTERID: !Ref ECSCluster
309295
AWS_ECS_SECURITYGROUPID: !Ref FargateContainerSecurityGroup
310296
AWS_ECS_TASKDEFINITIONARN: !Ref JMeterTaskDefinition
311-
LOGGING_LEVEL: !If [LoggingLevelProvided, !Ref LoggingLevel, !Ref AWS::NoValue]
312297
Tracing: Active
313298
DependsOn:
314299
- LambdaExecutionRole

source/packages/services/simulation-launcher/src/containers/jmeter/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ARG AWSCLI_VERSION="1.16.278"
2020
ARG JMETER_PLUGINS_MANAGER_VERSION="1.3"
2121
ARG CMDRUNNER_VERSION="2.2"
2222
ARG JSON_LIB_VERSION="2.4"
23-
ARG JSON_LIB_FULL_VERSION="${JSON_LIB_VERSION}-jdk15"
23+
ARG JSON_LIB_FULL_VERSION="${JSON_LIB_VERSION}-jdk11"
2424

2525
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
2626
ENV JMETER_BIN ${JMETER_HOME}/bin
@@ -34,17 +34,20 @@ RUN yum install -y \
3434
python \
3535
python-devel \
3636
python-pip \
37-
java-1.8.0-openjdk \
37+
openssl.x86_64 \
3838
&& pip install awscli==$AWSCLI_VERSION --upgrade --user \
3939
&& yum remove -y python-pip \
4040
&& yum clean all
4141

42+
# install openJDK11
43+
RUN amazon-linux-extras install java-openjdk11
44+
4245
# Install jmeter
4346
RUN yum update -y \
4447
&& yum upgrade -y \
4548
&& yum install -y ca-certificates \
4649
&& update-ca-trust \
47-
&& yum install -y openjdk8-jre tzdata curl unzip bash nss gzip tar\
50+
&& yum install -y tzdata curl unzip bash nss gzip tar zip\
4851
&& mkdir -p /tmp/dependencies \
4952
&& curl -L --silent ${JMETER_DOWNLOAD_URL} > /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz \
5053
&& mkdir -p /opt \

source/packages/services/simulation-manager/docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CORS_ORIGIN=*
1616
# Application logging level. Set to (in order) error, warn, info, verbose, debug or silly.
1717
LOGGING_LEVEL=info
1818
# local location where to store jmeter execution results
19-
RUNNERS_DATADIR=/opt/apache-jmeter-5.1.1/bin/cdf
19+
RUNNERS_DATADIR=/opt/apache-jmeter-5.4.3/bin/cdf
2020
# Container allocated memory size. Tune for best performance.
2121
RUNNERS_MEMORY=2048
2222
# Container allocated cpu. Tune for best performance.

source/packages/services/simulation-manager/docs/swagger.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ paths:
4949
location:
5050
schema:
5151
type: 'string'
52+
/simulations/{simulation-id}/runs:
53+
post:
54+
tags:
55+
- 'Runs'
56+
summary: 'Create a run for the simulation'
57+
operationId: 'CreateRun'
58+
requestBody:
59+
$ref: '#/components/requestBodies/Run'
60+
response:
61+
204:
62+
description: 'success'
63+
headers:
64+
location:
65+
schema:
66+
type: 'string'
5267

5368
components:
5469
requestBodies:
@@ -57,6 +72,11 @@ components:
5772
application/vnd.aws-cdf-v1.0+json:
5873
schema:
5974
$ref: '#/components/schemas/Simulation'
75+
Run:
76+
content:
77+
application/vnd.aws-cdf-v1.0+json:
78+
schema:
79+
$ref: '#/components/schemas/Run'
6080

6181
schemas:
6282
Simulation:
@@ -96,6 +116,27 @@ components:
96116
description: 'A list of different task that will be executed by the simulator. the Task names are dynamic and can be modified as needed'
97117
additionalProperties:
98118
$ref: '#/components/schemas/Task'
119+
Run:
120+
type: 'object'
121+
properties:
122+
deviceCount:
123+
type: 'integer'
124+
format: 'int32'
125+
default: 100
126+
required: true
127+
description: 'the number of devices to simulate'
128+
simulationId:
129+
type: 'string'
130+
description: 'the id of the simulation you are creating runs against'
131+
required: true
132+
id:
133+
type: 'string'
134+
description: 'the id of the run'
135+
required: false
136+
status:
137+
type: 'string'
138+
description: 'the status of the run'
139+
required: false
99140

100141
Task:
101142
type: 'object'

source/packages/services/simulation-manager/infrastructure/cfn-simulation-manager.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -114,30 +114,12 @@ Parameters:
114114
- 'false'
115115
MinLength: 1
116116

117-
CorsOrigin:
118-
Description: Sets the Access-Control-Allow-Origin response header to indicate whether the response can be shared with requesting code from the given origin.
119-
Type: String
120-
Default: ''
121-
122-
LoggingLevel:
123-
Description: Application logging level
124-
Type: String
125-
Default: info
126-
AllowedValues:
127-
- error
128-
- warn
129-
- info
130-
- debug
131-
- silly
132-
133117
Conditions:
134118
DeployInVPC: !Not [!Equals [!Ref VpcId, 'N/A']]
135119
DeployWithLambdaAuth:
136120
!Or [!Equals [!Ref AuthType, 'LambdaRequest'], !Equals [!Ref AuthType, 'LambdaToken']]
137121
KmsKeyIdProvided: !Not [!Equals [!Ref KmsKeyId, '']]
138122
EnableApiGatewayAccessLogs: !Equals [!Ref EnableApiGatewayAccessLogs, 'true']
139-
CorsOriginProvided: !Not [!Equals [!Ref CorsOrigin, '']]
140-
LoggingLevelProvided: !Not [!Equals [!Ref LoggingLevel, '']]
141123

142124
Resources:
143125
ApiGatewayApi:
@@ -253,8 +235,6 @@ Resources:
253235
AWS_SNS_TOPICS_LAUNCH: !Ref SimulationLauncherSnsTopic
254236
AWS_IOT_HOST: !GetAtt IotEndpoint.address
255237
ASSETLIBRARY_API_FUNCTION_NAME: !Ref AssetLibraryFunctionName
256-
CORS_ORIGIN: !If [CorsOriginProvided, !Ref CorsOrigin, !Ref AWS::NoValue]
257-
LOGGING_LEVEL: !If [LoggingLevelProvided, !Ref LoggingLevel, !Ref AWS::NoValue]
258238
Tracing: Active
259239

260240
VpcConfig:

0 commit comments

Comments
 (0)