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: Separate concepts for namespace and deployment name #1231

Merged

Conversation

Ivo-Yankov
Copy link
Contributor

@Ivo-Yankov Ivo-Yankov commented Jan 29, 2025

Description

  • Adds a deploymentName concept for the LocalConfig, which is now the key is the deployments map.
  • Adds a namespace field in the Deployment type used in LocalConfig.
  • Adds a deployment flag to solo deployment create and solo cluster connect
  • Removes the namespace flag from all commands except solo deployment create and solo cluster connect and adds a required deployment flag instead.

All scripts will need updating once this PR is merged. The namespace is still present in the business logic, but it is now resolved from the provided deployment. All commands now require an existing LocalConfig, so the command solo deployment create needs to be executed before deploying the network.

export SOLO_CLUSTER_NAME=solo-e2e
export SOLO_NAMESPACE=solo-e2e
export SOLO_CLUSTER_SETUP_NAMESPACE=fullstack-setup
export SOLO_DEPLOYMENT=solo-dep-e2e
kind create cluster -n "${SOLO_NAMESPACE}"
npm run solo -- init
npm run solo -- deployment create -n "${SOLO_CLUSTER_NAME}" --context kind-"${SOLO_CLUSTER_NAME}" --email john@doe.com --dev true --deployment-clusters kind-"${SOLO_CLUSTER_NAME}" --deployment "${SOLO_DEPLOYMENT}"
npm run solo -- node keys --gossip-keys --tls-keys -i node1
npm run solo -- cluster setup
npm run solo -- network deploy -i node1 --deployment "${SOLO_DEPLOYMENT}"
npm run solo -- node setup -i node1 --deployment "${SOLO_DEPLOYMENT}"
npm run solo -- node start -i node1 --deployment "${SOLO_DEPLOYMENT}"

Related Issues

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Copy link
Contributor

github-actions bot commented Jan 29, 2025

Unit Test Results - Linux

  1 files  ±0   59 suites  ±0   2s ⏱️ ±0s
231 tests  - 4  231 ✅  - 4  0 💤 ±0  0 ❌ ±0 
240 runs  ±0  240 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 0467859. ± Comparison against base commit 2874f3f.

This pull request removes 4 tests.
should update clusterContextMapping with provided context ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update clusterContextMapping with provided context
should update multiple clusterContextMappings with default KubeConfig context if quiet=true ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with default KubeConfig context if quiet=true
should update multiple clusterContextMappings with prompted context no value was provided ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with prompted context no value was provided
should update multiple clusterContextMappings with provided contexts ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with provided contexts

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jan 29, 2025

Unit Test Results - Windows

  1 files  ±0   59 suites  ±0   3s ⏱️ -1s
231 tests  - 4  231 ✅  - 4  0 💤 ±0  0 ❌ ±0 
240 runs  ±0  240 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 0467859. ± Comparison against base commit 2874f3f.

This pull request removes 4 tests.
should update clusterContextMapping with provided context ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update clusterContextMapping with provided context
should update multiple clusterContextMappings with default KubeConfig context if quiet=true ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with default KubeConfig context if quiet=true
should update multiple clusterContextMappings with prompted context no value was provided ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with prompted context no value was provided
should update multiple clusterContextMappings with provided contexts ‑ ClusterCommand unit tests cluster connect updateLocalConfig should update multiple clusterContextMappings with provided contexts

♻️ This comment has been updated with latest results.

Copy link
Contributor

E2E Test Report

 17 files  ±0  126 suites  ±0   1h 26m 16s ⏱️ -1s
258 tests ±0  258 ✅ ±0  0 💤 ±0  0 ❌ ±0 
269 runs  ±0  269 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 541dc2b. ± Comparison against base commit 71e56a9.

