Skip to content

Commit

Permalink
Merge branch 'feat/implement-nats-cluster' of github.com:Bhutan-NDI/n…
Browse files Browse the repository at this point in the history
…gotag-platform into pipeline-implementation
  • Loading branch information
Sheetal-ayanworks committed Jul 2, 2024
2 parents eb7d033 + 573c3b6 commit 8a15079
Show file tree
Hide file tree
Showing 58 changed files with 161 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qa-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Build and deploy AGENT app to QA ECS
on:
push:
tags:
- 'qa-agent-service*'
- 'qa*'

env:
ECR_IMAGE_TAG: "AGENT_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-api-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy API-GATEWAY app to QA ECS
on:
push:
tags:
- 'qa-api-gateway*'
- 'qa*'

env:
ECR_IMAGE_TAG: "API-GATEWAY_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-connection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy CONNECTION app to QA ECS
on:
push:
tags:
- 'qa-connection*'
- 'qa*'

env:
ECR_IMAGE_TAG: "CONNECTION_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-ecosystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy ECOSYSTEM app to QA ECS
on:
push:
tags:
- 'qa-ecosystem*'
- 'qa'

env:
ECR_IMAGE_TAG: "ECOSYSTEM_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-issuance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Build and deploy ISSUANCE app to QA ECS
on:
push:
tags:
- 'qa-issuance*'
- 'qa*'

env:
ECR_IMAGE_TAG: "ISSUANCE_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-ledger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy LEDGER app to QA ECS
on:
push:
tags:
- 'qa-ledger*'
- 'qa*'

env:
ECR_IMAGE_TAG: "LEDGER_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy NOTIFICATION app to QA ECS
on:
push:
tags:
- 'qa-notification*'
- 'qa*'

env:
ECR_IMAGE_TAG: "NOTIFICATION_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-organization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy ORGANIZATION app to QA ECS
on:
push:
tags:
- 'qa-organization*'
- 'qa*'

env:
ECR_IMAGE_TAG: "ORGANIZATION_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy USER app to QA ECS
on:
push:
tags:
- 'qa-user*'
- 'qa*'

env:
ECR_IMAGE_TAG: "USER_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-utility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy UTILITY app to QA ECS
on:
push:
tags:
- 'qa-utility*'
- 'qa*'

env:
ECR_IMAGE_TAG: "UTILITY_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy VERIFICATION app to QA ECS
on:
push:
tags:
- 'qa-verification*'
- 'qa*'

env:
ECR_IMAGE_TAG: "VERIFICATION_V_${{ github.run_number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-webhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and deploy WEBHOOK app to QA ECS
on:
push:
tags:
- 'qa-webhook*'
- 'qa*'

