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

make -C terraform init dirties provider lock file #4751

Closed
nadove-ucsc opened this issue Nov 21, 2022 · 4 comments
Closed

make -C terraform init dirties provider lock file #4751

nadove-ucsc opened this issue Nov 21, 2022 · 4 comments
Assignees
Labels
- [priority] Medium bug [type] A defect preventing use of the system as specified debt [type] A defect incurring continued engineering cost infra [subject] Project infrastructure like CI/CD, build and deployment scripts no demo [process] Not to be demonstrated at the end of the sprint orange [process] Done by the Azul team

Comments

@nadove-ucsc
Copy link
Contributor

$ git status -sb
## develop...github/develop
?? terraform/.terraform/
$ make -C terraform/ init
make: Entering directory '/home/nadove/PycharmProjects/azul-sc/terraform'
python /home/nadove/PycharmProjects/azul-sc/scripts/check_branch.py
rm -rf *.tf.json service indexer /home/nadove/PycharmProjects/azul-sc/deployments/.active/.terraform.platform-hca-dev
python /home/nadove/PycharmProjects/azul-sc/scripts/migrate_terraform_state.py
2022-11-20 23:38:04,369 INFO    MainThread: Migrating Terraform state at {'Bucket': 'edu-ucsc-gi-singlecell-azul-config-dev.us-east-1', 'Key': 'azul--nadove.tfstate'}
2022-11-20 23:38:04,382 INFO    MainThread: Found credentials in environment variables.
2022-11-20 23:38:13,267 INFO    MainThread: Terraform state appears to have been migrated already.
python providers.tf.json.template.py providers.tf.json
Creating providers.tf.json
python backend.tf.json.template.py backend.tf.json
Creating backend.tf.json
terraform init -reconfigure

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Reusing previous version of hashicorp/external from the dependency lock file
- Reusing previous version of hashicorp/null from the dependency lock file
- Reusing previous version of hashicorp/google from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Installing hashicorp/external v2.2.0...
- Installed hashicorp/external v2.2.0 (signed by HashiCorp)
- Installing hashicorp/null v3.2.0...
- Installed hashicorp/null v3.2.0 (signed by HashiCorp)
- Installing hashicorp/google v3.90.1...
- Installed hashicorp/google v3.90.1 (signed by HashiCorp)
- Installing hashicorp/aws v4.30.0...
- Installed hashicorp/aws v4.30.0 (signed by HashiCorp)

