docs: add documentation for provision and validate commands#618
docs: add documentation for provision and validate commands#618ArangoGutierrez wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
Adds a new `holodeck validate -f env.yaml` command that checks: - Environment file is valid YAML - Required fields are present (provider, keyName, region, etc.) - SSH private/public keys are readable - AWS credentials are configured (for AWS provider) - Component dependencies (runtime required for toolkit/k8s) Refs: NVIDIA#563 Task: 1/2 Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Adds a new `holodeck provision` command with two modes: 1. Instance mode: Provision/re-provision an existing instance by ID `holodeck provision abc123` 2. SSH mode: Provision a remote host directly without an instance `holodeck provision --ssh --host 1.2.3.4 --key ~/.ssh/id_rsa -f env.yaml` Features: - Re-runs idempotent provisioning scripts safely - Supports kubeconfig download with -k flag - Works with both single-node and multinode clusters Refs: NVIDIA#563 Task: 2/2 Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Pull Request Test Coverage Report for Build 21687275481Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
This PR adds documentation for two new CLI commands: provision and validate. The provision command allows re-provisioning of existing instances with idempotent templates, supporting both instance mode and SSH mode. The validate command performs pre-flight checks on environment files to catch configuration errors before instance creation.
Changes:
- Added comprehensive documentation for provision and validate commands with usage examples, flags, and error messages
- Updated command README to include the new commands
- Added command implementations for provision and validate
- Modified main.go to register new commands (but includes unrelated command imports)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/commands/provision.md | Complete documentation for provision command including instance mode, SSH mode, examples, and error messages |
| docs/commands/validate.md | Comprehensive documentation for validate command covering validation checks, exit codes, and sample output |
| docs/commands/README.md | Updated command list to include provision and validate with usage examples |
| cmd/cli/provision/provision.go | Implementation of provision command supporting both instance and SSH modes |
| cmd/cli/validate/validate.go | Implementation of validate command with comprehensive validation checks |
| cmd/cli/main.go | Registered new commands but also includes imports for non-existent commands (describe, get, scp, ssh, update) |
| "github.com/NVIDIA/holodeck/cmd/cli/scp" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/ssh" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/status" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/update" |
There was a problem hiding this comment.
This imports an "update" command that doesn't exist in the cmd/cli directory. This will cause a compilation error. Only the provision and validate commands are added in this PR according to the description.
| "github.com/NVIDIA/holodeck/cmd/cli/update" |
| list.NewCommand(log), | ||
| oscmd.NewCommand(log), | ||
| provision.NewCommand(log), | ||
| scp.NewCommand(log), |
There was a problem hiding this comment.
This registers an "scp" command that doesn't exist. Remove this line since only provision and validate commands are added in this PR.
| // getKubeconfigPath returns the path to save kubeconfig | ||
| func getKubeconfigPath(instanceID string) string { | ||
| homeDir, err := os.UserHomeDir() | ||
| if err != nil { | ||
| return fmt.Sprintf("kubeconfig-%s", instanceID) | ||
| } | ||
| kubeDir := filepath.Join(homeDir, ".kube") | ||
| _ = os.MkdirAll(kubeDir, 0755) | ||
| return filepath.Join(kubeDir, fmt.Sprintf("config-%s", instanceID)) | ||
| } |
There was a problem hiding this comment.
The getKubeconfigPath function is defined but never used in the code. Consider removing it if it's not needed, or use it to generate kubeconfig paths consistently.
| @@ -63,9 +70,22 @@ Examples: | |||
| # List all environments | |||
| holodeck list | |||
|
|
|||
| # List environments in JSON format | |||
| holodeck list -o json | |||
|
|
|||
| # Get status of a specific environment | |||
| holodeck status <instance-id> | |||
|
|
|||
| # SSH into an instance | |||
| holodeck ssh <instance-id> | |||
|
|
|||
| # Run a command on an instance | |||
| holodeck ssh <instance-id> -- nvidia-smi | |||
|
|
|||
| # Copy files to/from an instance | |||
| holodeck scp ./local-file.txt <instance-id>:/remote/path/ | |||
| holodeck scp <instance-id>:/remote/file.log ./local/ | |||
|
|
|||
| # Delete an environment | |||
| holodeck delete <instance-id> | |||
|
|
|||
| @@ -93,10 +113,17 @@ Examples: | |||
| cleanup.NewCommand(log), | |||
| create.NewCommand(log), | |||
| delete.NewCommand(log), | |||
| describe.NewCommand(log), | |||
| dryrun.NewCommand(log), | |||
| get.NewCommand(log), | |||
| list.NewCommand(log), | |||
| oscmd.NewCommand(log), | |||
| provision.NewCommand(log), | |||
| scp.NewCommand(log), | |||
| ssh.NewCommand(log), | |||
| status.NewCommand(log), | |||
| update.NewCommand(log), | |||
| validate.NewCommand(log), | |||
There was a problem hiding this comment.
The PR description states that only provision and validate commands are being added, but this diff includes imports and registrations for describe, get, scp, ssh, and update commands as well. These additional commands don't exist in the codebase and will cause compilation failures. Either these commands should be added in this PR, or these lines should be removed to match the PR description.
| "github.com/NVIDIA/holodeck/cmd/cli/delete" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/describe" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/dryrun" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/get" |
There was a problem hiding this comment.
This imports a "get" command that doesn't exist in the cmd/cli directory. This will cause a compilation error. Only the provision and validate commands are added in this PR according to the description.
| "github.com/NVIDIA/holodeck/cmd/cli/get" |
| oscmd.NewCommand(log), | ||
| provision.NewCommand(log), | ||
| scp.NewCommand(log), | ||
| ssh.NewCommand(log), |
There was a problem hiding this comment.
This registers an "ssh" command that doesn't exist. Remove this line since only provision and validate commands are added in this PR.
| scp.NewCommand(log), | ||
| ssh.NewCommand(log), | ||
| status.NewCommand(log), | ||
| update.NewCommand(log), |
There was a problem hiding this comment.
This registers an "update" command that doesn't exist. Remove this line since only provision and validate commands are added in this PR.
| "github.com/NVIDIA/holodeck/cmd/cli/cleanup" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/create" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/delete" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/describe" |
There was a problem hiding this comment.
This imports a "describe" command that doesn't exist in the cmd/cli directory. This will cause a compilation error. Only the provision and validate commands are added in this PR according to the description.
| "github.com/NVIDIA/holodeck/cmd/cli/describe" |
| "github.com/NVIDIA/holodeck/cmd/cli/list" | ||
| oscmd "github.com/NVIDIA/holodeck/cmd/cli/os" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/provision" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/scp" |
There was a problem hiding this comment.
This imports an "scp" command that doesn't exist in the cmd/cli directory. This will cause a compilation error. Only the provision and validate commands are added in this PR according to the description.
| oscmd "github.com/NVIDIA/holodeck/cmd/cli/os" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/provision" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/scp" | ||
| "github.com/NVIDIA/holodeck/cmd/cli/ssh" |
There was a problem hiding this comment.
This imports an "ssh" command that doesn't exist in the cmd/cli directory. This will cause a compilation error. Only the provision and validate commands are added in this PR according to the description.
| "github.com/NVIDIA/holodeck/cmd/cli/ssh" |
|
Closing: this documents provision and validate commands which are not on This PR can be reopened if/when provision and validate commands are added in a future PR. |
Summary
Add documentation for the new
provisionandvalidateCLI commands.Changes
New Files
docs/commands/provision.mddocs/commands/validate.mdUpdated Files
docs/commands/README.mdDocumentation Content
provision.md
validate.md
Test plan