env:
ECR_IMAGE_TAG: "WEBHOOK_V_${{ github.run_number }}"
Expand Down
3 changes: 2 additions & 1 deletion apps/agent-provisioning/src/agent-provisioning.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { AgentProvisioningService } from './agent-provisioning.service';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { ConfigModule } from '@nestjs/config';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';
@Module({
imports: [
ConfigModule.forRoot(),
ClientsModule.register([
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.AGENT_PROVISIONING_NKEY_SEED)
options: getNatsOptions(CommonConstants.AGENT_PROVISIONING, process.env.AGENT_PROVISIONING_NKEY_SEED)

}
])
Expand Down
3 changes: 2 additions & 1 deletion apps/agent-provisioning/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { Logger } from '@nestjs/common';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { AgentProvisioningModule } from './agent-provisioning.module';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';
const logger = new Logger();

async function bootstrap(): Promise<void> {

const app = await NestFactory.createMicroservice<MicroserviceOptions>(AgentProvisioningModule, {
transport: Transport.NATS,
options: getNatsOptions(process.env.AGENT_PROVISIONING_NKEY_SEED)
options: getNatsOptions(CommonConstants.AGENT_PROVISIONING, process.env.AGENT_PROVISIONING_NKEY_SEED)
});
app.useGlobalFilters(new HttpExceptionFilter());

Expand Down
3 changes: 2 additions & 1 deletion apps/agent-service/src/agent-service.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ConnectionService } from 'apps/connection/src/connection.service';
import { ConnectionRepository } from 'apps/connection/src/connection.repository';
import { CacheModule } from '@nestjs/cache-manager';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -18,7 +19,7 @@ import { getNatsOptions } from '@credebl/common/nats.config';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.AGENT_SERVICE_NKEY_SEED)
options: getNatsOptions(CommonConstants.AGENT_SERVICE, process.env.AGENT_SERVICE_NKEY_SEED)
}
]),
CommonModule,
Expand Down
2 changes: 1 addition & 1 deletion apps/agent-service/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function bootstrap(): Promise<void> {

const app = await NestFactory.createMicroservice<MicroserviceOptions>(AgentServiceModule, {
transport: Transport.NATS,
options: getNatsOptions(process.env.AGENT_SERVICE_NKEY_SEED)
options: getNatsOptions(CommonConstants.AGENT_SERVICE, process.env.AGENT_SERVICE_NKEY_SEED)

});
app.useGlobalFilters(new HttpExceptionFilter());
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/agent-service/agent-service.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ConfigModule } from '@nestjs/config';
import { AgentController } from './agent-service.controller';
import { AgentService } from './agent-service.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -16,7 +17,7 @@ import { getNatsOptions } from '@credebl/common/nats.config';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.AGENT_SERVICE, process.env.API_GATEWAY_NKEY_SEED)

},
CommonModule
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as redisStore from 'cache-manager-redis-store';
import { WebhookModule } from './webhook/webhook.module';
import { UtilitiesModule } from './utilities/utilities.module';
import { NotificationModule } from './notification/notification.module';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -35,7 +36,7 @@ import { NotificationModule } from './notification/notification.module';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.API_GATEWAY_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
}
]),
AgentModule,
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/authz/authz.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { VerificationService } from '../verification/verification.service';
import { EcosystemService } from '../ecosystem/ecosystem.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { OrganizationService } from '../organization/organization.service';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -31,7 +32,7 @@ import { OrganizationService } from '../organization/organization.service';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.AUTH_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
},
CommonModule
]),
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/connection/connection.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ConnectionController } from './connection.controller';
import { ConnectionService } from './connection.service';
import { Module } from '@nestjs/common';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -11,7 +12,7 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.CONNECTION_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
}
])
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { Logger, Module } from '@nestjs/common';
import { CredentialDefinitionController } from './credential-definition.controller';
import { CredentialDefinitionService } from './credential-definition.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports:[
ClientsModule.register([
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.CREDENTIAL_DEFINITION_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
}
])
],
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/ecosystem/ecosystem.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Module } from '@nestjs/common';
import { EcosystemController } from './ecosystem.controller';
import { EcosystemService } from './ecosystem.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -16,7 +17,7 @@ import { getNatsOptions } from '@credebl/common/nats.config';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.ECOSYSTEM_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
},
CommonModule
])
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/fido/fido.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
import { FidoController } from './fido.controller';
import { FidoService } from './fido.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports:[
ClientsModule.register([
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.FIDO_SERVICE, process.env.API_GATEWAY_NKEY_SEED)

}
])
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/issuance/issuance.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { HttpModule } from '@nestjs/axios';
import { getNatsOptions } from '@credebl/common/nats.config';
import { ImageServiceService } from '@credebl/image-service';
import { AwsService } from '@credebl/aws';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -15,7 +16,7 @@ import { AwsService } from '@credebl/aws';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.ISSUANCE_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
}
])
],
Expand Down
4 changes: 2 additions & 2 deletions apps/api-gateway/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { HttpAdapterHost, NestFactory } from '@nestjs/core';
import { AllExceptionsFilter } from '@credebl/common/exception-handler';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { getNatsOptions } from '@credebl/common/nats.config';

import helmet from 'helmet';
import { NodeEnvironment } from '@credebl/enum/enum';
import { CommonConstants } from '@credebl/common/common.constant';
dotenv.config();

async function bootstrap(): Promise<void> {
Expand All @@ -24,7 +24,7 @@ async function bootstrap(): Promise<void> {

app.connectMicroservice<MicroserviceOptions>({
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.API_GATEWAY_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
});

const expressApp = app.getHttpAdapter().getInstance();
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/notification/notification.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Module } from '@nestjs/common';
import { getNatsOptions } from '@credebl/common/nats.config';
import { NotificationController } from './notification.controller';
import { NotificationService } from './notification.service';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -16,7 +17,7 @@ import { NotificationService } from './notification.service';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.NOTIFICATION_SERVICE, process.env.API_GATEWAY_NKEY_SEED)

},
CommonModule
Expand Down
4 changes: 3 additions & 1 deletion apps/api-gateway/src/organization/organization.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { OrganizationService } from './organization.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { ImageServiceService } from '@credebl/image-service';
import { AwsService } from '@credebl/aws';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
HttpModule,
Expand All @@ -17,7 +19,7 @@ import { AwsService } from '@credebl/aws';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.ORGANIZATION_SERVICE, process.env.API_GATEWAY_NKEY_SEED)

},
CommonModule
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/platform/platform.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PlatformService } from './platform.service';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { ConfigModule } from '@nestjs/config';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -12,7 +13,7 @@ import { getNatsOptions } from '@credebl/common/nats.config';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.PLATFORM_SERVICE, process.env.API_GATEWAY_NKEY_SEED)
}
])
],
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/schema/schema.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Module } from '@nestjs/common';
import { SchemaController } from './schema.controller';
import { SchemaService } from './schema.service';
import { getNatsOptions } from '@credebl/common/nats.config';
import { CommonConstants } from '@credebl/common/common.constant';

@Module({
imports: [
Expand All @@ -13,7 +14,7 @@ import { getNatsOptions } from '@credebl/common/nats.config';
{
name: 'NATS_CLIENT',
transport: Transport.NATS,
options: getNatsOptions(process.env.API_GATEWAY_NKEY_SEED)
options: getNatsOptions(CommonConstants.SCHEMA_SERVICE, process.env.API_GATEWAY_NKEY_SEED)

}
])
Expand Down
Loading

0 comments on commit 8a15079

Please sign in to comment.