This pull request removes 8 and adds 8 tests. Note that renamed tests count towards both.
Attempting to load and save without existing remote config should fail ‑ E2E Test Suite for 'remote-config-manager-e2e' remote-config-manager-e2e RemoteConfigManager Attempting to load and save without existing remote config should fail
generate key files ‑ E2E Test Suite for 'remote-config-manager-e2e' Bootstrap network for test [release v0.59.0-main.x5322bdc] generate key files
isLoaded() should return false if config is not loaded ‑ E2E Test Suite for 'remote-config-manager-e2e' remote-config-manager-e2e RemoteConfigManager isLoaded() should return false if config is not loaded
isLoaded() should return true if config is loaded ‑ E2E Test Suite for 'remote-config-manager-e2e' remote-config-manager-e2e RemoteConfigManager isLoaded() should return true if config is loaded
should be able to mutate remote config with the modify method ‑ E2E Test Suite for 'remote-config-manager-e2e' remote-config-manager-e2e RemoteConfigManager should be able to mutate remote config with the modify method
should be able to use create method to populate the configMap ‑ E2E Test Suite for 'remote-config-manager-e2e' remote-config-manager-e2e RemoteConfigManager should be able to use create method to populate the configMap
should cleanup previous deployment ‑ E2E Test Suite for 'remote-config-manager-e2e' Bootstrap network for test [release v0.59.0-main.x5322bdc] should cleanup previous deployment
should succeed with network deploy ‑ E2E Test Suite for 'remote-config-manager-e2e' Bootstrap network for test [release v0.59.0-main.x5322bdc] should succeed with network deploy
Attempting to load and save without existing remote config should fail ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' remote-config-manager-e2e-namespace RemoteConfigManager Attempting to load and save without existing remote config should fail
generate key files ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' Bootstrap network for test [release v0.59.0-main.x5322bdc] generate key files
isLoaded() should return false if config is not loaded ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' remote-config-manager-e2e-namespace RemoteConfigManager isLoaded() should return false if config is not loaded
isLoaded() should return true if config is loaded ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' remote-config-manager-e2e-namespace RemoteConfigManager isLoaded() should return true if config is loaded
should be able to mutate remote config with the modify method ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' remote-config-manager-e2e-namespace RemoteConfigManager should be able to mutate remote config with the modify method
should be able to use create method to populate the configMap ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' remote-config-manager-e2e-namespace RemoteConfigManager should be able to use create method to populate the configMap
should cleanup previous deployment ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' Bootstrap network for test [release v0.59.0-main.x5322bdc] should cleanup previous deployment
should succeed with network deploy ‑ E2E Test Suite for 'remote-config-manager-e2e-namespace' Bootstrap network for test [release v0.59.0-main.x5322bdc] should succeed with network deploy

Copy link
Contributor

github-actions bot commented Jan 29, 2025

E2E Test Report

 17 files  ±0  126 suites  ±0   1h 28m 21s ⏱️ +13s
254 tests ±0  254 ✅ ±0  0 💤 ±0  0 ❌ ±0 
265 runs  ±0  265 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 0467859. ± Comparison against base commit 2874f3f.

♻️ This comment has been updated with latest results.

Copy link

codacy-production bot commented Jan 29, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.48% (target: -1.00%) 81.62%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2874f3f) 22163 18431 83.16%
Head commit (0467859) 22278 (+115) 18420 (-11) 82.68% (-0.48%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1231) 234 191 81.62%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 81.19658% with 44 lines in your changes missing coverage. Please review.

Project coverage is 82.08%. Comparing base (2874f3f) to head (0467859).
Report is 94 commits behind head on main.

Files with missing lines Patch % Lines
src/core/config/local_config.ts 0.00% 7 Missing ⚠️
src/commands/account.ts 70.58% 5 Missing ⚠️
src/commands/network.ts 66.66% 5 Missing ⚠️
src/commands/node/configs.ts 90.90% 5 Missing ⚠️
src/commands/explorer.ts 75.00% 4 Missing ⚠️
src/commands/mirror_node.ts 77.77% 4 Missing ⚠️
src/commands/node/handlers.ts 33.33% 4 Missing ⚠️
src/commands/cluster/tasks.ts 89.47% 1 Missing and 1 partial ⚠️
src/commands/relay.ts 80.00% 2 Missing ⚠️
src/core/config/remote/remote_config_manager.ts 50.00% 2 Missing ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1231      +/-   ##
==========================================
- Coverage   82.17%   82.08%   -0.09%     
==========================================
  Files         107      108       +1     
  Lines       22163    22278     +115     
  Branches     2174     1450     -724     
