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

feat(cli): allow deploying different number network nodes #726

Merged
merged 22 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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: 1 addition & 0 deletions docker/ubi8-init-java21/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@

set +e
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BEGIN NODE OUTPUT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "command: /usr/bin/env java ${JAVA_HEAP_OPTS} ${JAVA_OPTS} -cp """${JAVA_CLASS_PATH}""" """${JAVA_MAIN_CLASS}""""

Check warning on line 107 in docker/ubi8-init-java21/entrypoint.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docker/ubi8-init-java21/entrypoint.sh#L107

Double quote to prevent globbing and word splitting.

Check warning on line 107 in docker/ubi8-init-java21/entrypoint.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docker/ubi8-init-java21/entrypoint.sh#L107

The surrounding quotes actually unquote this. Remove or escape them.
/usr/bin/env java ${JAVA_HEAP_OPTS} ${JAVA_OPTS} -cp "${JAVA_CLASS_PATH}" "${JAVA_MAIN_CLASS}"
EC="${?}"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END NODE OUTPUT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
Expand Down
342 changes: 307 additions & 35 deletions solo/README.md

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions solo/src/commands/cluster.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class ClusterCommand extends BaseCommand {
task: async (ctx, task) => {
self.configManager.load(argv)
await prompts.execute(task, self.configManager, [
flags.clusterSetupNamespace,
flags.chartDirectory,
flags.fstChartVersion,
flags.deployPrometheusStack,
Expand All @@ -65,7 +66,7 @@ export class ClusterCommand extends BaseCommand {

// prepare config
ctx.config = {
namespace: self.configManager.getFlag(flags.namespace) || constants.DEFAULT_NAMESPACE,
clusterSetupNamespace: self.configManager.getFlag(flags.clusterSetupNamespace),
chartDir: self.configManager.getFlag(flags.chartDirectory),
deployPrometheusStack: self.configManager.getFlag(flags.deployPrometheusStack),
deployMinio: self.configManager.getFlag(flags.deployMinio),
Expand All @@ -76,7 +77,7 @@ export class ClusterCommand extends BaseCommand {

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

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

const chartPath = ctx.chartPath
Expand All @@ -116,7 +117,9 @@ export class ClusterCommand extends BaseCommand {
throw e
}

await self.showInstalledChartList(namespace)
if (argv.dev) {
await self.showInstalledChartList(namespace)
}
},
skip: (ctx, _) => ctx.isChartInstalled
}
Expand Down Expand Up @@ -158,7 +161,7 @@ export class ClusterCommand extends BaseCommand {

self.configManager.load(argv)
const clusterName = self.configManager.getFlag(flags.clusterName)
const namespace = argv.namespace || constants.DEFAULT_NAMESPACE
const namespace = self.configManager.getFlag(flags.clusterSetupNamespace)
ctx.config = {
clusterName,
namespace
Expand All @@ -170,7 +173,7 @@ export class ClusterCommand extends BaseCommand {
{
title: `Uninstall '${constants.FULLSTACK_CLUSTER_SETUP_CHART}' chart`,
task: async (ctx, _) => {
const namespace = ctx.config.namespace
const namespace = ctx.config.clusterSetupNamespace
await self.chartManager.uninstall(namespace, constants.FULLSTACK_CLUSTER_SETUP_CHART)
await self.showInstalledChartList(namespace)
},
Expand Down Expand Up @@ -236,7 +239,7 @@ export class ClusterCommand extends BaseCommand {
desc: 'Setup cluster with shared components',
builder: y => flags.setCommandFlags(y,
flags.clusterName,
flags.namespace,
flags.clusterSetupNamespace,
flags.chartDirectory,
flags.deployPrometheusStack,
flags.deployMinio,
Expand All @@ -262,7 +265,7 @@ export class ClusterCommand extends BaseCommand {
desc: 'Uninstall shared components from cluster',
builder: y => flags.setCommandFlags(y,
flags.clusterName,
flags.namespace
flags.clusterSetupNamespace
),
handler: argv => {
clusterCmd.logger.debug("==== Running 'cluster reset' ===", { argv })
Expand Down
Loading
Loading