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

Cloud Shell's Terraform version is too old for slurm-on-gke #913

Open
janetkuo opened this issue Dec 13, 2024 · 2 comments
Open

Cloud Shell's Terraform version is too old for slurm-on-gke #913

janetkuo opened this issue Dec 13, 2024 · 2 comments

Comments

@janetkuo
Copy link
Member

janetkuo commented Dec 13, 2024

slurm-on-gke instruction recommends using Cloud Shell, which has Terraform v1.5.7, and therefore will cause errors when running terraform commands.

For example,

│ Error: Unsupported Terraform Core version
│ 
│   on .terraform/modules/cluster-1-nodepool-1/modules/gke-nodepool/versions.tf line 16, in terraform:
│   16:   required_version = ">= 1.7.4"
│ 
│ Module module.cluster-1-nodepool-1 (from git::https://github.com/terraform-google-modules/cloud-foundation-fabric.git//modules/gke-nodepool?ref=v33.0.0) does not support
│ Terraform version 1.5.7. To proceed, either choose another supported Terraform version or update this version constraint. Version constraints are normally set for good
│ reason, so updating the constraint may lead to other errors or unexpected behavior.
@janetkuo
Copy link
Member Author

Users can't upgrade Terraform in Cloud Shell. Here's how I resolved it:

  1. Go to the Terraform downloads page: https://www.terraform.io/downloads
  2. Find the latest version for Linux (amd64).
  3. In Cloud Shell, use wget to download the zip file. e.g. wget https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_linux_amd64.zip
  4. Unzip it unzip terraform_1.10.2_linux_amd64.zip
  5. Run terraform using ./terraform instead of terraform (sudo mv terraform /usr/local/bin doesn't work)

@salander0411
Copy link

in cloudshell terminal , run below command to upgrade the terraform.

wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform

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

No branches or pull requests

2 participants