Skip to content
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
1 change: 0 additions & 1 deletion cluster/pulumi/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export * from './dockerConfig';
export * from './serviceAccount';
export * from './participantKms';
export * from './config/migrationSchema';
export * from './postgres';
export * from './pruning';
export * from './config/loadTesterConfig';
export * from './config/networkWideConfig';
Expand Down
11 changes: 3 additions & 8 deletions cluster/pulumi/common/src/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ export class CloudPostgres extends pulumi.ComponentResource implements Postgres
secretName: string,
cloudSqlConfig: CloudSqlConfig,
active: boolean = true,
opts: {
disableProtection?: boolean;
migrationId?: string;
logicalDecoding?: boolean;
disableBackups?: boolean;
} = {}
opts: { disableProtection?: boolean; migrationId?: string; logicalDecoding?: boolean } = {}
) {
const instanceLogicalName = xns.logicalName + '-' + instanceName;
const instanceLogicalNameAlias = xns.logicalName + '-' + alias; // pulumi name before #12391
Expand Down Expand Up @@ -98,8 +93,8 @@ export class CloudPostgres extends pulumi.ComponentResource implements Postgres
...(opts.logicalDecoding ? [{ name: 'cloudsql.logical_decoding', value: 'on' }] : []),
],
backupConfiguration: {
enabled: !opts.disableBackups,
pointInTimeRecoveryEnabled: !opts.disableBackups,
enabled: true,
pointInTimeRecoveryEnabled: true,
...(spliceConfig.pulumiProjectConfig.cloudSql.backupsToRetain
? {
backupRetentionSettings: {
Expand Down
27 changes: 0 additions & 27 deletions cluster/pulumi/gha/src/performanceTests.ts

This file was deleted.

4 changes: 0 additions & 4 deletions cluster/pulumi/gha/src/runners.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ jest.mock('./config', () => ({
runnerHookVersion: '1.1',
},
}));
class FakeCloudPostgres extends pulumi.Resource {}
jest.mock('@lfdecentralizedtrust/splice-pulumi-common', () => ({
__esModule: true,
appsAffinityAndTolerations: {},
DOCKER_REPO: 'https://dummy-docker-repo.com',
HELM_MAX_HISTORY_SIZE: 42,
imagePullSecretByNamespaceNameForServiceAccount: () => [],
infraAffinityAndTolerations: {},
CloudPostgres: function CloudPostgres() {
return new FakeCloudPostgres('CloudPostgres', 'cloud-postgres', true);
},
}));
jest.mock('@lfdecentralizedtrust/splice-pulumi-common/src/config/envConfig', () => ({
__esModule: true,
Expand Down
50 changes: 7 additions & 43 deletions cluster/pulumi/gha/src/runners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import * as k8s from '@pulumi/kubernetes';
import {
appsAffinityAndTolerations,
CloudPostgres,
DOCKER_REPO,
ExactNamespace,
HELM_MAX_HISTORY_SIZE,
imagePullSecretByNamespaceNameForServiceAccount,
infraAffinityAndTolerations,
Expand All @@ -20,7 +18,6 @@ import yaml from 'js-yaml';

import { createCachePvc } from './cache';
import { ghaConfig } from './config';
import { createCloudSQLInstanceForPerformanceTests } from './performanceTests';

type ResourcesSpec = {
requests?: {
Expand Down Expand Up @@ -406,8 +403,7 @@ function installK8sRunnerScaleSet(
cachePvcName: string,
resources: ResourcesSpec,
serviceAccountName: string,
dependsOn: Resource[],
performanceTestsDb: CloudPostgres
dependsOn: Resource[]
): Release {
const podConfigMapName = `${name}-pod-config`;
// A configMap that will be mounted to runner pods and provide additional pod spec for the workflow pods
Expand Down Expand Up @@ -538,23 +534,6 @@ function installK8sRunnerScaleSet(
name: 'ACTIONS_RUNNER_CONTAINER_HOOK_TEMPLATE',
value: '/pod.yaml',
},
{
name: 'PERFORMANCE_TESTS_DB_HOST',
value: performanceTestsDb.address,
},
{
name: 'PERFORMANCE_TESTS_DB_USER',
value: 'cnadmin',
},
{
name: 'PERFORMANCE_TESTS_DB_PASSWORD',
valueFrom: {
secretKeyRef: {
key: 'postgresPassword',
name: performanceTestsDb.secretName,
},
},
},
],
volumeMounts: [
{
Expand Down Expand Up @@ -722,10 +701,9 @@ function installK8sRunnerScaleSets(
runnersNamespace: Namespace,
tokenSecret: Secret,
cachePvcName: string,
serviceAccountName: string,
performanceTestsDb: CloudPostgres
serviceAccountName: string
): void {
const dependsOn = [controller, runnersNamespace, tokenSecret, performanceTestsDb];
const dependsOn = [controller, runnersNamespace, tokenSecret];

runnerSpecs
.filter(spec => spec.k8s)
Expand All @@ -737,8 +715,7 @@ function installK8sRunnerScaleSets(
cachePvcName,
spec.resources,
serviceAccountName,
dependsOn,
performanceTestsDb
dependsOn
);
});
}
Expand Down Expand Up @@ -777,17 +754,12 @@ function installPodMonitor(runnersNamespace: Namespace) {
);
}

const GHA_NAMESPACE_NAME = 'gha-runners';
export function installRunnerScaleSets(controller: k8s.helm.v3.Release): void {
const runnersNamespace = new Namespace(GHA_NAMESPACE_NAME, {
const runnersNamespace = new Namespace('gha-runners', {
metadata: {
name: GHA_NAMESPACE_NAME,
name: 'gha-runners',
},
});
const exactNs: ExactNamespace = {
ns: runnersNamespace,
logicalName: GHA_NAMESPACE_NAME,
};

const tokenSecret = new k8s.core.v1.Secret(
'gh-access-token',
Expand Down Expand Up @@ -819,15 +791,7 @@ export function installRunnerScaleSets(controller: k8s.helm.v3.Release): void {
const saName = 'k8s-runners';
installRunnersServiceAccount(runnersNamespace, saName);

const performanceTestsDb = createCloudSQLInstanceForPerformanceTests(exactNs);
installDockerRunnerScaleSets(controller, runnersNamespace, tokenSecret, cachePvc, saName);
installK8sRunnerScaleSets(
controller,
runnersNamespace,
tokenSecret,
cachePvcName,
saName,
performanceTestsDb
);
installK8sRunnerScaleSets(controller, runnersNamespace, tokenSecret, cachePvcName, saName);
installPodMonitor(runnersNamespace);
}
Loading