Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a compass.yml file to manage this repository as a Compass component #212

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions compass.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion samples/cliConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"rpcUrl": "https://rpc-amoy.polygon.technology",
"fileServerUrl": "https://schema.credebl.id",
"fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk"
}
}
113 changes: 53 additions & 60 deletions scripts/taskdef/credo-ecs-taskdef.json
Original file line number Diff line number Diff line change
@@ -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}"
}
}
]
}
133 changes: 63 additions & 70 deletions scripts/taskdef/credo-fargate-taskdef.json
Original file line number Diff line number Diff line change
@@ -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": "/"
}
}
]
}
7 changes: 5 additions & 2 deletions src/cliAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@

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),
Expand Down Expand Up @@ -413,7 +416,7 @@
// instead use the existin JWT token
// if JWT token is not found, create/generate a new token and save in genericRecords
// next time, the same token should be used - instead of creating a new token on every restart event of the agent
token = jwt.sign({ agentInfo: 'agentInfo' }, secretKeyInfo)

Check warning on line 419 in src/cliAgent.ts

View workflow job for this annotation

GitHub Actions / Validate

Caution: `jwt` also has a named export `sign`. Check if you meant to write `import {sign} from 'jsonwebtoken'` instead
await agent.genericRecords.save({
content: {
secretKey: secretKeyInfo,
Expand Down
Loading