Skip to content

Commit

Permalink
fix(infra): creating an indexer instance in staging (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
nutrina authored Nov 8, 2023
1 parent 518f45b commit 08567ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion infra/lib/scorer/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export function createIndexerService({
memory: 1024,
cpu: 1024,
image: dockerGtcStakingIndexerImage,
command: ["cargo", "run"],
// command: ["cargo", "run"],
portMappings: [],
secrets: indexerSecrets,
environment: indexerEnvironment,
Expand Down
4 changes: 2 additions & 2 deletions infra/prod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const scorerDbProxy = new aws.rds.Proxy("scorer-db-proxy", {
debugLogging: false,
idleClientTimeout: 600, // 10 minutes
name: "scorer-db-proxy",
requireTls: true,
requireTls: false,
vpcSecurityGroupIds: [db_secgrp.id],
});

Expand Down Expand Up @@ -1118,7 +1118,7 @@ const web = new aws.ec2.Instance("Web", {

export const ec2PublicIp = web.publicIp;
export const dockrRunCmd = pulumi.secret(
pulumi.interpolate`docker run -it -e 'DATABASE_URL=${scorerDbProxyEndpoint}' -e 'CELERY_BROKER_URL=${redisCacheOpsConnectionUrl}' '${dockerGtcPassportScorerImage}' bash`
pulumi.interpolate`docker run -it -e CERAMIC_CACHE_SCORER_ID=1 -e 'DATABASE_URL=${rdsConnectionUrl}' -e 'CELERY_BROKER_URL=${redisCacheOpsConnectionUrl}' '${dockerGtcPassportScorerImage}' bash`
);

///////////////////////
Expand Down
20 changes: 16 additions & 4 deletions infra/staging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ const postgresql = new aws.rds.Instance(
{ protect: true }
);


//////////////////////////////////////////////////////////////
// Setup RDS PROXY
//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -229,11 +228,10 @@ const scorerDbProxy = new aws.rds.Proxy("scorer-db-proxy", {
debugLogging: false,
idleClientTimeout: 600, // 10 minutes
name: "scorer-db-proxy",
requireTls: true,
requireTls: false,
vpcSecurityGroupIds: [db_secgrp.id],
});


const scorerDbProxyDefaultTargetGroup = new aws.rds.ProxyDefaultTargetGroup(
"scorer-default-tg",
{
Expand Down Expand Up @@ -1137,7 +1135,7 @@ const web = new aws.ec2.Instance("Web", {

export const ec2PublicIp = web.publicIp;
export const dockrRunCmd = pulumi.secret(
pulumi.interpolate`docker run -it -e 'DATABASE_URL=${scorerDbProxyEndpoint}' -e 'CELERY_BROKER_URL=${redisCacheOpsConnectionUrl}' '${dockerGtcPassportScorerImage}' bash`
pulumi.interpolate`docker run -it -e CERAMIC_CACHE_SCORER_ID=1 -e 'DATABASE_URL=${rdsConnectionUrl}' -e 'CELERY_BROKER_URL=${redisCacheOpsConnectionUrl}' '${dockerGtcPassportScorerImage}' bash`
);

///////////////////////
Expand Down Expand Up @@ -1437,3 +1435,17 @@ const exportVals = createScoreExportBucketAndDomain(
// privateSubnetSecurityGroup,
// workerRole
// );

const pagerdutyTopic = new aws.sns.Topic("pagerduty", {
name: "Pagerduty",
tracingConfig: "PassThrough",
});

createIndexerService({
indexerRdsConnectionUrl,
cluster,
vpc,
privateSubnetSecurityGroup,
workerRole,
alertTopic: pagerdutyTopic,
});

0 comments on commit 08567ba

Please sign in to comment.