Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion cluster/pulumi/canton-network/src/dso.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import * as pulumi from '@pulumi/pulumi';
import {
activeVersion,
Auth0Client,
BackupConfig,
BackupLocation,
Expand Down Expand Up @@ -68,6 +69,7 @@ export class Dso extends pulumi.ComponentResource {
cometBftGovernanceKey: CnInput<SvCometBftGovernanceKey> | undefined = undefined,
extraDependsOn: CnInput<pulumi.Resource>[] = []
) {
const dynamicConfig = configForSv(svConf.nodeName);
return installSvNode(
{
isFirstSv,
Expand Down Expand Up @@ -95,7 +97,8 @@ export class Dso extends pulumi.ComponentResource {
sweep: svConf.sweep,
cometBftGovernanceKey,
initialRound: initialRound?.toString(),
...configForSv(svConf.nodeName),
version: dynamicConfig.versionOverride ?? activeVersion,
...dynamicConfig,
},
this.args.decentralizedSynchronizerUpgradeConfig,
extraDependsOn
Expand Down
16 changes: 5 additions & 11 deletions cluster/pulumi/canton-network/src/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export function installInfo(
gateway: string,
decentralizedSynchronizerMigrationConfig: DecentralizedSynchronizerMigrationConfig,
scanUrl: string,
scanDependency: Resource
scanDependency: Resource,
version: CnChartVersion
): void {
function md5(str: string): string {
return createHash('md5').update(str).digest('hex');
Expand Down Expand Up @@ -86,14 +87,7 @@ export function installInfo(
},
};

installSpliceHelmChart(
xns,
'info',
'splice-info',
infoValues,
decentralizedSynchronizerMigrationConfig.active.version,
{
dependsOn: [scanDependency],
}
);
installSpliceHelmChart(xns, 'info', 'splice-info', infoValues, version, {
dependsOn: [scanDependency],
});
}
15 changes: 8 additions & 7 deletions cluster/pulumi/canton-network/src/sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as postgres from '@lfdecentralizedtrust/splice-pulumi-common/src/postgr
import * as k8s from '@pulumi/kubernetes';
import * as pulumi from '@pulumi/pulumi';
import {
activeVersion,
ansDomainPrefix,
appsAffinityAndTolerations,
BackupConfig,
Expand Down Expand Up @@ -220,7 +219,7 @@ export async function installSvNode(
xns,
'postgres',
'postgres',
activeVersion,
config.version,
spliceConfig.pulumiProjectConfig.cloudSql,
false,
{
Expand All @@ -234,7 +233,7 @@ export async function installSvNode(
xns,
`cn-apps-pg`,
`cn-apps-pg`,
activeVersion,
config.version,
spliceConfig.pulumiProjectConfig.cloudSql,
true,
{
Expand Down Expand Up @@ -282,7 +281,8 @@ export async function installSvNode(
'cluster-ingress/cn-http-gateway',
decentralizedSynchronizerUpgradeConfig,
`http://scan-app.${config.nodeName}:5012`,
scan
scan,
config.version
);

if (baseConfig.scanBigQuery && appsPostgres instanceof postgres.CloudPostgres) {
Expand Down Expand Up @@ -327,7 +327,7 @@ export async function installSvNode(
},
},
},
activeVersion,
config.version,
{ dependsOn: [xns.ns] }
);

Expand Down Expand Up @@ -397,6 +397,7 @@ async function installValidator(
logAsync: svConfig.logging?.appsAsync,
additionalJvmOptions: svConfig.validatorApp?.additionalJvmOptions || '',
resources: svConfig.validatorApp?.resources,
version: svConfig.version,
});
}

Expand Down Expand Up @@ -510,7 +511,7 @@ function installSvApp(
'sv-app',
'splice-sv-node',
svValues,
activeVersion,
config.version,
{
dependsOn: dependsOn
.concat([postgres])
Expand Down Expand Up @@ -574,7 +575,7 @@ function installScan(
installRateLimits(xns.logicalName, 'scan-app', 5012, svsConfig.scan.externalRateLimits);
}

return installSpliceHelmChart(xns, 'scan', 'splice-scan', scanValues, activeVersion, {
return installSpliceHelmChart(xns, 'scan', 'splice-scan', scanValues, config.version, {
// TODO(#893) if possible, don't require parallel start of sv app and scan when using CantonBft
dependsOn: dependsOn
.concat(decentralizedSynchronizerNode.dependencies)
Expand Down
2 changes: 2 additions & 0 deletions cluster/pulumi/common-sv/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SvIdKey,
ValidatorTopupConfig,
RateLimitSchema,
CnChartVersion,
} from '@lfdecentralizedtrust/splice-pulumi-common';
import { SweepConfig } from '@lfdecentralizedtrust/splice-pulumi-common-validator';
import { clusterYamlConfig } from '@lfdecentralizedtrust/splice-pulumi-common/src/config/config';
Expand Down Expand Up @@ -78,6 +79,7 @@ export interface SvConfig extends StaticSvConfig, SingleSvConfiguration {
cometBftGovernanceKey?: CnInput<SvCometBftGovernanceKey>;
initialRound?: string;
periodicTopologySnapshotConfig?: BackupConfig;
version: CnChartVersion;
}

export const GCPBucketSchema = z.object({
Expand Down
2 changes: 2 additions & 0 deletions cluster/pulumi/common-sv/src/singleSvConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { ValidatorAppConfigSchema } from '@lfdecentralizedtrust/splice-pulumi-common-validator/src/config';
import { spliceConfig } from '@lfdecentralizedtrust/splice-pulumi-common/src/config/config';
import { clusterYamlConfig } from '@lfdecentralizedtrust/splice-pulumi-common/src/config/config';
import { CnChartVersionSchema } from '@lfdecentralizedtrust/splice-pulumi-common/src/config/versionSchema';
import { merge } from 'lodash';
import util from 'node:util';
import { z } from 'zod';
Expand Down Expand Up @@ -155,6 +156,7 @@ const SingleSvConfigSchema = z
})
.optional(),
periodicSnapshots: z.object({ topology: GCPBucketSchema.optional() }).optional(),
versionOverride: CnChartVersionSchema.optional(),
})
.strict();
const AllSvsConfigurationSchema = z.record(z.string(), SingleSvConfigSchema).and(
Expand Down
5 changes: 3 additions & 2 deletions cluster/pulumi/common-validator/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import * as k8s from '@pulumi/kubernetes';
import * as pulumi from '@pulumi/pulumi';
import {
activeVersion,
Auth0Client,
BackupConfig,
BootstrappingDumpConfig,
CLUSTER_BASENAME,
CnChartVersion,
CnInput,
config,
daContactPoint,
Expand Down Expand Up @@ -84,6 +84,7 @@ type BasicValidatorConfig = {
logLevel?: LogLevel;
logAsync?: boolean;
resources?: K8sResourceSchema;
version: CnChartVersion;
};

export type ValidatorInstallConfig = BasicValidatorConfig & {
Expand Down Expand Up @@ -178,7 +179,7 @@ export async function installValidatorApp(
},
};

const chartVersion = activeVersion;
const chartVersion = config.version;

return installSpliceHelmChart(
config.xns,
Expand Down
19 changes: 3 additions & 16 deletions cluster/pulumi/common/src/config/migrationSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import { z } from 'zod';

import { CnChartVersion } from '../artifacts';
import { spliceEnvConfig } from './envConfig';
import { CnChartVersionSchema } from './versionSchema';

export const defaultActiveMigration = {
id: 0,
Expand All @@ -13,18 +12,6 @@ export const defaultActiveMigration = {
},
};

const migrationVersion = z.string().transform<CnChartVersion>((version, ctx) => {
if (version == 'local' && spliceEnvConfig.optionalEnv('SPLICE_OPERATOR_DEPLOYMENT')) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: `Using a local version for the operator deployment is not supported.`,
});
return z.NEVER;
} else {
return CnChartVersion.parse(version);
}
});

export const GitReferenceSchema = z.object({
repoUrl: z.string(),
gitReference: z.string(),
Expand All @@ -43,7 +30,7 @@ export const MigrationInfoSchema = z
.number()
.lt(10, 'Migration id must be less than or equal to 10 as we use in the cometbft ports.')
.gte(0),
version: migrationVersion,
version: CnChartVersionSchema,
releaseReference: GitReferenceSchema.optional(),
sequencer: z
.object({
Expand All @@ -58,7 +45,7 @@ export const SynchronizerMigrationSchema = z
legacy: MigrationInfoSchema.optional(),
active: MigrationInfoSchema.extend({
migratingFrom: z.number().optional(),
version: migrationVersion,
version: CnChartVersionSchema,
})
.strict()
.default(defaultActiveMigration),
Expand Down
18 changes: 18 additions & 0 deletions cluster/pulumi/common/src/config/versionSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
import { z } from 'zod';

import { CnChartVersion } from '../artifacts';
import { spliceEnvConfig } from './envConfig';

export const CnChartVersionSchema = z.string().transform<CnChartVersion>((version, ctx) => {
if (version == 'local' && spliceEnvConfig.optionalEnv('SPLICE_OPERATOR_DEPLOYMENT')) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: `Using a local version for the operator deployment is not supported.`,
});
return z.NEVER;
} else {
return CnChartVersion.parse(version);
}
});
1 change: 1 addition & 0 deletions cluster/pulumi/splitwell/src/splitwell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export async function installSplitwell(
nodeIdentifier: 'splitwell',
logLevel: splitwellConfig.logging?.level,
logAsync: splitwellConfig.logging?.async,
version: activeVersion,
});
}

Expand Down
1 change: 1 addition & 0 deletions cluster/pulumi/validator1/src/validator1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export async function installValidator1(
participantPruningConfig,
deduplicationDuration: validator1Config?.deduplicationDuration,
disableAuth: validator1Config?.disableAuth,
version: activeVersion,
});
installIngress(xns, installSplitwell, decentralizedSynchronizerMigrationConfig);

Expand Down