==========================================
+ Hits        18213    18288      +75     
- Misses       3766     3930     +164     
+ Partials      184       60     -124     
Files with missing lines Coverage Δ
src/commands/cluster/flags.ts 100.00% <100.00%> (ø)
src/commands/flags.ts 76.23% <100.00%> (-0.22%) ⬇️
src/commands/node/flags.ts 100.00% <100.00%> (ø)
src/core/container_init.ts 94.36% <100.00%> (ø)
src/core/resolvers.ts 100.00% <100.00%> (ø)
src/core/validator_decorators.ts 100.00% <100.00%> (+1.53%) ⬆️
src/commands/cluster/handlers.ts 83.08% <80.00%> (ø)
src/commands/cluster/index.ts 32.63% <0.00%> (ø)
src/core/config/remote/listr_config_tasks.ts 59.03% <0.00%> (ø)
src/core/error_messages.ts 86.36% <66.66%> (-3.64%) ⬇️
... and 10 more

... and 34 files with indirect coverage changes

Impacted file tree graph

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@Ivo-Yankov Ivo-Yankov marked this pull request as ready for review January 30, 2025 14:05
@Ivo-Yankov Ivo-Yankov requested review from leninmehedy and a team as code owners January 30, 2025 14:05
@Ivo-Yankov Ivo-Yankov added the PR: Needs Team Approval A pull request that needs review from a team member. label Jan 30, 2025
Copy link
Contributor

@jeromy-cannon jeromy-cannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed the following task in the GHI:

update all of the subcommands that are currently leveraging --namespace and instead use --deployment

If you want to split it into multiple PRs, then update the description to not close the issue.

@jeromy-cannon jeromy-cannon added PR: Unresolved Comments A pull request where there are comments and they need to be resolved. and removed PR: Needs Team Approval A pull request that needs review from a team member. labels Jan 30, 2025
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@jeromy-cannon jeromy-cannon added the PR: Merge Conflicts A pull request that has merge conflicts that need to be resolved. label Jan 31, 2025
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
…separate-concepts

# Conflicts:
#	src/commands/cluster/tasks.ts
#	src/commands/deployment.ts
#	src/core/config/local_config.ts
#	src/core/config/local_config_data.ts
#	src/core/config/remote/remote_config_manager.ts
#	src/core/helpers.ts
@Ivo-Yankov Ivo-Yankov removed the PR: Unresolved Comments A pull request where there are comments and they need to be resolved. label Jan 31, 2025
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@Ivo-Yankov Ivo-Yankov marked this pull request as ready for review February 6, 2025 15:55
@Ivo-Yankov Ivo-Yankov requested review from a team as code owners February 6, 2025 15:55
@Ivo-Yankov Ivo-Yankov added PR: Needs Team Approval A pull request that needs review from a team member. and removed PR: Checks Failed A pull request where the checks have failed. PR: Unresolved Comments A pull request where there are comments and they need to be resolved. PR: Merge Conflicts A pull request that has merge conflicts that need to be resolved. labels Feb 6, 2025
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
…separate-concepts

# Conflicts:
#	test/unit/commands/network.test.ts
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@Ivo-Yankov Ivo-Yankov merged commit 2566c90 into main Feb 7, 2025
40 of 43 checks passed
@Ivo-Yankov Ivo-Yankov deleted the 01194-split-deployment-and-namespace-as-two-separate-concepts branch February 7, 2025 14:48
swirlds-automation added a commit that referenced this pull request Feb 20, 2025
## [0.35.0](v0.34.0...v0.35.0) (2025-02-20)

### Features

