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

Check to allow to deploy consensus single mainnet-beta node #145

Merged
merged 2 commits into from
Nov 14, 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
35 changes: 20 additions & 15 deletions lib/solana/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,28 @@ new SolanaSingleNodeStack(app, "solana-single-node", {
registrationTransactionFundingAccountSecretARN: config.baseNodeConfig.registrationTransactionFundingAccountSecretARN,
});

new SolanaHANodesStack(app, "solana-ha-nodes", {
stackName: `solana-ha-nodes-${config.baseNodeConfig.nodeConfiguration}`,
env: { account: config.baseConfig.accountId, region: config.baseConfig.region },

instanceType: config.baseNodeConfig.instanceType,
instanceCpuType: config.baseNodeConfig.instanceCpuType,
solanaCluster: config.baseNodeConfig.solanaCluster,
solanaVersion: config.baseNodeConfig.solanaVersion,
nodeConfiguration: config.baseNodeConfig.nodeConfiguration,
dataVolume: config.baseNodeConfig.dataVolume,
accountsVolume: config.baseNodeConfig.accountsVolume,
if (app.node.tryGetContext('deployHA') === 'true') {
if (config.baseNodeConfig.nodeConfiguration !== "consensus") {
new SolanaHANodesStack(app, "solana-ha-nodes", {
stackName: `solana-ha-nodes-${config.baseNodeConfig.nodeConfiguration}`,
env: { account: config.baseConfig.accountId, region: config.baseConfig.region },

albHealthCheckGracePeriodMin: config.haNodeConfig.albHealthCheckGracePeriodMin,
heartBeatDelayMin: config.haNodeConfig.heartBeatDelayMin,
numberOfNodes: config.haNodeConfig.numberOfNodes,
});
instanceType: config.baseNodeConfig.instanceType,
instanceCpuType: config.baseNodeConfig.instanceCpuType,
solanaCluster: config.baseNodeConfig.solanaCluster,
solanaVersion: config.baseNodeConfig.solanaVersion,
nodeConfiguration: config.baseNodeConfig.nodeConfiguration,
dataVolume: config.baseNodeConfig.dataVolume,
accountsVolume: config.baseNodeConfig.accountsVolume,

albHealthCheckGracePeriodMin: config.haNodeConfig.albHealthCheckGracePeriodMin,
heartBeatDelayMin: config.haNodeConfig.heartBeatDelayMin,
numberOfNodes: config.haNodeConfig.numberOfNodes,
});
} else {
throw new Error("Consensus node configuration is not yet supported for HA setup");
}
}

// Security Check
cdk.Aspects.of(app).add(
Expand Down
8 changes: 2 additions & 6 deletions lib/solana/lib/ha-nodes-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class SolanaHANodesStack extends cdk.Stack {
const vpc = ec2.Vpc.fromLookup(this, "vpc", { isDefault: true });

// Setting up the security group for the node from Solana-specific construct
const instanceSG = new SolanaNodeSecurityGroupConstruct (this, "security-group", {
const instanceSG = new SolanaNodeSecurityGroupConstruct(this, "security-group", {
vpc: vpc,
})

Expand All @@ -75,10 +75,6 @@ export class SolanaHANodesStack extends cdk.Stack {
throw new Error("ARM_64 is not yet supported");
}

if (nodeConfiguration === "consensus") {
throw new Error("Consensus node configuration is not yet supported for HA setup");
}

// Use Ubuntu 20.04 LTS image for amd64. Find more: https://discourse.ubuntu.com/t/finding-ubuntu-images-with-the-aws-ssm-parameter-store/15507
const ubuntu204stableImageSsmName = "/aws/service/canonical/ubuntu/server/20.04/stable/current/amd64/hvm/ebs-gp2/ami-id"

Expand Down Expand Up @@ -110,7 +106,7 @@ export class SolanaHANodesStack extends cdk.Stack {

// Setting up the nodse using generic High Availability (HA) Node constract
const healthCheckPath = "/health";
const rpcNodes = new HANodesConstruct (this, "rpc-nodes", {
const rpcNodes = new HANodesConstruct(this, "rpc-nodes", {
instanceType,
dataVolumes: [accountsVolume, dataVolume],
rootDataVolumeDeviceName: "/dev/sda1",
Expand Down
Loading