Terraform has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
make: Leaving directory '/home/nadove/PycharmProjects/azul-sc/terraform'
$ git diff
diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl
index 44deff19..17e2e6de 100644
--- a/terraform/.terraform.lock.hcl
+++ b/terraform/.terraform.lock.hcl
@@ -6,6 +6,7 @@ provider "registry.terraform.io/hashicorp/aws" {
   constraints = "4.30.0"
   hashes = [
     "h1:/TOHrFrfQaj16peTH3D7JmEgqAVyO6EpHNxaq1qxIoE=",
+    "h1:BFfhRf8my/aa0+YOSJv0xfjLQkToF475TJTMhTZfYec=",
     "h1:IcwEoCZhcgFkk4ySB+6lvEPS90eys+FVuj+TZYVhGS0=",
     "zh:08213f3ba960621448754211f148730edb59194919ee476b0231b769a5355028",
     "zh:29c90d6f8bdae0e1469417ade28fa79c74c2af49593c1e2f24f07bacbca9e2c9",
@@ -27,6 +28,7 @@ provider "registry.terraform.io/hashicorp/external" {
   constraints = "2.2.0"
   hashes = [
     "h1:V1XoXkVwM+Bg73BNtbMxScjTcty2jbRZzgSdHrYxQ+4=",
+    "h1:iU5OVMibHvIxbj2Dye1q3aYpjYXS3bKL9iZWZyh+xTg=",
     "h1:xb07xydqZU4Tt0mwVvMAP8Cr0D8aENZ51AufUqelATA=",
     "zh:094c3cfae140fbb70fb0e272b1df833b4d7467c6c819fbf59a3e8ac0922f95b6",
     "zh:15c3906abbc1cd03a72afd02bda9caeeb5f6ca421292c32ddeb2acd7a3488669",
@@ -47,6 +49,7 @@ provider "registry.terraform.io/hashicorp/google" {
   version     = "3.90.1"
   constraints = "3.90.1"
   hashes = [
+    "h1:91QFfSGwMX4wKH5u+/FEMf2W3mToJxHtw/Ty0nvrDEU=",
     "h1:9TYwyR4R4dIop7wV2lvvYZHw9RUVd/YRWR+9jjXpyfw=",
     "h1:Z6roZilqTNFFWigBNqnZvKVf7wng+59hmWIjz1t5Epk=",
     "zh:07aabc8e46a5a2b29932e10677b23d4ce9d9a25f22ab61d3307a6b0e7998c84e",
@@ -68,6 +71,7 @@ provider "registry.terraform.io/hashicorp/null" {
   constraints = "3.2.0"
   hashes = [
     "h1:6yiJqQ6JAJW3oMxuZrWoUgHYpkscorX40Q/LzOMzY+w=",
+    "h1:pfjuwssoCoBDRbutlVLAP8wiDrkQ3G4d3rs+f7uSh2A=",
     "zh:1d88ea3af09dcf91ad0aaa0d3978ca8dcb49dc866c8615202b738d73395af6b5",
     "zh:3844db77bfac2aca43aaa46f3f698c8e5320a47e838ee1318408663449547e7e",
     "zh:538fadbd87c576a332b7524f352e6004f94c27afdd3b5d105820d328dc49c5e3",
@github-actions github-actions bot added the orange [process] Done by the Azul team label Nov 21, 2022
@hannes-ucsc
Copy link
Member

See hashicorp/terraform#28041 which fixes this in the upcoming 1.4 release. In the meantime, implement the workaround mentioned on that issue: terraform providers lock -platform=linux_amd64 -platform=darwin_amd64 immediately after the first invocation of terraform init in the Makefile. Also add a check to ensure that the lock file is clean afterwards.

@dsotirho-ucsc
Copy link
Contributor

@hannes-ucsc: "Also need -platform=darwin_arm64 and -platform=linux_arm64"

@dsotirho-ucsc dsotirho-ucsc added bug [type] A defect preventing use of the system as specified debt [type] A defect incurring continued engineering cost infra [subject] Project infrastructure like CI/CD, build and deployment scripts labels Nov 22, 2022
@hannes-ucsc hannes-ucsc changed the title make -C terraform/ init dirties Terraform dependency lock file make -C terraform init dirties provider lock file Mar 16, 2023
@hannes-ucsc hannes-ucsc self-assigned this Mar 17, 2023
@dsotirho-ucsc
Copy link
Contributor

@hannes-ucsc: "For demo, show how to update a provider."

@dsotirho-ucsc dsotirho-ucsc added the demo [process] To be demonstrated at the end of the sprint label Mar 21, 2023
@hannes-ucsc
Copy link
Member

I struggled to demonstrate this. The procedure should be documented. Putting back to Sprint for me.

@hannes-ucsc hannes-ucsc added the - [priority] Medium label Oct 5, 2023
@hannes-ucsc hannes-ucsc added no demo [process] Not to be demonstrated at the end of the sprint and removed demo [process] To be demonstrated at the end of the sprint labels Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- [priority] Medium bug [type] A defect preventing use of the system as specified debt [type] A defect incurring continued engineering cost infra [subject] Project infrastructure like CI/CD, build and deployment scripts no demo [process] Not to be demonstrated at the end of the sprint orange [process] Done by the Azul team
Projects
None yet
Development

No branches or pull requests

3 participants