* Add adminKey flag to node setup command ([#1193](#1193)) ([b044fcc](b044fcc))
* add BaseCommand.getConsensusNodes() method ([#1364](#1364)) ([44703a4](44703a4))
* add BaseCommand.getContexts() method ([#1366](#1366)) ([7a5b05b](7a5b05b))
* add basic multi-cluster support to `solo network deploy` ([#1389](#1389)) ([22ed9ae](22ed9ae))
* add clusters fluent interface implementation ([#1291](#1291)) ([95c71f0](95c71f0))
* add concurrent to the task of copying hedera jar files to network node ([#1289](#1289)) ([c50f4c3](c50f4c3))
* add configmaps fluent interface implementation ([#1295](#1295)) ([2c5d6f3](2c5d6f3))
* add contexts fluent interface implementation ([#1297](#1297)) ([938a956](938a956))
* add factory and injection logic ([#1352](#1352)) ([c794610](c794610))
* add flags to support aws as storage destination ([#1372](#1372)) ([5ca0e47](5ca0e47))
* add secrets fluent interface implementation ([#1312](#1312)) ([fb92fd6](fb92fd6))
* add service and services fluent interface implementation ([#1303](#1303)) ([8ef6998](8ef6998))
* add support for --force-port-forward as a top level flag ([#1404](#1404)) ([5c18967](5c18967))
* add support for multi-cluster testing via KinD ([#1392](#1392)) ([ec7eca1](ec7eca1))
* add support for using load balancer address in gossip configuration ([#1405](#1405)) ([0e3f41f](0e3f41f))
* **cli:** add new command `solo deployment list` that lists deployments on that specific cluster ([#1220](#1220)) ([6b0b486](6b0b486))
* **cli:** reduce redundancy on context to cluster flags in command `deployment create` ([#1156](#1156)) ([4ab4dd5](4ab4dd5))
* create the v059x node-override.yaml via solo ([#1192](#1192)) ([283d35c](283d35c))
* **external-database:** add ability to pass readonly user to the external database ([#1350](#1350)) ([d9626ac](d9626ac))
* **local-remote-config:** added solo version to local config and remote config ([#1384](#1384)) ([2dca095](2dca095))
* **mirror-node:** Enhance mirror-node external database feature ([#1230](#1230)) ([bce75d5](bce75d5))
* **multi-cluster:** 'solo relay deploy' to handle cluster-ref value ([#1394](#1394)) ([e73114c](e73114c))
* **multi-cluster:** make remote config validation compatible with multi-cluster K8 implementation ([#1407](#1407)) ([7614a39](7614a39))
* **multi-cluster:** Update `solo node setup` to support multiple clusters ([#1368](#1368)) ([4618a43](4618a43))
* **remote-config:** instead of keeping just the command and the subcommand inside the remote config keep the flags as passed ([#1208](#1208)) ([a31498e](a31498e))
* **remote-config:** save reusable solo flags in remoteconfig ([#1191](#1191)) ([809d0ab](809d0ab))
* Separate concepts for namespace and deployment name ([#1231](#1231)) ([2566c90](2566c90))
* update solo to support pathPrefix of mirror node importer ([#1204](#1204)) ([d9a3592](d9a3592))

### Bug Fixes

* ensure network active check supports multi-cluster deployments ([#1431](#1431)) ([a07801f](a07801f))
* ensure staking updates support multi-cluster deployments  ([#1432](#1432)) ([ef5435e](ef5435e))
* fixed issue with taskfile forcing an incorrect cluster and context and added a dual cluster readme ([#1396](#1396)) ([cc672c2](cc672c2))
* fixed merge issue with incorrect license header ([#1235](#1235)) ([cb91806](cb91806))
* increase number of attempts to wait for active nodes ([#1430](#1430)) ([d113167](d113167))
* mirror node command changes required for multi-cluster support ([#1433](#1433)) ([f43870e](f43870e))
* **multi-cluster:** fix 'solo node setup' command, failing when running multiple clusters ([#1421](#1421)) ([eacdf1f](eacdf1f))
* **network-command:** wrong value passed to addDebugOptions inside the 'network' command ([#1415](#1415)) ([c2e5c3b](c2e5c3b))
* Resolve `cannot read properties of undefined `error thrown during `solo network deploy` ([#1410](#1410)) ([401b937](401b937))
* test script of google storage ([#1397](#1397)) ([370f57b](370f57b))
* update default solo helm chart version ([#1378](#1378)) ([5b5e276](5b5e276))
* update RemoteConfig to handle multi-cluster networking ([#1348](#1348)) ([77b769f](77b769f))
* use better internal IPs for 0.58.5+ ([#1429](#1429)) ([26279ac](26279ac))
@swirlds-automation
Copy link
Contributor

🎉 This PR is included in version 0.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@swirlds-automation
Copy link
Contributor

🎉 This PR is included in version 0.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Needs Team Approval A pull request that needs review from a team member. released on @0.35.x released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

split deployment and namespace as two separate concepts
3 participants