Skip to content

Commit

Permalink
rename references to fst and change the repository path to be to the …
Browse files Browse the repository at this point in the history
…new solo-charts

Signed-off-by: instamenta <[email protected]>
  • Loading branch information
instamenta committed Sep 24, 2024
1 parent ed4ed88 commit 6d61999
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 46 deletions.
16 changes: 8 additions & 8 deletions src/commands/cluster.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ClusterCommand extends BaseCommand {

self.logger.debug('Prepare ctx.config', { config: ctx.config, argv })

ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.clusterSetupNamespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.clusterSetupNamespace, constants.SOLO_CLUSTER_SETUP_CHART)
}
},
{
Expand All @@ -115,7 +115,7 @@ export class ClusterCommand extends BaseCommand {
skip: (ctx, _) => ctx.isChartInstalled
},
{
title: `Install '${constants.FULLSTACK_CLUSTER_SETUP_CHART}' chart`,
title: `Install '${constants.SOLO_CLUSTER_SETUP_CHART}' chart`,
task: async (ctx, _) => {
const clusterSetupNamespace = ctx.config.clusterSetupNamespace
const version = ctx.config.fstChartVersion
Expand All @@ -124,12 +124,12 @@ export class ClusterCommand extends BaseCommand {
const valuesArg = ctx.valuesArg

try {
await self.chartManager.install(clusterSetupNamespace, constants.FULLSTACK_CLUSTER_SETUP_CHART, chartPath, version, valuesArg)
await self.chartManager.install(clusterSetupNamespace, constants.SOLO_CLUSTER_SETUP_CHART, chartPath, version, valuesArg)
} catch (e) {
// if error, uninstall the chart and rethrow the error
self.logger.debug(`Error on installing ${constants.FULLSTACK_CLUSTER_SETUP_CHART}. attempting to rollback by uninstalling the chart`, e)
self.logger.debug(`Error on installing ${constants.SOLO_CLUSTER_SETUP_CHART}. attempting to rollback by uninstalling the chart`, e)
try {
await self.chartManager.uninstall(clusterSetupNamespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
await self.chartManager.uninstall(clusterSetupNamespace, constants.SOLO_CLUSTER_SETUP_CHART)
} catch (ex) {
// ignore error during uninstall since we are doing the best-effort uninstall here
}
Expand Down Expand Up @@ -189,17 +189,17 @@ export class ClusterCommand extends BaseCommand {
clusterSetupNamespace
}

ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.clusterSetupNamespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
ctx.isChartInstalled = await this.chartManager.isChartInstalled(ctx.config.clusterSetupNamespace, constants.SOLO_CLUSTER_SETUP_CHART)
if (!ctx.isChartInstalled) {
throw new FullstackTestingError('No chart found for the cluster')
}
}
},
{
title: `Uninstall '${constants.FULLSTACK_CLUSTER_SETUP_CHART}' chart`,
title: `Uninstall '${constants.SOLO_CLUSTER_SETUP_CHART}' chart`,
task: async (ctx, _) => {
const clusterSetupNamespace = ctx.config.clusterSetupNamespace
await self.chartManager.uninstall(clusterSetupNamespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
await self.chartManager.uninstall(clusterSetupNamespace, constants.SOLO_CLUSTER_SETUP_CHART)
if (argv.dev) {
await self.showInstalledChartList(clusterSetupNamespace)
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const clusterSetupNamespace = {
name: 'cluster-setup-namespace',
definition: {
describe: 'Cluster Setup Namespace',
defaultValue: constants.FULLSTACK_SETUP_NAMESPACE,
defaultValue: constants.SOLO_SETUP_NAMESPACE,
alias: 's',
type: 'string'
}
Expand Down
8 changes: 4 additions & 4 deletions src/commands/mirror_node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class MirrorNodeCommand extends BaseCommand {
['chartPath', 'valuesArg'])

ctx.config.chartPath = await self.prepareChartPath(ctx.config.chartDirectory,
constants.FULLSTACK_TESTING_CHART, constants.FULLSTACK_DEPLOYMENT_CHART)
constants.SOLO_CHART, constants.SOLO_DEPLOYMENT_CHART)

ctx.config.valuesArg = await self.prepareValuesArg(ctx.config)

Expand All @@ -217,7 +217,7 @@ export class MirrorNodeCommand extends BaseCommand {
task: async (ctx, _) => {
await self.chartManager.upgrade(
ctx.config.namespace,
constants.FULLSTACK_DEPLOYMENT_CHART,
constants.SOLO_DEPLOYMENT_CHART,
ctx.config.chartPath,
ctx.config.valuesArg,
ctx.config.fstChartVersion
Expand Down Expand Up @@ -389,7 +389,7 @@ export class MirrorNodeCommand extends BaseCommand {
}

ctx.config.chartPath = await self.prepareChartPath(ctx.config.chartDirectory,
constants.FULLSTACK_TESTING_CHART, constants.FULLSTACK_DEPLOYMENT_CHART)
constants.SOLO_CHART, constants.SOLO_DEPLOYMENT_CHART)

ctx.config.valuesArg = ' --set hedera-mirror-node.enabled=false --set hedera-explorer.enabled=false'

Expand All @@ -405,7 +405,7 @@ export class MirrorNodeCommand extends BaseCommand {
task: async (ctx, _) => {
await self.chartManager.upgrade(
ctx.config.namespace,
constants.FULLSTACK_DEPLOYMENT_CHART,
constants.SOLO_DEPLOYMENT_CHART,
ctx.config.chartPath,
ctx.config.valuesArg,
ctx.config.fstChartVersion
Expand Down
22 changes: 11 additions & 11 deletions src/commands/network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class NetworkCommand extends BaseCommand {

// compute values
config.chartPath = await this.prepareChartPath(config.chartDirectory,
constants.FULLSTACK_TESTING_CHART, constants.FULLSTACK_DEPLOYMENT_CHART)
constants.SOLO_CHART, constants.SOLO_DEPLOYMENT_CHART)

config.valuesArg = await this.prepareValuesArg(config)

Expand Down Expand Up @@ -293,16 +293,16 @@ export class NetworkCommand extends BaseCommand {
}
},
{
title: `Install chart '${constants.FULLSTACK_DEPLOYMENT_CHART}'`,
title: `Install chart '${constants.SOLO_DEPLOYMENT_CHART}'`,
task: async (ctx, _) => {
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
if (await self.chartManager.isChartInstalled(config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)) {
await self.chartManager.uninstall(config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)
if (await self.chartManager.isChartInstalled(config.namespace, constants.SOLO_DEPLOYMENT_CHART)) {
await self.chartManager.uninstall(config.namespace, constants.SOLO_DEPLOYMENT_CHART)
}

await this.chartManager.install(
config.namespace,
constants.FULLSTACK_DEPLOYMENT_CHART,
constants.SOLO_DEPLOYMENT_CHART,
config.chartPath,
config.fstChartVersion,
config.valuesArg)
Expand Down Expand Up @@ -406,7 +406,7 @@ export class NetworkCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error installing chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`, e)
throw new FullstackTestingError(`Error installing chart ${constants.SOLO_DEPLOYMENT_CHART}`, e)
}

return true
Expand Down Expand Up @@ -451,9 +451,9 @@ export class NetworkCommand extends BaseCommand {
}
},
{
title: `Uninstall chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`,
title: `Uninstall chart ${constants.SOLO_DEPLOYMENT_CHART}`,
task: async (ctx, _) => {
await self.chartManager.uninstall(ctx.config.namespace, constants.FULLSTACK_DEPLOYMENT_CHART)
await self.chartManager.uninstall(ctx.config.namespace, constants.SOLO_DEPLOYMENT_CHART)
}
},
{
Expand Down Expand Up @@ -512,12 +512,12 @@ export class NetworkCommand extends BaseCommand {
}
},
{
title: `Upgrade chart '${constants.FULLSTACK_DEPLOYMENT_CHART}'`,
title: `Upgrade chart '${constants.SOLO_DEPLOYMENT_CHART}'`,
task: async (ctx, _) => {
const config = ctx.config
await this.chartManager.upgrade(
config.namespace,
constants.FULLSTACK_DEPLOYMENT_CHART,
constants.SOLO_DEPLOYMENT_CHART,
config.chartPath,
config.valuesArg,
config.fstChartVersion
Expand All @@ -540,7 +540,7 @@ export class NetworkCommand extends BaseCommand {
try {
await tasks.run()
} catch (e) {
throw new FullstackTestingError(`Error upgrading chart ${constants.FULLSTACK_DEPLOYMENT_CHART}`, e)
throw new FullstackTestingError(`Error upgrading chart ${constants.SOLO_DEPLOYMENT_CHART}`, e)
}

return true
Expand Down
8 changes: 4 additions & 4 deletions src/commands/node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ export class NodeCommand extends BaseCommand {

await this.chartManager.upgrade(
config.namespace,
constants.FULLSTACK_DEPLOYMENT_CHART,
constants.SOLO_DEPLOYMENT_CHART,
config.chartPath,
valuesArg,
config.fstChartVersion
Expand Down Expand Up @@ -1693,7 +1693,7 @@ export class NodeCommand extends BaseCommand {
ctx.config = config

ctx.config.chartPath = await self.prepareChartPath(ctx.config.chartDirectory,
constants.FULLSTACK_TESTING_CHART, constants.FULLSTACK_DEPLOYMENT_CHART)
constants.SOLO_CHART, constants.SOLO_DEPLOYMENT_CHART)

// initialize Node Client with existing network nodes prior to adding the new node which isn't functioning, yet
ctx.config.nodeClient = await this.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down Expand Up @@ -2687,7 +2687,7 @@ export class NodeCommand extends BaseCommand {
ctx.config = config

ctx.config.chartPath = await self.prepareChartPath(ctx.config.chartDirectory,
constants.FULLSTACK_TESTING_CHART, constants.FULLSTACK_DEPLOYMENT_CHART)
constants.SOLO_CHART, constants.SOLO_DEPLOYMENT_CHART)

// initialize Node Client with existing network nodes prior to adding the new node which isn't functioning, yet
ctx.config.nodeClient = await this.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down Expand Up @@ -3079,7 +3079,7 @@ export class NodeCommand extends BaseCommand {
ctx.config = config

ctx.config.chartPath = await self.prepareChartPath(ctx.config.chartDirectory,
constants.FULLSTACK_TESTING_CHART, constants.FULLSTACK_DEPLOYMENT_CHART)
constants.SOLO_CHART, constants.SOLO_DEPLOYMENT_CHART)

// initialize Node Client with existing network nodes prior to adding the new node which isn't functioning, yet
ctx.config.nodeClient = await this.accountManager.loadNodeClient(ctx.config.namespace)
Expand Down
4 changes: 2 additions & 2 deletions src/commands/relay.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class RelayCommand extends BaseCommand {
valuesArg += this.prepareValuesFiles(profileValuesFile)
}

valuesArg += ` --set config.MIRROR_NODE_URL=http://${constants.FULLSTACK_DEPLOYMENT_CHART}-rest`
valuesArg += ` --set config.MIRROR_NODE_URL_WEB3=http://${constants.FULLSTACK_DEPLOYMENT_CHART}-web3`
valuesArg += ` --set config.MIRROR_NODE_URL=http://${constants.SOLO_DEPLOYMENT_CHART}-rest`
valuesArg += ` --set config.MIRROR_NODE_URL_WEB3=http://${constants.SOLO_DEPLOYMENT_CHART}-web3`
valuesArg += ' --set config.MIRROR_NODE_AGENT_CACHEABLE_DNS=false'
valuesArg += ' --set config.MIRROR_NODE_RETRY_DELAY=2001'
valuesArg += ' --set config.MIRROR_NODE_GET_CONTRACT_RESULTS_DEFAULT_RETRIES=21'
Expand Down
12 changes: 6 additions & 6 deletions src/core/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ export const HEDERA_NODE_EXTERNAL_GOSSIP_PORT = process.env.SOLO_NODE_EXTERNAL_G
export const HEDERA_NODE_DEFAULT_STAKE_AMOUNT = process.env.SOLO_NODE_DEFAULT_STAKE_AMOUNT || 500

// --------------- Charts related constants ----------------------------------------------------------------------------
export const FULLSTACK_SETUP_NAMESPACE = 'fullstack-setup'
export const FULLSTACK_TESTING_CHART_URL = 'https://hashgraph.github.io/full-stack-testing/charts'
export const FULLSTACK_TESTING_CHART = 'full-stack-testing'
export const FULLSTACK_CLUSTER_SETUP_CHART = 'fullstack-cluster-setup'
export const FULLSTACK_DEPLOYMENT_CHART = 'fullstack-deployment'
export const SOLO_SETUP_NAMESPACE = 'fullstack-setup'
export const SOLO_CHART_URL = 'https://hashgraph.github.io/solo-charts/charts'
export const SOLO_CHART = 'full-stack-testing'
export const SOLO_CLUSTER_SETUP_CHART = 'fullstack-cluster-setup'
export const SOLO_DEPLOYMENT_CHART = 'fullstack-deployment'
export const JSON_RPC_RELAY_CHART_URL = 'https://hashgraph.github.io/hedera-json-rpc-relay/charts'
export const JSON_RPC_RELAY_CHART = 'hedera-json-rpc-relay'
export const MIRROR_NODE_CHART_URL = 'https://hashgraph.github.io/hedera-mirror-node/charts'
export const MIRROR_NODE_CHART = 'hedera-mirror'

/** @type {Map<string, string>} */
export const DEFAULT_CHART_REPO = new Map()
.set(FULLSTACK_TESTING_CHART, FULLSTACK_TESTING_CHART_URL)
.set(SOLO_CHART, SOLO_CHART_URL)
.set(JSON_RPC_RELAY_CHART, JSON_RPC_RELAY_CHART_URL)
.set(MIRROR_NODE_CHART, MIRROR_NODE_CHART_URL)

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/commands/cluster.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ describe('ClusterCommand', () => {

afterAll(async () => {
await k8.deleteNamespace(namespace)
argv[flags.clusterSetupNamespace.name] = constants.FULLSTACK_SETUP_NAMESPACE
argv[flags.clusterSetupNamespace.name] = constants.SOLO_SETUP_NAMESPACE
configManager.update(argv, true)
await clusterCmd.setup(argv) // restore fullstack-cluster-setup for other e2e tests to leverage
do {
await sleep(5000)
} while (!await chartManager.isChartInstalled(constants.FULLSTACK_SETUP_NAMESPACE, constants.FULLSTACK_CLUSTER_SETUP_CHART))
} while (!await chartManager.isChartInstalled(constants.SOLO_SETUP_NAMESPACE, constants.SOLO_CLUSTER_SETUP_CHART))
}, 180000)

beforeEach(() => {
Expand All @@ -82,7 +82,7 @@ describe('ClusterCommand', () => {
})

it('should cleanup existing deployment', async () => {
if (await chartManager.isChartInstalled(constants.FULLSTACK_SETUP_NAMESPACE, constants.FULLSTACK_CLUSTER_SETUP_CHART)) {
if (await chartManager.isChartInstalled(constants.SOLO_SETUP_NAMESPACE, constants.SOLO_CLUSTER_SETUP_CHART)) {
expect.assertions(1)
try {
await expect(clusterCmd.reset(argv)).resolves.toBeTruthy()
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/network.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('NetworkCommand', () => {
}

// check if chart is uninstalled
await expect(bootstrapResp.opts.chartManager.isChartInstalled(namespace, constants.FULLSTACK_DEPLOYMENT_CHART))
await expect(bootstrapResp.opts.chartManager.isChartInstalled(namespace, constants.SOLO_DEPLOYMENT_CHART))
.resolves.toBeFalsy()

// check if pvc are deleted
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/core/chart_manager.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ describe('ChartManager', () => {
const chartManager = new ChartManager(helm, testLogger)

it('should be able to list installed charts', async () => {
const ns = constants.FULLSTACK_SETUP_NAMESPACE
const ns = constants.SOLO_SETUP_NAMESPACE
expect(ns, 'namespace should not be null').not.toBeNull()
const list = await chartManager.getInstalledCharts(ns)
expect(list.length, 'should have at least one installed chart').not.toBe(0)
})

it('should be able to check if a chart is installed', async () => {
const ns = constants.FULLSTACK_SETUP_NAMESPACE
const ns = constants.SOLO_SETUP_NAMESPACE
expect(ns, 'namespace should not be null').not.toBeNull()
const isInstalled = await chartManager.isChartInstalled(ns, constants.FULLSTACK_CLUSTER_SETUP_CHART)
expect(isInstalled, `${constants.FULLSTACK_CLUSTER_SETUP_CHART} should be installed`).toBeTruthy()
const isInstalled = await chartManager.isChartInstalled(ns, constants.SOLO_CLUSTER_SETUP_CHART)
expect(isInstalled, `${constants.SOLO_CLUSTER_SETUP_CHART} should be installed`).toBeTruthy()
})
})
2 changes: 1 addition & 1 deletion test/e2e/core/k8_e2e.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('K8', () => {
afterAll(async () => {
try {
await k8.kubeClient.deleteNamespacedPod(podName, testNamespace, undefined, undefined, 1)
argv[flags.namespace.name] = constants.FULLSTACK_SETUP_NAMESPACE
argv[flags.namespace.name] = constants.SOLO_SETUP_NAMESPACE
configManager.update(argv)
} catch (e) {
console.log(e)
Expand Down
2 changes: 1 addition & 1 deletion test/test_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export function bootstrapNetwork (testName, argv,
}
}

if (!await chartManager.isChartInstalled(constants.FULLSTACK_SETUP_NAMESPACE, constants.FULLSTACK_CLUSTER_SETUP_CHART)) {
if (!await chartManager.isChartInstalled(constants.SOLO_SETUP_NAMESPACE, constants.SOLO_CLUSTER_SETUP_CHART)) {
await clusterCmd.setup(argv)
}
}, 120000)
Expand Down

0 comments on commit 6d61999

Please sign in to comment.