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

Replace duplicated gpu_definition.tf by shared internal module #3448

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions community/modules/compute/htcondor-execute-point/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ limitations under the License.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_execute_point_instance_template"></a> [execute\_point\_instance\_template](#module\_execute\_point\_instance\_template) | terraform-google-modules/vm/google//modules/instance_template | ~> 12.1 |
| <a name="module_gpu"></a> [gpu](#module\_gpu) | ../../../../modules/internal/gpu-definition | n/a |
| <a name="module_mig"></a> [mig](#module\_mig) | terraform-google-modules/vm/google//modules/mig | ~> 12.1 |
| <a name="module_startup_script"></a> [startup\_script](#module\_startup\_script) | ../../../../modules/scripts/startup-script | n/a |

Expand Down
9 changes: 9 additions & 0 deletions community/modules/compute/htcondor-execute-point/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ locals {
labels = merge(var.labels, { ghpc_module = "htcondor-execute-point", ghpc_role = "compute" })
}

module "gpu" {
source = "../../../../modules/internal/gpu-definition"

machine_type = var.machine_type
guest_accelerator = var.guest_accelerator
}

locals {
guest_accelerator = module.gpu.guest_accelerator

zones = coalescelist(var.zones, data.google_compute_zones.available.names)
network_storage_metadata = var.network_storage == null ? {} : { network_storage = jsonencode(var.network_storage) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ modules. For support with the underlying modules, see the instructions in the

| Name | Source | Version |
|------|--------|---------|
| <a name="module_gpu"></a> [gpu](#module\_gpu) | ../../../../modules/internal/gpu-definition | n/a |
| <a name="module_slurm_nodeset_template"></a> [slurm\_nodeset\_template](#module\_slurm\_nodeset\_template) | ../../internal/slurm-gcp/instance_template | n/a |

## Resources
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ locals {
labels = merge(var.labels, { ghpc_module = "schedmd-slurm-gcp-v6-nodeset-dynamic", ghpc_role = "compute" })
}

module "gpu" {
source = "../../../../modules/internal/gpu-definition"

machine_type = var.machine_type
guest_accelerator = var.guest_accelerator
}

locals {
guest_accelerator = module.gpu.guest_accelerator

nodeset_name = substr(replace(var.name, "/[^a-z0-9]/", ""), 0, 14)
feature = coalesce(var.feature, local.nodeset_name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ modules. For support with the underlying modules, see the instructions in the

## Modules

No modules.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_gpu"></a> [gpu](#module\_gpu) | ../../../../modules/internal/gpu-definition | n/a |

## Resources

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ locals {
labels = merge(var.labels, { ghpc_module = "schedmd-slurm-gcp-v6-nodeset", ghpc_role = "compute" })
}

module "gpu" {
source = "../../../../modules/internal/gpu-definition"

machine_type = var.machine_type
guest_accelerator = var.guest_accelerator
}

locals {
guest_accelerator = module.gpu.guest_accelerator

disable_automatic_updates_metadata = var.allow_automatic_updates ? {} : { google_disable_automatic_updates = "TRUE" }

metadata = merge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ limitations under the License.
|------|--------|---------|
| <a name="module_bucket"></a> [bucket](#module\_bucket) | terraform-google-modules/cloud-storage/google | ~> 6.1 |
| <a name="module_daos_network_storage_scripts"></a> [daos\_network\_storage\_scripts](#module\_daos\_network\_storage\_scripts) | ../../../../modules/scripts/startup-script | n/a |
| <a name="module_gpu"></a> [gpu](#module\_gpu) | ../../../../modules/internal/gpu-definition | n/a |
| <a name="module_nodeset_cleanup"></a> [nodeset\_cleanup](#module\_nodeset\_cleanup) | ./modules/cleanup_compute | n/a |
| <a name="module_nodeset_cleanup_tpu"></a> [nodeset\_cleanup\_tpu](#module\_nodeset\_cleanup\_tpu) | ./modules/cleanup_tpu | n/a |
| <a name="module_slurm_controller_template"></a> [slurm\_controller\_template](#module\_slurm\_controller\_template) | ../../internal/slurm-gcp/instance_template | n/a |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

module "gpu" {
source = "../../../../modules/internal/gpu-definition"

machine_type = var.machine_type
guest_accelerator = var.guest_accelerator
}

locals {
additional_disks = [
for ad in var.additional_disks : {
Expand Down Expand Up @@ -67,7 +74,7 @@ module "slurm_controller_template" {
enable_shielded_vm = var.enable_shielded_vm
shielded_instance_config = var.shielded_instance_config

gpu = one(local.guest_accelerator)
gpu = one(module.gpu.guest_accelerator)

machine_type = var.machine_type
metadata = local.metadata
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ modules. For support with the underlying modules, see the instructions in the

## Modules

No modules.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_gpu"></a> [gpu](#module\_gpu) | ../../../../modules/internal/gpu-definition | n/a |

## Resources

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ locals {
labels = merge(var.labels, { ghpc_module = "schedmd-slurm-gcp-v6-login", ghpc_role = "scheduler" })
}

module "gpu" {
source = "../../../../modules/internal/gpu-definition"

machine_type = var.machine_type
guest_accelerator = var.guest_accelerator
}

locals {
guest_accelerator = module.gpu.guest_accelerator

disable_automatic_updates_metadata = var.allow_automatic_updates ? {} : { google_disable_automatic_updates = "TRUE" }

metadata = merge(
Expand Down
1 change: 1 addition & 0 deletions modules/compute/gke-node-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ limitations under the License.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_gpu"></a> [gpu](#module\_gpu) | ../../internal/gpu-definition | n/a |
| <a name="module_kubectl_apply"></a> [kubectl\_apply](#module\_kubectl\_apply) | ../../management/kubectl-apply | n/a |

## Resources
Expand Down
Loading
Loading