diff --git a/HelperTasks.yml b/HelperTasks.yml index 7b55cbd5f..bacd8307d 100644 --- a/HelperTasks.yml +++ b/HelperTasks.yml @@ -19,6 +19,10 @@ vars: sh: (echo "/tmp/var-check-$(date +%Y%m%d%H%M%S)") minio_flag_file: sh: (echo "/tmp/minio-flag-$(date +%Y%m%d%H%M%S)") + solo_chart_file: + sh: (echo "/tmp/solo-chart-$(date +%Y%m%d%H%M%S)") + solo_consensus_file: + sh: (echo "/tmp/solo-consensus-$(date +%Y%m%d%H%M%S)") env: SOLO_CLUSTER_SETUP_NAMESPACE: solo-setup @@ -47,8 +51,6 @@ tasks: - node_list_internal - node_identifiers - run_build_file - - SOLO_CHART_VERSION - - CONSENSUS_NODE_VERSION - SOLO_NAMESPACE - SOLO_CLUSTER_SETUP_NAMESPACE - SOLO_CLUSTER_RELEASE_NAME @@ -158,8 +160,15 @@ tasks: if [[ "${LOCAL_BUILD_FLAG}" == "" ]]; then export RELEASE_FLAG='--release-tag {{.CONSENSUS_NODE_VERSION}}' fi - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- network deploy --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${RELEASE_FLAG} --solo-chart-version "${SOLO_CHART_VERSION}" ${VALUES_FLAG} ${SETTINGS_FLAG} ${LOG4J2_FLAG} ${APPLICATION_PROPERTIES_FLAG} -q - - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- node setup --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} --release-tag "${CONSENSUS_NODE_VERSION}" ${LOCAL_BUILD_FLAG} -q + if [[ "${SOLO_CHART_VERSION}" != "" ]]; then + export SOLO_CHART_FLAG='--solo-chart-version ${SOLO_CHART_VERSION}' + fi + SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- network deploy --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${RELEASE_FLAG} ${SOLO_CHART_FLAG} ${VALUES_FLAG} ${SETTINGS_FLAG} ${LOG4J2_FLAG} ${APPLICATION_PROPERTIES_FLAG} -q + - | + if [[ "${CONSENSUS_NODE_VERSION}" != "" ]]; then + export CONSENSUS_NODE_FLAG='--release-tag ${CONSENSUS_NODE_VERSION}' + fi + SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- node setup --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${CONSENSUS_NODE_FLAG} ${LOCAL_BUILD_FLAG} -q solo:network:destroy: internal: true @@ -211,24 +220,30 @@ tasks: - SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 -q solo:cache:remove: + silent: true internal: true status: - test [[ ! -d {{ .solo_cache_dir }} ]] cmds: + - echo "Removing solo cache directory..." - rm -rf {{ .solo_cache_dir }} solo:logs:remove: + silent: true internal: true status: - test [[ ! -d {{ .solo_logs_dir }} ]] cmds: + - echo "Removing solo logs directory..." - rm -rf {{ .solo_logs_dir }} solo:config:remove: + silent: true internal: true status: - test [[ ! -f {{ .solo_user_dir }}/solo.yaml ]] cmds: + - echo "Removing solo config..." - rm -rf {{ .solo_user_dir }}/solo.yaml cluster:create: @@ -250,7 +265,9 @@ tasks: - kind delete cluster --name "${SOLO_CLUSTER_NAME}" clean:port-forward: + silent: true cmds: + - echo "Cleaning up port forwards..." - | if [[ "{{ .use_port_forwards }}" == "true" ]];then pkill -f "kubectl port-forward -n {{ .SOLO_NAMESPACE }}" | grep -w ${UID} || true @@ -384,3 +401,15 @@ tasks: - task: "clean:logs" - task: "solo:config:remove" - task: "clean:port-forward" + - task: "clean:tmp" + + clean:tmp: + desc: remove temporary files + silent: true + cmds: + - echo "Cleaning up temporary files..." + - rm -f /tmp/run-build-* + - rm -f /tmp/var-check-* + - rm -f /tmp/minio-flag-* + - rm -f /tmp/solo-chart-* + - rm -f /tmp/solo-consensus-* diff --git a/Taskfile.yml b/Taskfile.yml index 342ebaca4..e03d96a28 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,8 +6,8 @@ includes: env: SOLO_NETWORK_SIZE: 2 SOLO_NAMESPACE: solo-e2e - SOLO_CHART_VERSION: 0.36.3 - CONSENSUS_NODE_VERSION: v0.58.0 + # SOLO_CHART_VERSION: 0.39.0 + # CONSENSUS_NODE_VERSION: v0.58.0 vars: use_port_forwards: "true" diff --git a/examples/custom-network-config/Taskfile.yml b/examples/custom-network-config/Taskfile.yml index 51aa756f1..7d888c8b5 100644 --- a/examples/custom-network-config/Taskfile.yml +++ b/examples/custom-network-config/Taskfile.yml @@ -6,8 +6,8 @@ includes: env: SOLO_NETWORK_SIZE: 10 SOLO_NAMESPACE: solo-alex-kuzmin-n4 - SOLO_CHART_VERSION: 0.36.3 - CONSENSUS_NODE_VERSION: v0.58.0 + # SOLO_CHART_VERSION: 0.39.0 + # CONSENSUS_NODE_VERSION: v0.58.0 VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml" SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt" SOLO_HOME: "/Users/user/.solo-alex-kuzmin-n4" diff --git a/examples/performance-tuning/Latitude/Taskfile.yml b/examples/performance-tuning/Latitude/Taskfile.yml index 747ed22fc..dff796a7f 100644 --- a/examples/performance-tuning/Latitude/Taskfile.yml +++ b/examples/performance-tuning/Latitude/Taskfile.yml @@ -7,9 +7,9 @@ vars: solo_home_override_dir: "%HOME%/.solo" env: SOLO_NETWORK_SIZE: 10 - SOLO_NAMESPACE: %SOLO_NAMESPACE% - SOLO_CHART_VERSION: 0.36.3 - CONSENSUS_NODE_VERSION: 0.0.0 + SOLO_NAMESPACE: "{{.SOLO_NAMESPACE}}" + # SOLO_CHART_VERSION: 0.39.0 + # CONSENSUS_NODE_VERSION: 0.0.0 VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml" SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt" SOLO_HOME: "{{.solo_home_override_dir}}" diff --git a/examples/performance-tuning/solo-perf-test/Taskfile.yml b/examples/performance-tuning/solo-perf-test/Taskfile.yml index 3961c47ff..9cdfefb03 100644 --- a/examples/performance-tuning/solo-perf-test/Taskfile.yml +++ b/examples/performance-tuning/solo-perf-test/Taskfile.yml @@ -6,8 +6,8 @@ includes: env: SOLO_NETWORK_SIZE: 7 SOLO_NAMESPACE: solo-perf-test - SOLO_CHART_VERSION: 0.36.3 - CONSENSUS_NODE_VERSION: v0.58.0 + # SOLO_CHART_VERSION: 0.39.0 + # CONSENSUS_NODE_VERSION: v0.58.0 VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml" SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt" SOLO_HOME: "/Users/user/.solo-perf-test" diff --git a/examples/solo-gke-test/Taskfile.yml b/examples/solo-gke-test/Taskfile.yml index 6be48f5c1..07ab69c63 100644 --- a/examples/solo-gke-test/Taskfile.yml +++ b/examples/solo-gke-test/Taskfile.yml @@ -8,8 +8,8 @@ vars: env: SOLO_NETWORK_SIZE: 5 SOLO_NAMESPACE: solo-gke-test - SOLO_CHART_VERSION: 0.36.3 - CONSENSUS_NODE_VERSION: v0.58.0 + # SOLO_CHART_VERSION: 0.39.0 + # CONSENSUS_NODE_VERSION: v0.58.0 VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml" SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt" SOLO_HOME: "{{.solo_home_override_dir}}" diff --git a/src/commands/flags.ts b/src/commands/flags.ts index 3608799f0..498640886 100644 --- a/src/commands/flags.ts +++ b/src/commands/flags.ts @@ -436,9 +436,9 @@ export class Flags { return await Flags.promptText( task, input, - 'v0.42.5', + version.HEDERA_PLATFORM_VERSION, 'Enter release version: ', - 'release tag cannot be empty', + undefined, Flags.releaseTag.name, ); }, diff --git a/src/core/profile_manager.ts b/src/core/profile_manager.ts index 3c0c81656..eaccf31b5 100644 --- a/src/core/profile_manager.ts +++ b/src/core/profile_manager.ts @@ -36,6 +36,7 @@ import type {GenesisNetworkDataConstructor} from './genesis_network_models/genes import type {Optional} from '../types/index.js'; import {inject, injectable} from 'tsyringe-neo'; import {patchInject} from './container_helper.js'; +import {HEDERA_PLATFORM_VERSION} from '../../version.js'; const consensusSidecars = [ 'recordStreamUploader', @@ -486,16 +487,17 @@ export class ProfileManager { namespace: string, nodeAccountMap: Map, destPath: string, - releaseTag: string, + releaseTagOverride: string, appName = constants.HEDERA_APP_NAME, chainId = constants.HEDERA_CHAIN_ID, genesisNetworkData?: GenesisNetworkDataConstructor, ) { + let releaseTag = releaseTagOverride; if (!nodeAccountMap || nodeAccountMap.size === 0) { throw new MissingArgumentError('nodeAccountMap the map of node IDs to account IDs is required'); } - if (!releaseTag) throw new MissingArgumentError('release tag is required'); + if (!releaseTag) releaseTag = HEDERA_PLATFORM_VERSION; if (!fs.existsSync(destPath)) { throw new IllegalArgumentError(`config destPath does not exist: ${destPath}`, destPath); diff --git a/src/core/templates.ts b/src/core/templates.ts index a4274bd59..06f91be0b 100644 --- a/src/core/templates.ts +++ b/src/core/templates.ts @@ -24,6 +24,7 @@ import type {IP, NodeAlias, NodeId, PodName} from '../types/aliases.js'; import {GrpcProxyTlsEnums} from './enumerations.js'; import {type ContextClusterStructure} from '../types/config_types.js'; import type {Cluster, Context, Namespace} from './config/remote/types.js'; +import {HEDERA_PLATFORM_VERSION} from '../../version.js'; export class Templates { public static renderNetworkPodName(nodeAlias: NodeAlias): PodName { @@ -119,13 +120,14 @@ export class Templates { return new x509.Name(`CN=${nodeAlias},ST=${state},L=${locality},O=${org},OU=${orgUnit},C=${country}`); } - public static renderStagingDir(cacheDir: string, releaseTag: string): string { + public static renderStagingDir(cacheDir: string, releaseTagOverride: string): string { + let releaseTag = releaseTagOverride; if (!cacheDir) { throw new IllegalArgumentError('cacheDir cannot be empty'); } if (!releaseTag) { - throw new IllegalArgumentError('releaseTag cannot be empty'); + releaseTag = HEDERA_PLATFORM_VERSION; } const releasePrefix = this.prepareReleasePrefix(releaseTag); diff --git a/test/unit/core/profile_manager.test.ts b/test/unit/core/profile_manager.test.ts index 180b6ea0a..aa6093b80 100644 --- a/test/unit/core/profile_manager.test.ts +++ b/test/unit/core/profile_manager.test.ts @@ -229,14 +229,6 @@ describe('ProfileManager', () => { ); }); - it('should fail when no releaseTag is provided', () => { - const nodeAccountMap = new Map(); - nodeAccountMap.set('node1', '0.0.3'); - expect(() => profileManager.prepareConfigTxt('', nodeAccountMap, '', undefined)).to.throw( - 'release tag is required', - ); - }); - it('should fail when destPath does not exist', () => { const nodeAccountMap = new Map(); nodeAccountMap.set('node1', '0.0.3');