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

Documentation for google_container_node_pool.guest_accelerator optional fields does not match behavior #17972

Open
dannysauer opened this issue Apr 26, 2024 · 2 comments
Assignees
Labels

Comments

@dannysauer
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version

Terraform v1.7.5
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v5.26.0

Your version of Terraform is out of date! The latest version
is 1.8.2. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

google_container_node_pool

Terraform Configuration

    guest_accelerator = [
      {
        type  = "nvidia-tesla-t4"
        count = 2
        # known bug: https://github.com/hashicorp/terraform-provider-google/issues/10415
        gpu_partition_size = null
      }
    ]
    tags = ["gke-node", "circleci", "${var.prefix}"]
    metadata = {
      disable-legacy-endpoints = "true"
    }
  }

Debug Output

N/A

Expected Behavior

Running terraform plan should have generated a plan, probably with no changes since I only updated the provider version from 4.30.0 to 5.26.0

Actual Behavior

I get this error:

│ Error: Incorrect attribute value type
│ 
│   on gke.tf line 117, in resource "google_container_node_pool" "circleci_nodes":
│  117:     guest_accelerator = [
│  118:       {
│  119:         type  = "nvidia-tesla-t4"
│  120:         count = 2
│  121:         # known bug: https://github.com/hashicorp/terraform-provider-google/issues/10415
│  122:         gpu_partition_size = null
│  123:       }
│  124:     ]
│ 
│ Inappropriate value for attribute "guest_accelerator": element 0: attributes "gpu_driver_installation_config" and "gpu_sharing_config" are
│ required.

This error happens despite the documentation saying those required attributes are optional:

The guest_accelerator block supports:

type (Required) - The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80.

count (Required) - The number of the guest accelerator cards exposed to this instance.

gpu_driver_installation_config (Optional) - Configuration for auto installation of GPU driver. Structure is documented below.

gpu_partition_size (Optional) - Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide.

gpu_sharing_config (Optional) - Configuration for GPU sharing. Structure is documented below.

Steps to reproduce

  1. implement according to the docs
  2. terraform plan
  3. ???
  4. profit

Important Factoids

The plan also unsurprisingly fails after updating to the current terraform 1.8.2. 😉

References

No response

@dannysauer dannysauer added the bug label Apr 26, 2024
@github-actions github-actions bot added forward/review In review; remove label to forward service/container labels Apr 26, 2024
@dannysauer
Copy link
Author

Follow-up: actually reading the docs instead of trusting the code some earlier developer wrote...

    guest_accelerator {
      type  = "nvidia-tesla-t4"
      count = 2
      # known bug: https://github.com/hashicorp/terraform-provider-google/issues/10415
      gpu_partition_size = null
    }

works just fine. However, the error message is still wrong. The problem wasn't that optional attributes were missing; the problem was that a list assignment was being used instead of a block. 😆

@ggtisc
Copy link
Collaborator

ggtisc commented May 2, 2024

Hi @dannysauer!

Please share your complete terraform configuration to replicate this issue like in this example on the official terraform registry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants