Skip to content

Commit e590516

Browse files
fix: fixed genesis-network.json file lock issue (#1074)
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent b9f2e1c commit e590516

File tree

10 files changed

+54
-29
lines changed

10 files changed

+54
-29
lines changed

HelperTasks.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ vars:
1919
sh: (echo "/tmp/var-check-$(date +%Y%m%d%H%M%S)")
2020
minio_flag_file:
2121
sh: (echo "/tmp/minio-flag-$(date +%Y%m%d%H%M%S)")
22+
solo_chart_file:
23+
sh: (echo "/tmp/solo-chart-$(date +%Y%m%d%H%M%S)")
24+
solo_consensus_file:
25+
sh: (echo "/tmp/solo-consensus-$(date +%Y%m%d%H%M%S)")
2226

2327
env:
2428
SOLO_CLUSTER_SETUP_NAMESPACE: solo-setup
@@ -47,8 +51,6 @@ tasks:
4751
- node_list_internal
4852
- node_identifiers
4953
- run_build_file
50-
- SOLO_CHART_VERSION
51-
- CONSENSUS_NODE_VERSION
5254
- SOLO_NAMESPACE
5355
- SOLO_CLUSTER_SETUP_NAMESPACE
5456
- SOLO_CLUSTER_RELEASE_NAME
@@ -158,8 +160,15 @@ tasks:
158160
if [[ "${LOCAL_BUILD_FLAG}" == "" ]]; then
159161
export RELEASE_FLAG='--release-tag {{.CONSENSUS_NODE_VERSION}}'
160162
fi
161-
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
162-
- 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
163+
if [[ "${SOLO_CHART_VERSION}" != "" ]]; then
164+
export SOLO_CHART_FLAG='--solo-chart-version ${SOLO_CHART_VERSION}'
165+
fi
166+
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
167+
- |
168+
if [[ "${CONSENSUS_NODE_VERSION}" != "" ]]; then
169+
export CONSENSUS_NODE_FLAG='--release-tag ${CONSENSUS_NODE_VERSION}'
170+
fi
171+
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
163172
164173
solo:network:destroy:
165174
internal: true
@@ -211,24 +220,30 @@ tasks:
211220
- SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- relay destroy -n "${SOLO_NAMESPACE}" -i node1 -q
212221

213222
solo:cache:remove:
223+
silent: true
214224
internal: true
215225
status:
216226
- test [[ ! -d {{ .solo_cache_dir }} ]]
217227
cmds:
228+
- echo "Removing solo cache directory..."
218229
- rm -rf {{ .solo_cache_dir }}
219230

220231
solo:logs:remove:
232+
silent: true
221233
internal: true
222234
status:
223235
- test [[ ! -d {{ .solo_logs_dir }} ]]
224236
cmds:
237+
- echo "Removing solo logs directory..."
225238
- rm -rf {{ .solo_logs_dir }}
226239

227240
solo:config:remove:
241+
silent: true
228242
internal: true
229243
status:
230244
- test [[ ! -f {{ .solo_user_dir }}/solo.yaml ]]
231245
cmds:
246+
- echo "Removing solo config..."
232247
- rm -rf {{ .solo_user_dir }}/solo.yaml
233248

234249
cluster:create:
@@ -250,7 +265,9 @@ tasks:
250265
- kind delete cluster --name "${SOLO_CLUSTER_NAME}"
251266

252267
clean:port-forward:
268+
silent: true
253269
cmds:
270+
- echo "Cleaning up port forwards..."
254271
- |
255272
if [[ "{{ .use_port_forwards }}" == "true" ]];then
256273
pkill -f "kubectl port-forward -n {{ .SOLO_NAMESPACE }}" | grep -w ${UID} || true
@@ -384,3 +401,15 @@ tasks:
384401
- task: "clean:logs"
385402
- task: "solo:config:remove"
386403
- task: "clean:port-forward"
404+
- task: "clean:tmp"
405+
406+
clean:tmp:
407+
desc: remove temporary files
408+
silent: true
409+
cmds:
410+
- echo "Cleaning up temporary files..."
411+
- rm -f /tmp/run-build-*
412+
- rm -f /tmp/var-check-*
413+
- rm -f /tmp/minio-flag-*
414+
- rm -f /tmp/solo-chart-*
415+
- rm -f /tmp/solo-consensus-*

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ includes:
66
env:
77
SOLO_NETWORK_SIZE: 2
88
SOLO_NAMESPACE: solo-e2e
9-
SOLO_CHART_VERSION: 0.36.3
10-
CONSENSUS_NODE_VERSION: v0.58.0
9+
# SOLO_CHART_VERSION: 0.39.0
10+
# CONSENSUS_NODE_VERSION: v0.58.0
1111
vars:
1212
use_port_forwards: "true"
1313

examples/custom-network-config/Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ includes:
66
env:
77
SOLO_NETWORK_SIZE: 10
88
SOLO_NAMESPACE: solo-alex-kuzmin-n4
9-
SOLO_CHART_VERSION: 0.36.3
10-
CONSENSUS_NODE_VERSION: v0.58.0
9+
# SOLO_CHART_VERSION: 0.39.0
10+
# CONSENSUS_NODE_VERSION: v0.58.0
1111
VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml"
1212
SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt"
1313
SOLO_HOME: "/Users/user/.solo-alex-kuzmin-n4"

examples/performance-tuning/Latitude/Taskfile.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ vars:
77
solo_home_override_dir: "%HOME%/.solo"
88
env:
99
SOLO_NETWORK_SIZE: 10
10-
SOLO_NAMESPACE: %SOLO_NAMESPACE%
11-
SOLO_CHART_VERSION: 0.36.3
12-
CONSENSUS_NODE_VERSION: 0.0.0
10+
SOLO_NAMESPACE: "{{.SOLO_NAMESPACE}}"
11+
# SOLO_CHART_VERSION: 0.39.0
12+
# CONSENSUS_NODE_VERSION: 0.0.0
1313
VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml"
1414
SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt"
1515
SOLO_HOME: "{{.solo_home_override_dir}}"

examples/performance-tuning/solo-perf-test/Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ includes:
66
env:
77
SOLO_NETWORK_SIZE: 7
88
SOLO_NAMESPACE: solo-perf-test
9-
SOLO_CHART_VERSION: 0.36.3
10-
CONSENSUS_NODE_VERSION: v0.58.0
9+
# SOLO_CHART_VERSION: 0.39.0
10+
# CONSENSUS_NODE_VERSION: v0.58.0
1111
VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml"
1212
SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt"
1313
SOLO_HOME: "/Users/user/.solo-perf-test"

examples/solo-gke-test/Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ vars:
88
env:
99
SOLO_NETWORK_SIZE: 5
1010
SOLO_NAMESPACE: solo-gke-test
11-
SOLO_CHART_VERSION: 0.36.3
12-
CONSENSUS_NODE_VERSION: v0.58.0
11+
# SOLO_CHART_VERSION: 0.39.0
12+
# CONSENSUS_NODE_VERSION: v0.58.0
1313
VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml"
1414
SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt"
1515
SOLO_HOME: "{{.solo_home_override_dir}}"

src/commands/flags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ export class Flags {
436436
return await Flags.promptText(
437437
task,
438438
input,
439-
'v0.42.5',
439+
version.HEDERA_PLATFORM_VERSION,
440440
'Enter release version: ',
441-
'release tag cannot be empty',
441+
undefined,
442442
Flags.releaseTag.name,
443443
);
444444
},

src/core/profile_manager.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import type {GenesisNetworkDataConstructor} from './genesis_network_models/genes
3636
import type {Optional} from '../types/index.js';
3737
import {inject, injectable} from 'tsyringe-neo';
3838
import {patchInject} from './container_helper.js';
39+
import {HEDERA_PLATFORM_VERSION} from '../../version.js';
3940

4041
const consensusSidecars = [
4142
'recordStreamUploader',
@@ -486,16 +487,17 @@ export class ProfileManager {
486487
namespace: string,
487488
nodeAccountMap: Map<NodeAlias, string>,
488489
destPath: string,
489-
releaseTag: string,
490+
releaseTagOverride: string,
490491
appName = constants.HEDERA_APP_NAME,
491492
chainId = constants.HEDERA_CHAIN_ID,
492493
genesisNetworkData?: GenesisNetworkDataConstructor,
493494
) {
495+
let releaseTag = releaseTagOverride;
494496
if (!nodeAccountMap || nodeAccountMap.size === 0) {
495497
throw new MissingArgumentError('nodeAccountMap the map of node IDs to account IDs is required');
496498
}
497499

498-
if (!releaseTag) throw new MissingArgumentError('release tag is required');
500+
if (!releaseTag) releaseTag = HEDERA_PLATFORM_VERSION;
499501

500502
if (!fs.existsSync(destPath)) {
501503
throw new IllegalArgumentError(`config destPath does not exist: ${destPath}`, destPath);

src/core/templates.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import type {IP, NodeAlias, NodeId, PodName} from '../types/aliases.js';
2424
import {GrpcProxyTlsEnums} from './enumerations.js';
2525
import {type ContextClusterStructure} from '../types/config_types.js';
2626
import type {Cluster, Context, Namespace} from './config/remote/types.js';
27+
import {HEDERA_PLATFORM_VERSION} from '../../version.js';
2728

2829
export class Templates {
2930
public static renderNetworkPodName(nodeAlias: NodeAlias): PodName {
@@ -119,13 +120,14 @@ export class Templates {
119120
return new x509.Name(`CN=${nodeAlias},ST=${state},L=${locality},O=${org},OU=${orgUnit},C=${country}`);
120121
}
121122

122-
public static renderStagingDir(cacheDir: string, releaseTag: string): string {
123+
public static renderStagingDir(cacheDir: string, releaseTagOverride: string): string {
124+
let releaseTag = releaseTagOverride;
123125
if (!cacheDir) {
124126
throw new IllegalArgumentError('cacheDir cannot be empty');
125127
}
126128

127129
if (!releaseTag) {
128-
throw new IllegalArgumentError('releaseTag cannot be empty');
130+
releaseTag = HEDERA_PLATFORM_VERSION;
129131
}
130132

131133
const releasePrefix = this.prepareReleasePrefix(releaseTag);

test/unit/core/profile_manager.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ describe('ProfileManager', () => {
229229
);
230230
});
231231

232-
it('should fail when no releaseTag is provided', () => {
233-
const nodeAccountMap = new Map<NodeAlias, string>();
234-
nodeAccountMap.set('node1', '0.0.3');
235-
expect(() => profileManager.prepareConfigTxt('', nodeAccountMap, '', undefined)).to.throw(
236-
'release tag is required',
237-
);
238-
});
239-
240232
it('should fail when destPath does not exist', () => {
241233
const nodeAccountMap = new Map<NodeAlias, string>();
242234
nodeAccountMap.set('node1', '0.0.3');

0 commit comments

Comments
 (0)