neoclouds: add new datacrunch / verda support
cover neoclouds: add new datacrunch / verda support
I've been exploiting using neocloud solutions for GPU usage as they are dirt cheap compared to larger cloud solutions. Its enough and simple enough to get started with GPU workflows. This adds yet another neocloud, datacrunch which has been spun off now as verda.
I've taken the old terraform provider, and modified it to work with the latest cloud solution and forked it under kdevops. I registered the provider under opentofu as terraform doesn't let you publish new providers.
I've been using this for about 1 month now without isues.
Luis Chamberlain (8):
terraform: Use directory checksum in SSH key filenames
devconfig: Add tmux.conf copying to target systems
terraform: Enable fact gathering for localhost
terraform: Add DataCrunch GPU cloud provider integration
kconfig: Add support for merging defconfig fragments
terraform: Add tier-based GPU selection for Lambda Labs
terraform: Document tier-based GPU selection for Lambda Labs
docs: Organize cloud providers with Neoclouds section
.gitignore | 1 + Makefile | 9 + README.md | 2 +- defconfigs/datacrunch-4x-b200 | 11 + defconfigs/datacrunch-4x-b300 | 11 + defconfigs/datacrunch-4x-h100-pytorch | 11 + defconfigs/datacrunch-a100 | 11 + defconfigs/datacrunch-a100-40-or-less | 13 + defconfigs/datacrunch-a100-80-or-less | 13 + defconfigs/datacrunch-b200-or-less | 13 + defconfigs/datacrunch-b300 | 11 + defconfigs/datacrunch-b300-or-less | 13 + defconfigs/datacrunch-h100-pytorch | 12 + defconfigs/datacrunch-h100-pytorch-or-less | 13 + defconfigs/datacrunch-v100 | 12 + defconfigs/lambdalabs-8x-b200-or-less | 14 + defconfigs/lambdalabs-8x-h100-or-less | 14 + defconfigs/lambdalabs-a100-or-less | 14 + defconfigs/lambdalabs-gh200-or-less | 14 + defconfigs/lambdalabs-h100-or-less | 14 + docs/datacrunch.md | 583 +++++++++++++++++ docs/kdevops-terraform.md | 213 +++++++ playbooks/datacrunch_volume_cache.yml | 83 +++ playbooks/roles/devconfig/defaults/main.yml | 4 + .../roles/devconfig/tasks/datacrunch_ml.yml | 96 +++ playbooks/roles/devconfig/tasks/main.yml | 17 + playbooks/roles/gen_tfvars/defaults/main.yml | 6 + .../templates/datacrunch/terraform.tfvars.j2 | 19 + playbooks/roles/terraform/tasks/main.yml | 593 +++++++++++++++++- playbooks/terraform.yml | 2 +- requirements.txt | 18 + scripts/append-makefile-vars.sh | 12 + scripts/datacrunch_api.py | 340 ++++++++++ scripts/datacrunch_check_capacity.py | 307 +++++++++ scripts/datacrunch_credentials.py | 372 +++++++++++ scripts/datacrunch_select_tier.py | 373 +++++++++++ scripts/datacrunch_ssh_key_name.py | 43 ++ scripts/datacrunch_ssh_keys.py | 346 ++++++++++ scripts/generate_cloud_configs.py | 36 +- scripts/generate_datacrunch_kconfig.py | 336 ++++++++++ scripts/kconfig/kconfig.Makefile | 20 +- scripts/lambdalabs_check_capacity.py | 124 ++++ scripts/lambdalabs_select_tier.py | 313 +++++++++ scripts/terraform.Makefile | 7 + terraform/Kconfig.providers | 10 + terraform/Kconfig.ssh | 21 +- terraform/datacrunch/Kconfig | 45 ++ terraform/datacrunch/LOCAL_PROVIDER.md | 92 +++ terraform/datacrunch/README.md | 454 ++++++++++++++ terraform/datacrunch/STATUS.md | 106 ++++ .../datacrunch/ansible_provision_cmd.tpl | 1 + terraform/datacrunch/extract_api_key.py | 63 ++ terraform/datacrunch/kconfigs/Kconfig.compute | 7 + .../kconfigs/Kconfig.compute.generated | 209 ++++++ .../datacrunch/kconfigs/Kconfig.identity | 82 +++ terraform/datacrunch/kconfigs/Kconfig.images | 7 + .../kconfigs/Kconfig.images.generated | 90 +++ .../datacrunch/kconfigs/Kconfig.location | 7 + .../kconfigs/Kconfig.location.generated | 49 ++ terraform/datacrunch/main.tf | 36 ++ terraform/datacrunch/output.tf | 35 ++ terraform/datacrunch/provider.tf | 25 + terraform/datacrunch/scripts/apply_wrapper.sh | 79 +++ .../datacrunch/scripts/destroy_wrapper.sh | 95 +++ terraform/datacrunch/scripts/volume_cache.py | 165 +++++ terraform/datacrunch/shared.tf | 1 + terraform/datacrunch/vars.tf | 52 ++ terraform/lambdalabs/README.md | 103 +++ terraform/lambdalabs/kconfigs/Kconfig.compute | 68 ++ terraform/oci/scripts/gen_kconfig_image | 6 + terraform/oci/scripts/gen_kconfig_location | 6 + terraform/oci/scripts/gen_kconfig_shape | 6 + 72 files changed, 6393 insertions(+), 16 deletions(-) create mode 100644 defconfigs/datacrunch-4x-b200 create mode 100644 defconfigs/datacrunch-4x-b300 create mode 100644 defconfigs/datacrunch-4x-h100-pytorch create mode 100644 defconfigs/datacrunch-a100 create mode 100644 defconfigs/datacrunch-a100-40-or-less create mode 100644 defconfigs/datacrunch-a100-80-or-less create mode 100644 defconfigs/datacrunch-b200-or-less create mode 100644 defconfigs/datacrunch-b300 create mode 100644 defconfigs/datacrunch-b300-or-less create mode 100644 defconfigs/datacrunch-h100-pytorch create mode 100644 defconfigs/datacrunch-h100-pytorch-or-less create mode 100644 defconfigs/datacrunch-v100 create mode 100644 defconfigs/lambdalabs-8x-b200-or-less create mode 100644 defconfigs/lambdalabs-8x-h100-or-less create mode 100644 defconfigs/lambdalabs-a100-or-less create mode 100644 defconfigs/lambdalabs-gh200-or-less create mode 100644 defconfigs/lambdalabs-h100-or-less create mode 100644 docs/datacrunch.md create mode 100644 playbooks/datacrunch_volume_cache.yml create mode 100644 playbooks/roles/devconfig/tasks/datacrunch_ml.yml create mode 100644 playbooks/roles/gen_tfvars/templates/datacrunch/terraform.tfvars.j2 create mode 100644 requirements.txt create mode 100755 scripts/datacrunch_api.py create mode 100755 scripts/datacrunch_check_capacity.py create mode 100755 scripts/datacrunch_credentials.py create mode 100755 scripts/datacrunch_select_tier.py create mode 100755 scripts/datacrunch_ssh_key_name.py create mode 100755 scripts/datacrunch_ssh_keys.py create mode 100755 scripts/generate_datacrunch_kconfig.py create mode 100755 scripts/lambdalabs_check_capacity.py create mode 100755 scripts/lambdalabs_select_tier.py create mode 100644 terraform/datacrunch/Kconfig create mode 100644 terraform/datacrunch/LOCAL_PROVIDER.md create mode 100644 terraform/datacrunch/README.md create mode 100644 terraform/datacrunch/STATUS.md create mode 120000 terraform/datacrunch/ansible_provision_cmd.tpl create mode 100755 terraform/datacrunch/extract_api_key.py create mode 100644 terraform/datacrunch/kconfigs/Kconfig.compute create mode 100644 terraform/datacrunch/kconfigs/Kconfig.compute.generated create mode 100644 terraform/datacrunch/kconfigs/Kconfig.identity create mode 100644 terraform/datacrunch/kconfigs/Kconfig.images create mode 100644 terraform/datacrunch/kconfigs/Kconfig.images.generated create mode 100644 terraform/datacrunch/kconfigs/Kconfig.location create mode 100644 terraform/datacrunch/kconfigs/Kconfig.location.generated create mode 100644 terraform/datacrunch/main.tf create mode 100644 terraform/datacrunch/output.tf create mode 100644 terraform/datacrunch/provider.tf create mode 100755 terraform/datacrunch/scripts/apply_wrapper.sh create mode 100755 terraform/datacrunch/scripts/destroy_wrapper.sh create mode 100755 terraform/datacrunch/scripts/volume_cache.py create mode 120000 terraform/datacrunch/shared.tf create mode 100644 terraform/datacrunch/vars.tf
Signature · 1 line
2.51.0
PATCH 1/8 terraform: Use directory checksum in SSH key filenames
SSH keys now use directory-based checksums to support multiple kdevops installations coexisting without conflicts. The SSH key filename format is now ~/.ssh/kdevops_terraform_<checksum> where checksum is the first 8 characters of the SHA256 hash of the kdevops directory path.
This was previously only applied to Lambda Labs provider but is now the default for all providers, as it solves the general problem of multiple installations sharing the same home directory.
Also fix OCI Kconfig generation scripts to use --quiet flag correctly to suppress progress output when generating dynamic Kconfig files.
--- terraform/Kconfig.ssh | 7 +++++-- terraform/oci/scripts/gen_kconfig_image | 6 ++++++ terraform/oci/scripts/gen_kconfig_location | 6 ++++++ terraform/oci/scripts/gen_kconfig_shape | 6 ++++++ 4 files changed, 23 insertions(+), 2 deletions(-)
terraform/Kconfig.ssh +5 -2
@@ -21,14 +21,17 @@ config TERRAFORM_SSH_CONFIG_USER config TERRAFORM_SSH_CONFIG_PUBKEY_FILE string "File containing Ansible's ssh public key" - default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) | sha256sum | cut -c1-8).pub" if TERRAFORM_LAMBDALABS - default "~/.ssh/kdevops_terraform.pub" + default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) | sha256sum | cut -c1-8).pub" help The filename of the file containing an ssh public key Ansible is to use to manage its target nodes. The matching private key should be located in a file using the same basename (without the ".pub"). + The filename includes an 8-character hash of the current + directory path, allowing multiple kdevops installations to + use separate SSH keys without conflicts. + config TERRAFORM_SSH_CONFIG_GENKEY bool "Should we create a new random key for you?" default y
terraform/oci/scripts/gen_kconfig_image +6 -0
@@ -718,6 +718,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if args.publishers: # Show both known and discovered publishers compartment_ocid = get_default_compartment()
terraform/oci/scripts/gen_kconfig_location +6 -0
@@ -432,6 +432,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if not args.quiet: print("Fetching list of OCI region subscriptions...", file=sys.stderr) regions = get_all_regions()
terraform/oci/scripts/gen_kconfig_shape +6 -0
@@ -887,6 +887,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + compartment_ocid = get_default_compartment() if not compartment_ocid: print("Error: Could not determine compartment OCID", file=sys.stderr)
Signature · 1 line
2.51.0
Re: [PATCH 1/8] terraform: Use directory checksum in SSH key filenames
Quoted 11 lines · Luis Chamberlain
SSH keys now use directory-based checksums to support multiple kdevops installations coexisting without conflicts. The SSH key filename format is now ~/.ssh/kdevops_terraform_<checksum> where checksum is the first 8 characters of the SHA256 hash of the kdevops directory path.
This was previously only applied to Lambda Labs provider but is now the default for all providers, as it solves the general problem of multiple installations sharing the same home directory.
Also fix OCI
Kconfiggeneration scripts to use --quiet flag correctly to suppress progress output when generating dynamicKconfigfiles.
Instead of duplicating the same logic in all the terraform scripts, can you add it just to scripts/generate_cloud_config.py ?
And can this fix go in a separate commit from the ssh change above?
Quoted 94 lines
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- terraform/Kconfig.ssh | 7 +++++-- terraform/oci/scripts/gen_kconfig_image | 6 ++++++ terraform/oci/scripts/gen_kconfig_location | 6 ++++++ terraform/oci/scripts/gen_kconfig_shape | 6 ++++++ 4 files changed, 23 insertions(+), 2 deletions(-)terraform/Kconfig.ssh +0
-1@@ -21,14 +21,17 @@ config TERRAFORM_SSH_CONFIG_USER config TERRAFORM_SSH_CONFIG_PUBKEY_FILE string "File containing Ansible's ssh public key" - default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) |sha256sum | cut -c1-8).pub" if
TERRAFORM_LAMBDALABSterraform/Kconfig.ssh +1
-1- default "~/.ssh/kdevops_terraform.pub" + default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) |sha256sum | cut -c1-8).pub"
terraform/Kconfig.ssh +4
-0help The filename of the file containing an ssh public key Ansible is to use to manage its target nodes. The matching private key should be located in a file using the same basename (without the ".pub"). + The filename includes an 8-character hash of the current + directory path, allowing multiple kdevops installations to + use separate SSH keys without conflicts. + config TERRAFORM_SSH_CONFIG_GENKEY bool "Should we create a new random key for you?" default yterraform/oci/scripts/gen_kconfig_image +6
-0@@ -718,6 +718,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if args.publishers: # Show both known and discovered publishers
compartment_ocid=get_default_compartment()terraform/oci/scripts/gen_kconfig_location +6
-0@@ -432,6 +432,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if not args.quiet: print("Fetching list of OCI region subscriptions...",file=sys.stderr)
regions =get_all_regions()terraform/oci/scripts/gen_kconfig_shape +6
-0@@ -887,6 +887,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + compartment_ocid = get_default_compartment() if not compartment_ocid: print("Error: Could not determine compartment OCID", file=sys.stderr)Signature · 1 line
2.51.0
Signature · 1 line
Chuck Lever
Re: [PATCH 1/8] terraform: Use directory checksum in SSH key filenames
Quoted 10 lines · Chuck Lever
Quoted 8 lines · Luis Chamberlain
SSH keys now use directory-based checksums to support multiple kdevops installations coexisting without conflicts. The SSH key filename format is now ~/.ssh/kdevops_terraform_<checksum> where checksum is the first 8 characters of the SHA256 hash of the kdevops directory path.
This was previously only applied to Lambda Labs provider but is now the default for all providers, as it solves the general problem of multiple installations sharing the same home directory.
Quoted 5 lines
Quoted 2 lines
Also fix OCI
Kconfiggeneration scripts to use --quiet flag correctly to suppress progress output when generating dynamicKconfigfiles.Instead of duplicating the same logic in all the terraform scripts, can you add it just to
scripts/generate_cloud_config.py?
If this isn't a good fit for generate_cloud_config.py, then another approach would be to add the .oci/config check in a helper in terraform/oci/scripts/oci_common.py and have the three menu generator scripts use that common helper.
But I'm a little surprised because Claude /promised/ that these scripts fail gracefully when there's no authentication material ;-)
Quoted 100 lines
And can this fix go in a separate commit from the ssh change above?
Quoted 94 lines
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- terraform/Kconfig.ssh | 7 +++++-- terraform/oci/scripts/gen_kconfig_image | 6 ++++++ terraform/oci/scripts/gen_kconfig_location | 6 ++++++ terraform/oci/scripts/gen_kconfig_shape | 6 ++++++ 4 files changed, 23 insertions(+), 2 deletions(-)terraform/Kconfig.ssh +0
-1@@ -21,14 +21,17 @@ config TERRAFORM_SSH_CONFIG_USER config TERRAFORM_SSH_CONFIG_PUBKEY_FILE string "File containing Ansible's ssh public key" - default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) |sha256sum | cut -c1-8).pub" if
TERRAFORM_LAMBDALABSterraform/Kconfig.ssh +1
-1- default "~/.ssh/kdevops_terraform.pub" + default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) |sha256sum | cut -c1-8).pub"
terraform/Kconfig.ssh +4
-0help The filename of the file containing an ssh public key Ansible is to use to manage its target nodes. The matching private key should be located in a file using the same basename (without the ".pub"). + The filename includes an 8-character hash of the current + directory path, allowing multiple kdevops installations to + use separate SSH keys without conflicts. + config TERRAFORM_SSH_CONFIG_GENKEY bool "Should we create a new random key for you?" default yterraform/oci/scripts/gen_kconfig_image +6
-0@@ -718,6 +718,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if args.publishers: # Show both known and discovered publishers
compartment_ocid=get_default_compartment()terraform/oci/scripts/gen_kconfig_location +6
-0@@ -432,6 +432,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if not args.quiet: print("Fetching list of OCI region subscriptions...",file=sys.stderr)
regions =get_all_regions()terraform/oci/scripts/gen_kconfig_shape +6
-0@@ -887,6 +887,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + compartment_ocid = get_default_compartment() if not compartment_ocid: print("Error: Could not determine compartment OCID", file=sys.stderr)Signature · 1 line
2.51.0Signature · 1 line
Chuck Lever
Signature · 1 line
Chuck Lever
Re: [PATCH 1/8] terraform: Use directory checksum in SSH key filenames
Quoted 17 lines · Chuck Lever
Quoted 10 lines · Chuck Lever
Quoted 8 lines · Luis Chamberlain
SSH keys now use directory-based checksums to support multiple kdevops installations coexisting without conflicts. The SSH key filename format is now ~/.ssh/kdevops_terraform_<checksum> where checksum is the first 8 characters of the SHA256 hash of the kdevops directory path.
This was previously only applied to Lambda Labs provider but is now the default for all providers, as it solves the general problem of multiple installations sharing the same home directory.
Quoted 5 lines
Quoted 2 lines
Also fix OCI
Kconfiggeneration scripts to use --quiet flag correctly to suppress progress output when generating dynamicKconfigfiles.Instead of duplicating the same logic in all the terraform scripts, can you add it just to
scripts/generate_cloud_config.py?
Quoted 10 lines
If this isn't a good fit for
generate_cloud_config.py, then another approach would be to add the .oci/config check in a helper interraform/oci/scripts/oci_common.pyand have the three menu generator scripts use that common helper.But I'm a little surprised because Claude /promised/ that these scripts fail gracefully when there's no authentication material ;-)
Quoted 1 line
And can this fix go in a separate commit from the ssh change above?
I've sorted the review comments and merged 1/8 and 3/8. I'm now working on "[PATCH 4/8] terraform: Add DataCrunch GPU cloud provider integration".
Quoted 100 lines
Quoted 97 lines
Quoted 94 lines
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- terraform/Kconfig.ssh | 7 +++++-- terraform/oci/scripts/gen_kconfig_image | 6 ++++++ terraform/oci/scripts/gen_kconfig_location | 6 ++++++ terraform/oci/scripts/gen_kconfig_shape | 6 ++++++ 4 files changed, 23 insertions(+), 2 deletions(-)terraform/Kconfig.ssh +0
-1@@ -21,14 +21,17 @@ config TERRAFORM_SSH_CONFIG_USER config TERRAFORM_SSH_CONFIG_PUBKEY_FILE string "File containing Ansible's ssh public key" - default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) |sha256sum | cut -c1-8).pub" if
TERRAFORM_LAMBDALABSterraform/Kconfig.ssh +1
-1- default "~/.ssh/kdevops_terraform.pub" + default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) |sha256sum | cut -c1-8).pub"
terraform/Kconfig.ssh +4
-0help The filename of the file containing an ssh public key Ansible is to use to manage its target nodes. The matching private key should be located in a file using the same basename (without the ".pub"). + The filename includes an 8-character hash of the current + directory path, allowing multiple kdevops installations to + use separate SSH keys without conflicts. + config TERRAFORM_SSH_CONFIG_GENKEY bool "Should we create a new random key for you?" default yterraform/oci/scripts/gen_kconfig_image +6
-0@@ -718,6 +718,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if args.publishers: # Show both known and discovered publishers
compartment_ocid=get_default_compartment()terraform/oci/scripts/gen_kconfig_location +6
-0@@ -432,6 +432,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + if not args.quiet: print("Fetching list of OCI region subscriptions...",file=sys.stderr)
regions =get_all_regions()terraform/oci/scripts/gen_kconfig_shape +6
-0@@ -887,6 +887,12 @@ def main(): """Main function to run the program.""" args = parse_arguments() + # Check for OCI config early - exit silently if not configured + if not os.path.exists(os.path.expanduser("~/.oci/config")): + if not args.quiet: + print("OCI not configured - skipping (optional)", file=sys.stderr) + sys.exit(0) + compartment_ocid = get_default_compartment() if not compartment_ocid: print("Error: Could not determine compartment OCID", file=sys.stderr)Signature · 1 line
2.51.0Signature · 1 line
Chuck LeverSignature · 1 line
Chuck Lever
Signature · 1 line
Chuck Lever
PATCH 2/8 devconfig: Add tmux.conf copying to target systems
In reply to Luis ChamberlainAdded support for copying the user's local tmux.conf configuration to target systems during devconfig setup, following the same pattern as gitconfig copying. If a ~/.tmux.conf file exists on the control host, it will be copied to both the user home directory and root home directory on target nodes.
The implementation checks for tmux.conf existence on localhost, copies it to the target user directory if present, and then copies to root using remote_src for efficient transfer. This ensures consistent terminal multiplexer configuration across all development systems.
--- playbooks/roles/devconfig/defaults/main.yml | 4 ++++ playbooks/roles/devconfig/tasks/main.yml | 17 +++++++++++++++++ 2 files changed, 21 insertions(+)
playbooks/roles/devconfig/defaults/main.yml +4 -0
@@ -9,6 +9,10 @@ dev_gitconfig_src: "~/.gitconfig" # Where we copy it to dev_gitconfig_dest: "{{ data_home_dir }}/.gitconfig" +# Tmux configuration +dev_tmux_conf_src: "~/.tmux.conf" +dev_tmux_conf_dest: "{{ data_home_dir }}/.tmux.conf" + # The bash script we check for on the virtual machine dev_bash_config: "{{ data_home_dir }}/.bashrc" dev_bash_config_root: "/root/.bashrc"
playbooks/roles/devconfig/tasks/main.yml +17 -0
@@ -155,6 +155,23 @@ ansible.builtin.copy: src={{ dev_gitconfig_dest }} dest=/root/ remote_src=yes when: dev_git_config_file.stat.exists +- name: Check if the developer has a tmux config + delegate_to: localhost + ansible.builtin.stat: path={{ dev_tmux_conf_src }} + run_once: true + register: dev_tmux_config_file + +- name: Copy the developer's tmux.conf *if* it exists + ansible.builtin.copy: src={{ dev_tmux_conf_src }} dest={{ dev_tmux_conf_dest }} + when: dev_tmux_config_file.stat.exists + +- name: Copy the developer's tmux.conf *if* it exists to root + become: true + become_flags: "su - -c" + become_method: sudo + ansible.builtin.copy: src={{ dev_tmux_conf_dest }} dest=/root/ remote_src=yes + when: dev_tmux_config_file.stat.exists + - name: Check if the system has a user vimrc file ansible.builtin.stat: path: ~/.vimrc
Signature · 1 line
2.51.0
PATCH 3/8 terraform: Enable fact gathering for localhost
In reply to Luis ChamberlainThe terraform role uses ansible_system and ansible_architecture variables to determine the correct installation path for the DataCrunch terraform provider. These variables are Ansible facts that are only available after fact gathering runs.
Enable gather_facts in the terraform playbook so these variables are available when the role executes. This fixes the error when running make bringup with DataCrunch provider where ansible_system was undefined.
Generated-by: Claude AI
Signed-off-by: $(git config user.name) <$(git config user.email)>
--- playbooks/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
playbooks/terraform.yml +1 -1
@@ -1,6 +1,6 @@ --- - name: Manage infrastructure lifecycle and SSH access with Terraform hosts: localhost - gather_facts: false + gather_facts: true roles: - role: terraform
Signature · 1 line
2.51.0
Re: [PATCH 3/8] terraform: Enable fact gathering for localhost
Quoted 11 lines · Luis Chamberlain
The terraform role uses
ansible_systemandansible_architecturevariables to determine the correct installation path for the DataCrunch terraform provider. These variables are Ansible facts that are only available after fact gathering runs.Enable
gather_factsin the terraform playbook so these variables are available when the role executes. This fixes the error when running make bringup with DataCrunch provider whereansible_systemwas undefined.Generated-by: Claude AI
Signed-off-by: $(git config user.name) <$(git config user.email)>
The Sob tag is broken.
Quoted 9 lines
--- playbooks/terraform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)playbooks/terraform.yml +0
-0
playbooks/terraform.yml line 4
Quoted 5 lines
playbooks/terraform.yml +1
-1@@ -1,6 +1,6 @@ --- - name: Manage infrastructure lifecycle and SSH access with Terraform hosts: localhost - gather_facts: false + gather_facts: true
IIRC, "gather_facts: true" is the default? It's a nit, but you could just delete the existing "gather_facts: false" line. I disabled fact gathering as a small performance optimization, but there's really no other reason to keep that setting.
Quoted 4 lines
playbooks/terraform.yml +0
-0roles: - role: terraformSignature · 1 line
2.51.0
Signature · 1 line
Chuck Lever
PATCH 4/8 terraform: Add DataCrunch GPU cloud provider integration
In reply to Luis ChamberlainAdd comprehensive DataCrunch cloud provider support for GPU instances ranging from Blackwell B300 to Tesla V100.
Features intelligent GPU selection with three strategies: wildcard variant selection (ANY_1H100), tier-based fallback (H100_OR_LESS, B300_OR_LESS) for automatic fallback through GPU tiers when top options unavailable, and explicit instance types for production workloads.
GPU tier hierarchy supports 10 tiers with automatic fallback to maximize provisioning success while capping costs. Tier-based selection recommended for most users (~$1.99/hr cap for H100 tier).
Add capacity checking infrastructure to validate instance availability before provisioning. API credential management uses OAuth2 with secure token retrieval from ~/.datacrunch/credentials.
Special handling for local provider development with dev_overrides in ~/.terraformrc, skipping force_init in Ansible terraform module.
Add ML environment setup for DataCrunch instances: package updates, ML dependencies, PyTorch in virtualenv, NVIDIA driver reload with proper module unload sequence (nvidia_uvm, nvidia_drm, nvidia_modeset, nvidia) to avoid PyTorch/driver mismatch, Claude Code installation, MOTD with PyTorch activation instructions, and bashrc auto-activation.
Add persistent volume support with KEEP=1 configuration option. Volume mappings cached in ~/.cache/kdevops/datacrunch/ enable fast reprovisioning (seconds vs minutes) while managing ~$10/month storage costs. Volume lifecycle wrapper scripts automate volume ID tracking across instance destroy/recreate cycles.
Add defconfig files for tier-based selection, specific GPUs, and multi-GPU configurations. Comprehensive documentation focuses on capacity challenges, selection strategies, and best practices.
When a DataCrunch instance type fails to deploy due to capacity issues, the terraform bringup will retry with a different instance from the same tier group. An exclude option can be used multiple times to skip instance types that have already failed.
--- .gitignore | 1 + Makefile | 9 + defconfigs/datacrunch-4x-b200 | 11 + defconfigs/datacrunch-4x-b300 | 11 + defconfigs/datacrunch-4x-h100-pytorch | 11 + defconfigs/datacrunch-a100 | 11 + defconfigs/datacrunch-a100-40-or-less | 13 + defconfigs/datacrunch-a100-80-or-less | 13 + defconfigs/datacrunch-b200-or-less | 13 + defconfigs/datacrunch-b300 | 11 + defconfigs/datacrunch-b300-or-less | 13 + defconfigs/datacrunch-h100-pytorch | 12 + defconfigs/datacrunch-h100-pytorch-or-less | 13 + defconfigs/datacrunch-v100 | 12 + docs/datacrunch.md | 583 ++++++++++++++++++ docs/kdevops-terraform.md | 182 ++++++ playbooks/datacrunch_volume_cache.yml | 83 +++ .../roles/devconfig/tasks/datacrunch_ml.yml | 96 +++ playbooks/roles/gen_tfvars/defaults/main.yml | 6 + .../templates/datacrunch/terraform.tfvars.j2 | 19 + playbooks/roles/terraform/tasks/main.yml | 488 ++++++++++++++- requirements.txt | 18 + scripts/append-makefile-vars.sh | 12 + scripts/datacrunch_api.py | 340 ++++++++++ scripts/datacrunch_check_capacity.py | 307 +++++++++ scripts/datacrunch_credentials.py | 372 +++++++++++ scripts/datacrunch_select_tier.py | 373 +++++++++++ scripts/datacrunch_ssh_key_name.py | 43 ++ scripts/datacrunch_ssh_keys.py | 346 +++++++++++ scripts/generate_cloud_configs.py | 36 +- scripts/generate_datacrunch_kconfig.py | 336 ++++++++++ scripts/terraform.Makefile | 7 + terraform/Kconfig.providers | 10 + terraform/Kconfig.ssh | 14 +- terraform/datacrunch/Kconfig | 45 ++ terraform/datacrunch/LOCAL_PROVIDER.md | 92 +++ terraform/datacrunch/README.md | 454 ++++++++++++++ terraform/datacrunch/STATUS.md | 106 ++++ .../datacrunch/ansible_provision_cmd.tpl | 1 + terraform/datacrunch/extract_api_key.py | 63 ++ terraform/datacrunch/kconfigs/Kconfig.compute | 7 + .../kconfigs/Kconfig.compute.generated | 209 +++++++ .../datacrunch/kconfigs/Kconfig.identity | 82 +++ terraform/datacrunch/kconfigs/Kconfig.images | 7 + .../kconfigs/Kconfig.images.generated | 90 +++ .../datacrunch/kconfigs/Kconfig.location | 7 + .../kconfigs/Kconfig.location.generated | 49 ++ terraform/datacrunch/main.tf | 36 ++ terraform/datacrunch/output.tf | 35 ++ terraform/datacrunch/provider.tf | 25 + terraform/datacrunch/scripts/apply_wrapper.sh | 79 +++ .../datacrunch/scripts/destroy_wrapper.sh | 95 +++ terraform/datacrunch/scripts/volume_cache.py | 165 +++++ terraform/datacrunch/shared.tf | 1 + terraform/datacrunch/vars.tf | 52 ++ 55 files changed, 5515 insertions(+), 10 deletions(-) create mode 100644 defconfigs/datacrunch-4x-b200 create mode 100644 defconfigs/datacrunch-4x-b300 create mode 100644 defconfigs/datacrunch-4x-h100-pytorch create mode 100644 defconfigs/datacrunch-a100 create mode 100644 defconfigs/datacrunch-a100-40-or-less create mode 100644 defconfigs/datacrunch-a100-80-or-less create mode 100644 defconfigs/datacrunch-b200-or-less create mode 100644 defconfigs/datacrunch-b300 create mode 100644 defconfigs/datacrunch-b300-or-less create mode 100644 defconfigs/datacrunch-h100-pytorch create mode 100644 defconfigs/datacrunch-h100-pytorch-or-less create mode 100644 defconfigs/datacrunch-v100 create mode 100644 docs/datacrunch.md create mode 100644 playbooks/datacrunch_volume_cache.yml create mode 100644 playbooks/roles/devconfig/tasks/datacrunch_ml.yml create mode 100644 playbooks/roles/gen_tfvars/templates/datacrunch/terraform.tfvars.j2 create mode 100644 requirements.txt create mode 100755 scripts/datacrunch_api.py create mode 100755 scripts/datacrunch_check_capacity.py create mode 100755 scripts/datacrunch_credentials.py create mode 100755 scripts/datacrunch_select_tier.py create mode 100755 scripts/datacrunch_ssh_key_name.py create mode 100755 scripts/datacrunch_ssh_keys.py create mode 100755 scripts/generate_datacrunch_kconfig.py create mode 100644 terraform/datacrunch/Kconfig create mode 100644 terraform/datacrunch/LOCAL_PROVIDER.md create mode 100644 terraform/datacrunch/README.md create mode 100644 terraform/datacrunch/STATUS.md create mode 120000 terraform/datacrunch/ansible_provision_cmd.tpl create mode 100755 terraform/datacrunch/extract_api_key.py create mode 100644 terraform/datacrunch/kconfigs/Kconfig.compute create mode 100644 terraform/datacrunch/kconfigs/Kconfig.compute.generated create mode 100644 terraform/datacrunch/kconfigs/Kconfig.identity create mode 100644 terraform/datacrunch/kconfigs/Kconfig.images create mode 100644 terraform/datacrunch/kconfigs/Kconfig.images.generated create mode 100644 terraform/datacrunch/kconfigs/Kconfig.location create mode 100644 terraform/datacrunch/kconfigs/Kconfig.location.generated create mode 100644 terraform/datacrunch/main.tf create mode 100644 terraform/datacrunch/output.tf create mode 100644 terraform/datacrunch/provider.tf create mode 100755 terraform/datacrunch/scripts/apply_wrapper.sh create mode 100755 terraform/datacrunch/scripts/destroy_wrapper.sh create mode 100755 terraform/datacrunch/scripts/volume_cache.py create mode 120000 terraform/datacrunch/shared.tf create mode 100644 terraform/datacrunch/vars.tf
.gitignore +1 -0
@@ -140,3 +140,4 @@ docs/contrib/kdevops_contributions* __pycache__/ .ansible +cloud-bill
Makefile +9 -0
@@ -27,6 +27,15 @@ ifdef DECLARE_HOSTS export DECLARED_HOSTS := $(DECLARE_HOSTS) endif +# Export workflow CLI overrides +ifdef KNLP +export KNLP +endif + +ifdef KEEP +export KEEP +endif + include scripts/refs.Makefile KDEVOPS_NODES_ROLE_TEMPLATE_DIR := $(KDEVOPS_PLAYBOOKS_DIR)/roles/gen_nodes/templates
defconfigs/datacrunch-4x-b200 new file +11 -0
@@ -0,0 +1,11 @@ +# DataCrunch 4x B200 (Blackwell) instance - latest GPU architecture +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_4B200_120V=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-4x-b300 new file +11 -0
@@ -0,0 +1,11 @@ +# DataCrunch 4x B300 (Blackwell) instance - latest GPU architecture +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_4B300_120V=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-4x-h100-pytorch new file +11 -0
@@ -0,0 +1,11 @@ +# DataCrunch 4x H100 PCIe instance with PyTorch - pay-as-you-go pricing +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_4H100_80S_176V=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-a100 new file +11 -0
@@ -0,0 +1,11 @@ +# DataCrunch single A100 40GB SXM instance - pay-as-you-go pricing +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_1A100_40S_22V=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-a100-40-or-less new file +13 -0
@@ -0,0 +1,13 @@ +# DataCrunch GPU with tier-based fallback (A100-40 maximum tier) +# Uses A100_40_OR_LESS for best available single GPU up to A100-40 +# Fallback order: A100-40 → RTX PRO 6000 → RTX 6000 Ada → L40S → RTX A6000 → Tesla V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_A100_40_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-a100-80-or-less new file +13 -0
@@ -0,0 +1,13 @@ +# DataCrunch GPU with tier-based fallback (A100-80 maximum tier) +# Uses A100_80_OR_LESS for best available single GPU up to A100-80 +# Fallback order: A100-80 → A100-40 → RTX PRO 6000 → RTX 6000 Ada → L40S → RTX A6000 → Tesla V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_A100_80_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-b200-or-less new file +13 -0
@@ -0,0 +1,13 @@ +# DataCrunch GPU with tier-based fallback (B200 maximum tier) +# Uses B200_OR_LESS for best available single GPU up to B200 +# Fallback order: B200 → H100 → A100-80 → A100-40 → RTX PRO 6000 → RTX 6000 Ada → L40S → RTX A6000 → Tesla V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_B200_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-b300 new file +11 -0
@@ -0,0 +1,11 @@ +# DataCrunch single NVIDIA Blackwell B300 GPU (latest generation) +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_1B300_30V=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-b300-or-less new file +13 -0
@@ -0,0 +1,13 @@ +# DataCrunch GPU with tier-based fallback (B300 maximum tier) +# Uses B300_OR_LESS for best available single GPU (any tier) +# Fallback order: B300 → B200 → H100 → A100-80 → A100-40 → RTX PRO 6000 → RTX 6000 Ada → L40S → RTX A6000 → Tesla V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_B300_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-h100-pytorch new file +12 -0
@@ -0,0 +1,12 @@ +# DataCrunch H100 PCIe instance with PyTorch - pay-as-you-go pricing +# Uses ANY_1H100 to automatically select any available single H100 variant +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_ANY_1H100=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-h100-pytorch-or-less new file +13 -0
@@ -0,0 +1,13 @@ +# DataCrunch GPU with tier-based fallback (H100 maximum tier) +# Uses H100_OR_LESS for best available single GPU up to H100 +# Fallback order: H100 → A100-80 → A100-40 → RTX PRO 6000 → RTX 6000 Ada → L40S → RTX A6000 → Tesla V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_H100_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/datacrunch-v100 new file +12 -0
@@ -0,0 +1,12 @@ +# DataCrunch single Tesla V100 GPU (cheapest option) +# 6 vCPUs, 23 GiB RAM - lowest cost GPU tier +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_DATACRUNCH=y +CONFIG_TERRAFORM_DATACRUNCH_INSTANCE_TYPE_1V100_6V=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
docs/datacrunch.md new file +583 -0
583 lines not on this page · raw message
docs/kdevops-terraform.md +182 -0
191 lines not on this page · raw message
playbooks/datacrunch_volume_cache.yml new file +83 -0
83 lines not on this page · raw message
playbooks/roles/devconfig/tasks/datacrunch_ml.yml new file +96 -0
96 lines not on this page · raw message
playbooks/roles/gen_tfvars/defaults/main.yml +6 -0
@@ -39,6 +39,12 @@ terraform_lambdalabs_image: "ubuntu-22.04" terraform_lambdalabs_persistent_storage: false terraform_lambdalabs_persistent_storage_size: 100 +# DataCrunch defaults +terraform_datacrunch_location: "FIN-01" +terraform_datacrunch_instance_type: "1x.h100.pcie" +terraform_datacrunch_image: "ubuntu-22.04-pytorch" +terraform_datacrunch_ssh_key_name: "kdevops-datacrunch" + # SSH config defaults for templates sshconfig: "~/.ssh/config" sshconfig_fname: "~/.ssh/config"
playbooks/roles/gen_tfvars/templates/datacrunch/terraform.tfvars.j2 new file +19 -0
@@ -0,0 +1,19 @@ +datacrunch_location = "{{ terraform_datacrunch_location }}" +datacrunch_instance_type = "{{ terraform_datacrunch_instance_type }}" +datacrunch_image = "{{ terraform_datacrunch_image }}" +datacrunch_ssh_key_name = "{{ terraform_datacrunch_ssh_key_name }}" + +ssh_config_pubkey_file = "{{ kdevops_terraform_ssh_config_pubkey_file }}" +ssh_config_privkey_file = "{{ kdevops_terraform_ssh_config_privkey_file }}" +ssh_config_user = "{{ kdevops_terraform_ssh_config_user }}" +ssh_config = "{{ sshconfig }}" +ssh_config_port = {{ ansible_cfg_ssh_port }} +# Use unique SSH config file per directory to avoid conflicts +ssh_config_name = "{{ kdevops_ssh_config_prefix }}{{ topdir_path_sha256sum[:8] }}" + +ssh_config_update = {{ kdevops_terraform_ssh_config_update | lower }} +ssh_config_use_strict_settings = {{ kdevops_terraform_ssh_config_update_strict | lower }} +ssh_config_backup = {{ kdevops_terraform_ssh_config_update_backup | lower }} + +# DataCrunch doesn't support extra storage volumes yet +# These lines may be added in the future when the provider supports it
playbooks/roles/terraform/tasks/main.yml +486 -2
517 lines not on this page · raw message
requirements.txt new file +18 -0
@@ -0,0 +1,18 @@ +# Python requirements for kdevops cloud provider integrations +# Install with: pip install -r requirements.txt + +# YAML parsing for configuration files +PyYAML>=6.0.3 + +# Cloud provider SDKs +boto3>=1.40.0 # AWS SDK +oci>=2.163.0 # Oracle Cloud Infrastructure SDK + +# Template engine for dynamic configuration generation +Jinja2>=3.1.0 + +# Additional dependencies that may be needed +# (these are typically pulled in as dependencies of the above packages) +# certifi>=2024.0.0 # SSL certificates +# cryptography>=40.0.0 # Cryptographic operations +# python-dateutil>=2.8.0 # Date/time utilities
scripts/append-makefile-vars.sh +12 -0
@@ -7,6 +7,18 @@ if [[ $# -eq 0 ]]; then exit 0 fi +# First argument is the prefix (e.g., ~/.ssh/config_kdevops_) +STR="${1}" +shift + +# Second argument is the SHA256 hash - use only first 8 characters +# to match terraform tfvars template behavior +if [[ ${#1} -gt 0 ]]; then + STR="${STR}${1:0:8}" + shift +fi + +# Append any remaining arguments as-is while [[ ${#1} -gt 0 ]]; do STR="${STR}${1}" shift
scripts/datacrunch_api.py new file +340 -0
340 lines not on this page · raw message
scripts/datacrunch_check_capacity.py new file +307 -0
307 lines not on this page · raw message
scripts/datacrunch_credentials.py new file +372 -0
372 lines not on this page · raw message
scripts/datacrunch_select_tier.py new file +373 -0
281 lines not on this page · raw message
scripts/datacrunch_ssh_key_name.py new file +43 -0
43 lines not on this page · raw message
scripts/datacrunch_ssh_keys.py new file +346 -0
346 lines not on this page · raw message
scripts/generate_datacrunch_kconfig.py new file +336 -0
336 lines not on this page · raw message
terraform/datacrunch/Kconfig new file +45 -0
45 lines not on this page · raw message
terraform/datacrunch/LOCAL_PROVIDER.md new file +92 -0
92 lines not on this page · raw message
terraform/datacrunch/README.md new file +454 -0
454 lines not on this page · raw message
terraform/datacrunch/STATUS.md new file +106 -0
106 lines not on this page · raw message
terraform/datacrunch/ansible_provision_cmd.tpl new file +1 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/extract_api_key.py new file +63 -0
63 lines not on this page · raw message
terraform/datacrunch/kconfigs/Kconfig.compute new file +7 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/kconfigs/Kconfig.compute.generated new file +209 -0
209 lines not on this page · raw message
terraform/datacrunch/kconfigs/Kconfig.identity new file +82 -0
82 lines not on this page · raw message
terraform/datacrunch/kconfigs/Kconfig.images new file +7 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/kconfigs/Kconfig.images.generated new file +90 -0
90 lines not on this page · raw message
terraform/datacrunch/kconfigs/Kconfig.location new file +7 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/kconfigs/Kconfig.location.generated new file +49 -0
49 lines not on this page · raw message
terraform/datacrunch/output.tf new file +35 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/provider.tf new file +25 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/scripts/apply_wrapper.sh new file +79 -0
79 lines not on this page · raw message
terraform/datacrunch/scripts/destroy_wrapper.sh new file +95 -0
95 lines not on this page · raw message
terraform/datacrunch/scripts/volume_cache.py new file +165 -0
165 lines not on this page · raw message
terraform/datacrunch/shared.tf new file +1 -0
Lines of this file are not shown. View the raw message.
terraform/datacrunch/vars.tf new file +52 -0
52 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.51.0
Part of the diff is not shown here. View the raw message.
Chuck Lever
AppliedRe: [PATCH 4/8] terraform: Add DataCrunch GPU cloud provider integration
Quoted 35 lines · Luis Chamberlain
Add comprehensive DataCrunch cloud provider support for GPU instances ranging from Blackwell B300 to Tesla V100.
Features intelligent GPU selection with three strategies: wildcard variant selection (
ANY_1H100), tier-based fallback (H100_OR_LESS,B300_OR_LESS) for automatic fallback through GPU tiers when top options unavailable, and explicit instance types for production workloads.GPU tier hierarchy supports 10 tiers with automatic fallback to maximize provisioning success while capping costs. Tier-based selection recommended for most users (~$1.99/hr cap for H100 tier).
Add capacity checking infrastructure to validate instance availability before provisioning. API credential management uses OAuth2 with secure token retrieval from ~/.datacrunch/credentials.
Special handling for local provider development with
dev_overridesin ~/.terraformrc, skippingforce_initin Ansible terraform module.Add ML environment setup for DataCrunch instances: package updates, ML dependencies, PyTorch in virtualenv, NVIDIA driver reload with proper module unload sequence (
nvidia_uvm,nvidia_drm,nvidia_modeset, nvidia) to avoid PyTorch/driver mismatch, Claude Code installation, MOTD with PyTorch activation instructions, and bashrc auto-activation.Add persistent volume support with KEEP=1 configuration option. Volume mappings cached in ~/.cache/kdevops/datacrunch/ enable fast reprovisioning (seconds vs minutes) while managing ~$10/month storage costs. Volume lifecycle wrapper scripts automate volume ID tracking across instance destroy/recreate cycles.
Add defconfig files for tier-based selection, specific GPUs, and multi-GPU configurations. Comprehensive documentation focuses on capacity challenges, selection strategies, and best practices.
Quoted 7 lines
When a DataCrunch instance type fails to deploy due to capacity issues, the terraform bringup will retry with a different instance from the same tier group. An exclude option can be used multiple times to skip instance types that have already failed.
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>
Merged into origin/main.
Signature · 1 line
Chuck Lever
PATCH 5/8 kconfig: Add support for merging defconfig fragments
In reply to Luis ChamberlainAdd support for composing defconfigs from base configurations and fragments using the + syntax. This allows users to combine a base defconfig with additional config fragments stored in defconfigs/configs/.
The merge_config.sh script from the kernel is used to combine the configurations. Multiple fragments can be chained together.
Example usage:
make defconfig-datacrunch-b200-or-less+myworkflow make defconfig-aws+fstests+debug
This enables modular configuration management where common settings can be shared across different base configurations.
--- scripts/kconfig/kconfig.Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
scripts/kconfig/kconfig.Makefile +19 -1
@@ -57,7 +57,25 @@ PHONY += $(simple-targets) $(simple-targets): $(KCONFIG_DIR)/conf Kconfig $< --$@ Kconfig +# Support merging config fragments with base defconfigs +# Usage: make defconfig-<base>+<fragment> +# Example: make defconfig-datacrunch-b200-or-less+myworkflow +# +# The fragment is looked up in defconfigs/configs/<fragment>.config +# Multiple fragments can be chained: make defconfig-base+frag1+frag2 defconfig-%:: $(KCONFIG_DIR)/conf include/config/project.release Kconfig - @$< --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig + @STEM="$(@:defconfig-%=%)"; \ + if echo "$$STEM" | grep -q '+'; then \ + BASE=$$(echo "$$STEM" | cut -d'+' -f1); \ + FRAGS=$$(echo "$$STEM" | cut -d'+' -f2- | tr '+' ' '); \ + FRAG_FILES=""; \ + for f in $$FRAGS; do \ + FRAG_FILES="$$FRAG_FILES defconfigs/configs/$$f.config"; \ + done; \ + $(KCONFIG_DIR)/merge_config.sh -m -Q defconfigs/$$BASE $$FRAG_FILES && \ + $< --defconfig=.config Kconfig; \ + else \ + $< --defconfig=defconfigs/$$STEM Kconfig; \ + fi .PHONY: $(PHONY)
Signature · 1 line
2.51.0
Re: [PATCH 5/8] kconfig: Add support for merging defconfig fragments
Quoted 7 lines · Luis Chamberlain
Add support for composing defconfigs from base configurations and fragments using the + syntax. This allows users to combine a base defconfig with additional config fragments stored in defconfigs/configs/.
The
merge_config.shscript from the kernel is used to combine the configurations. Multiple fragments can be chained together.
Quoted 6 lines
Example usage:
make defconfig-datacrunch-b200-or-less+myworkflow make defconfig-aws+fstests+debugThis enables modular configuration management where common settings can be shared across different base configurations.
\o/ !!
Quoted 39 lines
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- scripts/kconfig/kconfig.Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)scripts/kconfig/kconfig.Makefile +19
-1@@ -57,7 +57,25 @@ PHONY += $(simple-targets) $(simple-targets): $(KCONFIG_DIR)/conf Kconfig $< --$@ Kconfig +# Support merging config fragments with base defconfigs +# Usage: make defconfig-<base>+<fragment> +# Example: make defconfig-datacrunch-b200-or-less+myworkflow +# +# The fragment is looked up in defconfigs/configs/<fragment>.config +# Multiple fragments can be chained: make defconfig-base+frag1+frag2 defconfig-%:: $(KCONFIG_DIR)/conf include/config/project.release Kconfig - @$< --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig + @STEM="$(@:defconfig-%=%)"; \ + if echo "$$STEM" | grep -q '+'; then \ + BASE=$$(echo "$$STEM" | cut -d'+' -f1); \ + FRAGS=$$(echo "$$STEM" | cut -d'+' -f2- | tr '+' ' '); \ + FRAG_FILES=""; \ + for f in $$FRAGS; do \ + FRAG_FILES="$$FRAG_FILES defconfigs/configs/$$f.config"; \ + done; \ + $(KCONFIG_DIR)/merge_config.sh -m -Q defconfigs/$$BASE $$FRAG_FILES && \ + $< --defconfig=.config Kconfig; \ + else \ + $< --defconfig=defconfigs/$$STEM Kconfig; \ + fi .PHONY: $(PHONY)Signature · 1 line
2.51.0
Signature · 1 line
Chuck Lever
Re: [PATCH 5/8] kconfig: Add support for merging defconfig fragments
In reply to Luis ChamberlainQuoted 7 lines · Luis Chamberlain
Add support for composing defconfigs from base configurations and fragments using the + syntax. This allows users to combine a base defconfig with additional config fragments stored in defconfigs/configs/.
The
merge_config.shscript from the kernel is used to combine the configurations. Multiple fragments can be chained together.
Quoted 6 lines
Example usage:
make defconfig-datacrunch-b200-or-less+myworkflow make defconfig-aws+fstests+debugThis enables modular configuration management where common settings can be shared across different base configurations.
As a user of fragments for both kernel and kdevops, I think this is handy for upstream kernel too.
The only difference in the way I use fragments is that for kernel configs I always start from scratch while for kdevops I always start with a defconfig.
My kernel config step starts with:
./scripts/kconfig/merge_config.sh \
-n \
.config \
fragment1.config fragment2.config
make -j$(nproc)
For kdevops I always do:
make defconfig-<config>./scripts/kconfig/merge_config.sh \
-n \
.config \
fragment1.config fragment2.config
Not sure if users could simply do:
make +fragment1+fragment2
Quoted 23 lines
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>--- scripts/kconfig/kconfig.Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)scripts/kconfig/kconfig.Makefile +6
-1@@ -57,7 +57,25 @@ PHONY += $(simple-targets) $(simple-targets): $(KCONFIG_DIR)/conf Kconfig $< --$@ Kconfig +# Support merging config fragments with base defconfigs +# Usage: make defconfig-<base>+<fragment> +# Example: make defconfig-datacrunch-b200-or-less+myworkflow +# +# The fragment is looked up in defconfigs/configs/<fragment>.config +# Multiple fragments can be chained: make defconfig-base+frag1+frag2 defconfig-%:: $(KCONFIG_DIR)/conf include/config/project.release Kconfig - @$< --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig
scripts/kconfig/kconfig.Makefile PHONY += $(simple-targets) · line 76
Quoted 10 lines
scripts/kconfig/kconfig.Makefile +10
-0+ @STEM="$(@:defconfig-%=%)"; \ + if echo "$$STEM" | grep -q '+'; then \ + BASE=$$(echo "$$STEM" | cut -d'+' -f1); \ + FRAGS=$$(echo "$$STEM" | cut -d'+' -f2- | tr '+' ' '); \ + FRAG_FILES=""; \ + for f in $$FRAGS; do \ + FRAG_FILES="$$FRAG_FILES defconfigs/configs/$$f.config"; \ + done; \ + $(KCONFIG_DIR)/merge_config.sh -m -Q defconfigs/$$BASE $$FRAG_FILES && \ + $< --defconfig=.config Kconfig; \
This command only merges/combines the fragments into the target .config.
-m only merge the fragments, do not execute the make command
I normally run it with -n (see above) to validate the final .config with allnoconfig:
-n use allnoconfig instead of alldefconfig
I think we need here too. Or why is not needed in this case?
It would also be useful to support out-of-tree configs. For example, I keep some for PCIe passthrough devices and workflow setups with device-specific names, along with a few other local (not generic) settings.
Quoted 5 lines
scripts/kconfig/kconfig.Makefile +3
-0+ else \ + $< --defconfig=defconfigs/$$STEM Kconfig; \ + fi .PHONY: $(PHONY)
PATCH 6/8 terraform: Add tier-based GPU selection for Lambda Labs
In reply to Luis ChamberlainAdd support for tier-based GPU instance selection for Lambda Labs, similar to the existing DataCrunch implementation. This allows users to specify a maximum GPU tier and the system will automatically select the highest available GPU within that tier.
The implementation adds capacity checking and tier selection scripts that query the Lambda Labs API to find available instances. Single GPU tier groups fall back from GH200 to H100 to A100 to A6000 to A10. Multi-GPU tier groups fall back from 8x B200 to 8x H100 to 8x A100 to 8x V100.
New Kconfig options provide tier-based selections like H100_OR_LESS and 8X_H100_OR_LESS. The terraform ansible tasks detect these wildcard types and invoke the tier selection script to find available capacity before provisioning.
Defconfigs are provided for common tier combinations to simplify usage. Users can now run commands like make defconfig-lambdalabs-h100-or-less to get the best available single GPU up to H100 tier.
--- defconfigs/lambdalabs-8x-b200-or-less | 14 + defconfigs/lambdalabs-8x-h100-or-less | 14 + defconfigs/lambdalabs-a100-or-less | 14 + defconfigs/lambdalabs-gh200-or-less | 14 + defconfigs/lambdalabs-h100-or-less | 14 + playbooks/roles/terraform/tasks/main.yml | 105 +++++- scripts/lambdalabs_check_capacity.py | 124 +++++++ scripts/lambdalabs_select_tier.py | 313 ++++++++++++++++++ terraform/lambdalabs/kconfigs/Kconfig.compute | 68 ++++ 9 files changed, 679 insertions(+), 1 deletion(-) create mode 100644 defconfigs/lambdalabs-8x-b200-or-less create mode 100644 defconfigs/lambdalabs-8x-h100-or-less create mode 100644 defconfigs/lambdalabs-a100-or-less create mode 100644 defconfigs/lambdalabs-gh200-or-less create mode 100644 defconfigs/lambdalabs-h100-or-less create mode 100755 scripts/lambdalabs_check_capacity.py create mode 100755 scripts/lambdalabs_select_tier.py
defconfigs/lambdalabs-8x-b200-or-less new file +14 -0
@@ -0,0 +1,14 @@ +# Lambda Labs 8-GPU with tier-based fallback (B200 maximum tier) +# Uses 8X_B200_OR_LESS for best available 8-GPU up to B200 +# Fallback order: 8x B200 → 8x H100 → 8x A100-80 → 8x A100 → 8x V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_LAMBDALABS=y +CONFIG_TERRAFORM_LAMBDALABS_REGION_SMART_INFER=y +CONFIG_TERRAFORM_LAMBDALABS_INSTANCE_TYPE_8X_B200_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/lambdalabs-8x-h100-or-less new file +14 -0
@@ -0,0 +1,14 @@ +# Lambda Labs 8-GPU with tier-based fallback (H100 maximum tier) +# Uses 8X_H100_OR_LESS for best available 8-GPU up to H100 +# Fallback order: 8x H100 → 8x A100-80 → 8x A100 → 8x V100 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_LAMBDALABS=y +CONFIG_TERRAFORM_LAMBDALABS_REGION_SMART_INFER=y +CONFIG_TERRAFORM_LAMBDALABS_INSTANCE_TYPE_8X_H100_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/lambdalabs-a100-or-less new file +14 -0
@@ -0,0 +1,14 @@ +# Lambda Labs GPU with tier-based fallback (A100 maximum tier) +# Uses A100_OR_LESS for best available single GPU up to A100 +# Fallback order: A100-SXM → A100 → A6000 → RTX6000 → A10 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_LAMBDALABS=y +CONFIG_TERRAFORM_LAMBDALABS_REGION_SMART_INFER=y +CONFIG_TERRAFORM_LAMBDALABS_INSTANCE_TYPE_A100_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/lambdalabs-gh200-or-less new file +14 -0
@@ -0,0 +1,14 @@ +# Lambda Labs GPU with tier-based fallback (GH200 maximum tier) +# Uses GH200_OR_LESS for best available single GPU up to GH200 +# Fallback order: GH200 → H100-SXM → H100-PCIe → A100-SXM → A100 → A6000 → RTX6000 → A10 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_LAMBDALABS=y +CONFIG_TERRAFORM_LAMBDALABS_REGION_SMART_INFER=y +CONFIG_TERRAFORM_LAMBDALABS_INSTANCE_TYPE_GH200_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
defconfigs/lambdalabs-h100-or-less new file +14 -0
@@ -0,0 +1,14 @@ +# Lambda Labs GPU with tier-based fallback (H100 maximum tier) +# Uses H100_OR_LESS for best available single GPU up to H100 +# Fallback order: H100-SXM → H100-PCIe → A100-SXM → A100 → A6000 → RTX6000 → A10 +CONFIG_TERRAFORM=y +CONFIG_TERRAFORM_LAMBDALABS=y +CONFIG_TERRAFORM_LAMBDALABS_REGION_SMART_INFER=y +CONFIG_TERRAFORM_LAMBDALABS_INSTANCE_TYPE_H100_OR_LESS=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_OVERWRITE=y +CONFIG_TERRAFORM_SSH_CONFIG_GENKEY_EMPTY_PASSPHRASE=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y
playbooks/roles/terraform/tasks/main.yml +104 -1
127 lines not on this page · raw message
scripts/lambdalabs_check_capacity.py new file +124 -0
124 lines not on this page · raw message
scripts/lambdalabs_select_tier.py new file +313 -0
313 lines not on this page · raw message
terraform/lambdalabs/kconfigs/Kconfig.compute +68 -0
80 lines not on this page · raw message
Signature · 1 line
2.51.0
Chuck Lever
AppliedRe: [PATCH 6/8] terraform: Add tier-based GPU selection for Lambda Labs
Quoted 15 lines · Luis Chamberlain
Add support for tier-based GPU instance selection for Lambda Labs, similar to the existing DataCrunch implementation. This allows users to specify a maximum GPU tier and the system will automatically select the highest available GPU within that tier.
The implementation adds capacity checking and tier selection scripts that query the Lambda Labs API to find available instances. Single GPU tier groups fall back from GH200 to H100 to A100 to A6000 to A10. Multi-GPU tier groups fall back from 8x B200 to 8x H100 to 8x A100 to 8x V100.
New
Kconfigoptions provide tier-based selections likeH100_OR_LESSand 8X_H100_OR_LESS. The terraform ansible tasks detect these wildcard types and invoke the tier selection script to find available capacity before provisioning.
Quoted 6 lines
Defconfigs are provided for common tier combinations to simplify usage. Users can now run commands like make defconfig-lambdalabs-h100-or-less to get the best available single GPU up to H100 tier.
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>
Merged into origin/main.
---
Chuck Lever
PATCH 7/8 terraform: Document tier-based GPU selection for Lambda Labs
In reply to Luis ChamberlainAdd comprehensive documentation for the tier-based GPU selection feature to the Lambda Labs README. This includes documentation for the capacity checking and tier selection scripts, the available tier groups for both single GPU and multi-GPU configurations, and quick start examples.
The documentation covers how tier-based selection works with automatic fallback from higher to lower GPU tiers when capacity is unavailable. It also updates the defconfigs table and scripts reference to include the new tier-based options.
--- terraform/lambdalabs/README.md | 103 +++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+)
terraform/lambdalabs/README.md +103 -0
@@ -8,6 +8,7 @@ This directory contains the Terraform configuration for deploying kdevops infras - [Prerequisites](#prerequisites) - [Quick Start](#quick-start) - [Dynamic Configuration](#dynamic-configuration) +- [Tier-Based GPU Selection](#tier-based-gpu-selection) - [SSH Key Security](#ssh-key-security) - [Configuration Options](#configuration-options) - [Provider Limitations](#provider-limitations)
@@ -111,6 +112,101 @@ scripts/lambda-cli --output json pricing list For more details on the dynamic configuration system, see [Dynamic Cloud Kconfig Documentation](../../docs/dynamic-cloud-kconfig.md). +## Tier-Based GPU Selection + +Lambda Labs supports tier-based GPU selection with automatic fallback. Instead of specifying +a single instance type, you can specify a maximum tier and kdevops will automatically select +the highest available GPU within that tier. + +### How It Works + +1. **Specify Maximum Tier**: Choose a tier group like `H100_OR_LESS` +2. **Capacity Check**: The system queries Lambda Labs API for available instances +3. **Tier Fallback**: Tries each tier from highest to lowest until one is available +4. **Auto-Provision**: Deploys to the first region with available capacity + +### Single GPU Tier Groups + +| Tier Group | Fallback Order | Use Case | +|------------|----------------|----------| +| `GH200_OR_LESS` | GH200 → H100-SXM → H100-PCIe → A100-SXM → A100 → A6000 → RTX6000 → A10 | Maximum performance | +| `H100_OR_LESS` | H100-SXM → H100-PCIe → A100-SXM → A100 → A6000 → RTX6000 → A10 | High performance | +| `A100_OR_LESS` | A100-SXM → A100 → A6000 → RTX6000 → A10 | Cost-effective | +| `A6000_OR_LESS` | A6000 → RTX6000 → A10 | Budget-friendly | + +### Multi-GPU (8x) Tier Groups + +| Tier Group | Fallback Order | Use Case | +|------------|----------------|----------| +| `8X_B200_OR_LESS` | 8x B200 → 8x H100 → 8x A100-80 → 8x A100 → 8x V100 | Maximum multi-GPU | +| `8X_H100_OR_LESS` | 8x H100 → 8x A100-80 → 8x A100 → 8x V100 | High-end multi-GPU | +| `8X_A100_OR_LESS` | 8x A100-80 → 8x A100 → 8x V100 | Cost-effective multi-GPU | + +### Quick Start with Tier Selection + +```bash +# Single GPU - best available up to H100 +make defconfig-lambdalabs-h100-or-less +make bringup + +# Single GPU - best available up to GH200 +make defconfig-lambdalabs-gh200-or-less +make bringup + +# 8x GPU - best available up to H100 +make defconfig-lambdalabs-8x-h100-or-less +make bringup +``` + +### Checking Capacity + +Before deploying, you can check current GPU availability: + +```bash +# Check all available GPU instances +python3 scripts/lambdalabs_check_capacity.py + +# Check specific instance type +python3 scripts/lambdalabs_check_capacity.py --instance-type gpu_1x_h100_sxm5 + +# JSON output for scripting +python3 scripts/lambdalabs_check_capacity.py --json +``` + +### Tier Selection Script + +The tier selection script finds the best available GPU: + +```bash +# Find best single GPU up to H100 +python3 scripts/lambdalabs_select_tier.py h100-or-less --verbose + +# Find best 8x GPU up to H100 +python3 scripts/lambdalabs_select_tier.py 8x-h100-or-less --verbose + +# List all available tier groups +python3 scripts/lambdalabs_select_tier.py --list-tiers +``` + +Example output: +``` +Checking tier group: h100-or-less +Tiers to check (highest to lowest): h100-sxm, h100-pcie, a100-sxm, a100, a6000, rtx6000, a10 + +Checking tier 'h100-sxm': gpu_1x_h100_sxm5 + Checking gpu_1x_h100_sxm5... ✓ AVAILABLE in us-west-1 + +Selected: gpu_1x_h100_sxm5 in us-west-1 (tier: h100-sxm) +gpu_1x_h100_sxm5 us-west-1 +``` + +### Benefits of Tier-Based Selection + +- **Higher Success Rate**: Automatically falls back to available GPUs +- **No Manual Intervention**: System handles capacity changes +- **Best Performance**: Always gets the highest tier available +- **Simple Configuration**: One defconfig covers multiple GPU types + ## SSH Key Security ### Automatic Unique Keys (Default - Recommended)
@@ -168,6 +264,11 @@ The default configuration automatically: |--------|-------------|----------| | `defconfig-lambdalabs` | Smart instance + unique SSH keys | Production (recommended) | | `defconfig-lambdalabs-shared-key` | Smart instance + shared SSH key | Legacy/testing | +| `defconfig-lambdalabs-gh200-or-less` | Best single GPU up to GH200 | Maximum performance | +| `defconfig-lambdalabs-h100-or-less` | Best single GPU up to H100 | High performance | +| `defconfig-lambdalabs-a100-or-less` | Best single GPU up to A100 | Cost-effective | +| `defconfig-lambdalabs-8x-b200-or-less` | Best 8-GPU up to B200 | Maximum multi-GPU | +| `defconfig-lambdalabs-8x-h100-or-less` | Best 8-GPU up to H100 | High-end multi-GPU | ### Manual Configuration
@@ -274,6 +375,8 @@ The Lambda Labs Terraform provider (elct9620/lambdalabs v0.3.0) has significant |--------|---------| | `lambdalabs_api.py` | Main API integration, generates Kconfig | | `lambdalabs_smart_inference.py` | Smart instance/region selection | +| `lambdalabs_check_capacity.py` | Check GPU availability across regions | +| `lambdalabs_select_tier.py` | Tier-based GPU selection with fallback | | `lambdalabs_ssh_keys.py` | SSH key management | | `lambdalabs_list_instances.py` | List running instances | | `lambdalabs_credentials.py` | Manage API credentials |
Signature · 1 line
2.51.0
Re: [PATCH 7/8] terraform: Document tier-based GPU selection for Lambda Labs
Quoted 5 lines · Luis Chamberlain
Add comprehensive documentation for the tier-based GPU selection feature to the Lambda Labs README. This includes documentation for the capacity checking and tier selection scripts, the available tier groups for both single GPU and multi-GPU configurations, and quick start examples.
Quoted 7 lines
The documentation covers how tier-based selection works with automatic fallback from higher to lower GPU tiers when capacity is unavailable. It also updates the defconfigs table and scripts reference to include the new tier-based options.
Generated-by Claude AISigned-off-by Luis Chamberlain <[email protected]>
Patches 7/8 and 8/8 have been merged into origin/main.
--
Chuck Lever
PATCH 8/8 docs: Organize cloud providers with Neoclouds section
In reply to Luis ChamberlainReorganize the terraform documentation to distinguish between traditional cloud providers and neoclouds. A neocloud is a specialized cloud provider focused on GPU-as-a-Service for AI and ML workloads, with infrastructure optimized for raw speed, dense GPU clusters, and simplified pricing.
Traditional providers include Azure, AWS, GCE, and OCI. Neoclouds include DataCrunch and Lambda Labs with their GPU-focused offerings. The documentation now includes links to Lambda Labs dynamic Kconfig generation and CLI reference documentation.
--- README.md | 2 +- docs/kdevops-terraform.md | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-)
README.md +1 -1
@@ -526,7 +526,7 @@ Below are sections which get into technical details of how kdevops works. * [Linux distribution support](docs/linux-distro-support.md) * [Overriding all Ansible role options with one file](docs/ansible-override.md) * [kdevops Vagrant support](docs/kdevops-vagrant.md) - * [kdevops terraform support - cloud setup with kdevops](docs/kdevops-terraform.md) + * [kdevops terraform and cloud provider support](docs/kdevops-terraform.md) - AWS, Azure, GCE, OCI, Lambda Labs, DataCrunch * [kdevops local Ansible roles](docs/ansible-roles.md) * [Tutorial on building your own custom Vagrant boxes](docs/custom-vagrant-boxes.md)
docs/kdevops-terraform.md +32 -1
@@ -7,10 +7,13 @@ a Terraform plan. Terraform is used to deploy your development hosts on cloud virtual machines. Below are the list of clouds providers currently supported: +**Traditional Cloud Providers:** * azure - Microsoft Azure * aws - Amazon Web Service * gce - Google Cloud Compute * oci - Oracle Cloud Infrastructure + +**Neoclouds (GPU-optimized):** * datacrunch - DataCrunch GPU Cloud * lambdalabs - Lambda Labs GPU Cloud
@@ -271,7 +274,18 @@ If your Ansible controller (where you run "make bringup") and your test instances operate inside the same subnet, you can disable the TERRAFORM_OCI_ASSIGN_PUBLIC_IP option for better network security. -### DataCrunch - GPU Cloud Provider +## Neoclouds + +A neocloud is a new type of specialized cloud provider that focuses on offering +high-performance computing, particularly GPU-as-a-Service, to handle demanding +AI and machine learning workloads. Unlike traditional, general-purpose cloud +providers like AWS or Azure, neoclouds are purpose-built for AI with +infrastructure optimized for raw speed, specialized hardware like dense GPU +clusters, and tailored services like fast deployment and simplified pricing. + +kdevops supports the following neocloud providers: + +### DataCrunch kdevops supports DataCrunch, a cloud provider specialized in GPU computing with competitive pricing for NVIDIA A100, H100, B200, and B300 instances.
@@ -450,3 +464,20 @@ provider_installation { ``` For more information, visit: https://datacrunch.io/ + +### Lambda Labs + +kdevops supports Lambda Labs, a cloud provider focused on GPU instances for +machine learning workloads with competitive pricing. + +For detailed documentation on Lambda Labs integration, including tier-based +GPU selection, smart instance selection, and dynamic Kconfig generation, see: + + * [Lambda Labs Dynamic Cloud Kconfig](dynamic-cloud-kconfig.md) - Dynamic configuration generation for Lambda Labs + * [Lambda Labs CLI Reference](lambda-cli.1) - Man page for the lambda-cli tool + +Lambda Labs offers various GPU instance types including A10, A100, and H100 +configurations. kdevops provides smart selection features that automatically +choose the cheapest available instance type and region. + +For more information, visit: https://lambdalabs.com/
Signature · 1 line
2.51.0