From b1493d99881c76db0c7f7912ed99c342618135ca Mon Sep 17 00:00:00 2001 From: "atlassian-compass[bot]" <89495476+atlassian-compass[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:27:14 +0530 Subject: [PATCH] Added a compass.yml file to manage this repository as a Compass component (#212) * Compass.yml file for config-as-code * chore: linting Signed-off-by: Krishna Waske * chore: linting Signed-off-by: Krishna Waske --------- Signed-off-by: Krishna Waske Co-authored-by: atlassian-compass[bot] <89495476+atlassian-compass[bot]@users.noreply.github.com> Co-authored-by: Krishna Waske --- compass.yml | 22 ++++ samples/cliConfig.json | 2 +- scripts/taskdef/credo-ecs-taskdef.json | 113 ++++++++--------- scripts/taskdef/credo-fargate-taskdef.json | 133 ++++++++++----------- src/cliAgent.ts | 7 +- 5 files changed, 144 insertions(+), 133 deletions(-) create mode 100644 compass.yml diff --git a/compass.yml b/compass.yml new file mode 100644 index 00000000..db63bcaf --- /dev/null +++ b/compass.yml @@ -0,0 +1,22 @@ +name: credo-controller +id: ari:cloud:compass:6095931c-8137-4ae1-822a-2d7411835fc7:component/9029b47a-062e-4e25-a761-a2c0fc9ebd98/b6016bde-79c2-4d3f-84cf-b25f27bc50c7 +description: Controller App for Aries Framework JavaScript REST Extension +configVersion: 1 +typeId: SERVICE +ownerId: ari:cloud:identity::team/6fe50e36-8efb-47a6-aab5-ea47bd10ec4e +fields: + tier: 4 +links: + - name: null + type: REPOSITORY + url: https://github.com/credebl/credo-controller +relationships: + DEPENDS_ON: [] +labels: + - aries + - aries-framework-javascript + - decentralized-identity + - language:typescript + - self-sovereign-identity + - source:github +customFields: null diff --git a/samples/cliConfig.json b/samples/cliConfig.json index 7d2a40e1..b5ff24c9 100644 --- a/samples/cliConfig.json +++ b/samples/cliConfig.json @@ -43,4 +43,4 @@ "rpcUrl": "https://rpc-amoy.polygon.technology", "fileServerUrl": "https://schema.credebl.id", "fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk" -} \ No newline at end of file +} diff --git a/scripts/taskdef/credo-ecs-taskdef.json b/scripts/taskdef/credo-ecs-taskdef.json index d05cf562..c584194e 100644 --- a/scripts/taskdef/credo-ecs-taskdef.json +++ b/scripts/taskdef/credo-ecs-taskdef.json @@ -1,66 +1,59 @@ { - "family": "${FAMILY}", - "containerDefinitions": [ + "family": "${FAMILY}", + "containerDefinitions": [ + { + "name": "Platform-admin", + "image": "%REPOSITORY_URI%:CREDO_v_%BUILD_NUMBER%", + "cpu": 154, + "memory": 307, + "portMappings": [ { - "name": "Platform-admin", - "image": "%REPOSITORY_URI%:CREDO_v_%BUILD_NUMBER%", - "cpu": 154, - "memory": 307, - "portMappings": [ - { - "containerPort": 8001, - "hostPort": 8001, - "protocol": "tcp" - }, - { - "containerPort": 9001, - "hostPort": 9001, - "protocol": "tcp" - } - ], - "essential": true, - "command": [ - "--auto-accept-connections", - "--config", - "/config.json" - ], - "environment": [ - { - "name": "AFJ_REST_LOG_LEVEL", - "value": "1" - } - ], - "environmentFiles": [ - { - "value": "${S3_ARN}", - "type": "s3" - } - ], - "mountPoints": [ - { - "sourceVolume": "config", - "containerPath": "/config.json", - "readOnly": true - } - ], - "volumesFrom": [], - "ulimits": [] + "containerPort": 8001, + "hostPort": 8001, + "protocol": "tcp" + }, + { + "containerPort": 9001, + "hostPort": 9001, + "protocol": "tcp" + } + ], + "essential": true, + "command": ["--auto-accept-connections", "--config", "/config.json"], + "environment": [ + { + "name": "AFJ_REST_LOG_LEVEL", + "value": "1" + } + ], + "environmentFiles": [ + { + "value": "${S3_ARN}", + "type": "s3" } - - ], - "executionRoleArn": "arn:aws:iam::${ACCOUNT_ID}:role/ecsTaskExecutionRole", - "placementConstraints": [], - "requiresCompatibilities": [ - "EC2" - ], - "cpu": "154", - "memory": "307", - "volumes": [ + ], + "mountPoints": [ { - "name": "config", - "host": { - "sourcePath": "${SourcePath}" - } + "sourceVolume": "config", + "containerPath": "/config.json", + "readOnly": true } - ] + ], + "volumesFrom": [], + "ulimits": [] + } + ], + "executionRoleArn": "arn:aws:iam::${ACCOUNT_ID}:role/ecsTaskExecutionRole", + "placementConstraints": [], + "requiresCompatibilities": ["EC2"], + "cpu": "154", + "memory": "307", + "volumes": [ + { + "name": "config", + "host": { + "sourcePath": "${SourcePath}" + } + } + ] } diff --git a/scripts/taskdef/credo-fargate-taskdef.json b/scripts/taskdef/credo-fargate-taskdef.json index bf3a4a59..8e218216 100644 --- a/scripts/taskdef/credo-fargate-taskdef.json +++ b/scripts/taskdef/credo-fargate-taskdef.json @@ -1,76 +1,69 @@ { - "family": "${FAMILY}", - "containerDefinitions": [ + "family": "${FAMILY}", + "containerDefinitions": [ + { + "name": "Platform-admin", + "image": "%REPOSITORY_URI%:CREDO_v_%BUILD_NUMBER%", + "cpu": 0, + "portMappings": [ { - "name": "Platform-admin", - "image": "%REPOSITORY_URI%:CREDO_v_%BUILD_NUMBER%", - "cpu": 0, - "portMappings": [ - { - "containerPort": 8004, - "hostPort": 8004, - "protocol": "tcp" - }, - { - "containerPort": 9004, - "hostPort": 9004, - "protocol": "tcp" - } - ], - "essential": true, - "command": [ - "--auto-accept-connections", - "--config", - "/config/${CONFIG_FILE}" - ], - "environment": [ - { - "name": "AFJ_REST_LOG_LEVEL", - "value": "1" - } - ], - "environmentFiles": [ - { - "value": "${S3_ARN}", - "type": "s3" - } - ], - "mountPoints": [ - { - "sourceVolume": "config", - "containerPath": "/config", - "readOnly": false - } - ], - "volumesFrom": [], - "ulimits": [], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": "/ecs/${FAMILY}", - "awslogs-create-group": "true", - "awslogs-region": "ap-south-1", - "awslogs-stream-prefix": "ecs" - } - } + "containerPort": 8004, + "hostPort": 8004, + "protocol": "tcp" + }, + { + "containerPort": 9004, + "hostPort": 9004, + "protocol": "tcp" } - - ], - "executionRoleArn": "arn:aws:iam::${ACCOUNT_ID}:role/ecsTaskExecutionRole", - "networkMode": "awsvpc", - "placementConstraints": [], - "requiresCompatibilities": [ - "FARGATE" - ], - "cpu": "1024", - "memory": "2048", - "volumes": [ + ], + "essential": true, + "command": ["--auto-accept-connections", "--config", "/config/${CONFIG_FILE}"], + "environment": [ + { + "name": "AFJ_REST_LOG_LEVEL", + "value": "1" + } + ], + "environmentFiles": [ { - "name": "config", - "efsVolumeConfiguration": { - "fileSystemId": "${EFS}", - "rootDirectory": "/" - } + "value": "${S3_ARN}", + "type": "s3" } - ] + ], + "mountPoints": [ + { + "sourceVolume": "config", + "containerPath": "/config", + "readOnly": false + } + ], + "volumesFrom": [], + "ulimits": [], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-group": "/ecs/${FAMILY}", + "awslogs-create-group": "true", + "awslogs-region": "ap-south-1", + "awslogs-stream-prefix": "ecs" + } + } + } + ], + "executionRoleArn": "arn:aws:iam::${ACCOUNT_ID}:role/ecsTaskExecutionRole", + "networkMode": "awsvpc", + "placementConstraints": [], + "requiresCompatibilities": ["FARGATE"], + "cpu": "1024", + "memory": "2048", + "volumes": [ + { + "name": "config", + "efsVolumeConfiguration": { + "fileSystemId": "${EFS}", + "rootDirectory": "/" + } + } + ] } diff --git a/src/cliAgent.ts b/src/cliAgent.ts index c3e4a075..1db8a874 100644 --- a/src/cliAgent.ts +++ b/src/cliAgent.ts @@ -189,8 +189,11 @@ const getModules = ( questionAnswer: new QuestionAnswerModule(), polygon: new PolygonModule({ - didContractAddress: didRegistryContractAddress ? didRegistryContractAddress : (process.env.DID_CONTRACT_ADDRESS as string), - schemaManagerContractAddress: schemaManagerContractAddress || (process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string), + didContractAddress: didRegistryContractAddress + ? didRegistryContractAddress + : (process.env.DID_CONTRACT_ADDRESS as string), + schemaManagerContractAddress: + schemaManagerContractAddress || (process.env.SCHEMA_MANAGER_CONTRACT_ADDRESS as string), fileServerToken: fileServerToken ? fileServerToken : (process.env.FILE_SERVER_TOKEN as string), rpcUrl: rpcUrl ? rpcUrl : (process.env.RPC_URL as string), serverUrl: fileServerUrl ? fileServerUrl : (process.env.SERVER_URL as string),