Skip to content

Conversation

@maru-ava
Copy link
Contributor

@maru-ava maru-ava commented Apr 9, 2025

PR Chain: tmpnet+kube

This PR chain enables tmpnet to deploy temporary networks to Kubernetes. Early PRs refactor tmpnet to support the addition in #3615 of a new tmpnet node runtime for kube.

Why this should be merged

Cleans up flag usage and configuration network start to ensure consistency and simplify maintenance across e2e and tmpnetctl.

How this was tested

CI

Need to be documented in RELEASES.md?

N/A

TODO

@maru-ava maru-ava added the testing This primarily focuses on testing label Apr 9, 2025
@maru-ava maru-ava self-assigned this Apr 9, 2025
@github-project-automation github-project-automation bot moved this to Backlog 🗄️ in avalanchego Apr 9, 2025
@maru-ava maru-ava requested review from Copilot and qdm12 April 9, 2025 17:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

@maru-ava maru-ava force-pushed the tmpnet-start-network-vars branch 4 times, most recently from 38fbfe6 to 9ca9fdc Compare April 9, 2025 18:09
@maru-ava maru-ava moved this from Backlog 🗄️ to In Review 👀 in avalanchego Apr 9, 2025
@maru-ava maru-ava force-pushed the tmpnet-start-network-vars branch from 9ca9fdc to d6e4603 Compare April 9, 2025 18:14
&vars.startNetwork,
"start-network",
false,
"[optional] start a new network and exit without executing any tests. The new network cannot be reused with --reuse-network. Ignored if either --reuse-network or --stop-network is provided.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it just error out if conflicting flags are used instead of ignoring one flag? That would avoid any surprises

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored to create a 'command' out of the 4 flags and validate provision of more than one.

"network-dir",
"",
fmt.Sprintf("[optional] the dir containing the configuration of an existing network to target for testing. Will only be used if --reuse-network is specified. Also possible to configure via the %s env variable.", tmpnet.NetworkDirEnvName),
fmt.Sprintf("[optional] the dir containing the configuration of an existing network. Will only be used if --reuse-network, --restart-network or --stop-network are specified. Also possible to configure via the %s env variable.", tmpnet.NetworkDirEnvName),
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar here, maybe we could error out if that flag is used without one of the 3 required flags mentioned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to actually source a value from the env var mentioned in the doc string, which means someone having a value set in their env could run afoul of non-empty validation.

@maru-ava maru-ava force-pushed the tmpnet-refactor-runtime-config branch from 7db5b52 to d2c2a0e Compare April 11, 2025 00:09
@maru-ava maru-ava force-pushed the tmpnet-start-network-vars branch 2 times, most recently from 13c3451 to 0ccb028 Compare April 11, 2025 20:48
@maru-ava maru-ava force-pushed the tmpnet-start-network-vars branch 2 times, most recently from d736aec to af712ec Compare April 13, 2025 22:28
Base automatically changed from tmpnet-refactor-runtime-config to master April 14, 2025 16:55
@maru-ava maru-ava force-pushed the tmpnet-start-network-vars branch from af712ec to 196fd09 Compare April 14, 2025 18:01
@maru-ava
Copy link
Contributor Author

Rebased

)
}

func (v *StartNetworkVars) GetNodeCount() (int, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

(No action needed) Could/would it make more sense to validate the node count earlier when it's initialized so that we don't need to check it's value and possibly return an error here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no earlier place to validate it.

@maru-ava maru-ava added this pull request to the merge queue Apr 17, 2025
Merged via the queue into master with commit dd130cf Apr 17, 2025
24 checks passed
@maru-ava maru-ava deleted the tmpnet-start-network-vars branch April 17, 2025 00:21
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in avalanchego Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing This primarily focuses on testing

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants