-
Notifications
You must be signed in to change notification settings - Fork 10.1k
PSS : Add fs and inmem state storage implementationd to the builtin simplev6 provider, update grpcwrap package, use PSS implementation in E2E test
#37790
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
Open
SarahFrench
wants to merge
23
commits into
main
Choose a base branch
from
pss/add-builtin-inmem-state-storage-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,250
−42
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
60e8997
Allow the builtin terraform provider to contain multiple PSS implemen…
SarahFrench 306d896
Make it easier to use provider.Interface as interface for state store…
SarahFrench 9f104fa
Add initial implementation of inmem state store to the builtin terraf…
SarahFrench b79de8d
Add method for getting an inmem store instance that has default works…
SarahFrench f54f95b
Copy some tests from the inmem backend and use for the inmem state st…
SarahFrench a3ffebd
Simplify code to avoid map of state stores, for now
SarahFrench c4e0274
WIP simple
SarahFrench 759df39
Implement inmem state store in provider-simple-v6, remove from builti…
SarahFrench c6cea63
Move PSS chunking-related constants into the `pluggable` package, so …
SarahFrench 320fa96
Implement PSS-related methods in grpcwrap package
SarahFrench 992eb53
Update e2e test - works as expected but is blocked at apply step by o…
SarahFrench eeaaac8
Fix issues in test fixture, rename it
SarahFrench 099b206
Update test - remove steps that are impossible to perform with inmem …
SarahFrench 40b9930
Stop gating the inMem state store behind TF_ACC in the simple6 provider
SarahFrench 4705e52
Skip E2E test for PSS unless experiments enabled
SarahFrench bd0fa59
Enable experiments in E2E tests in automation
SarahFrench 5f0581f
Add missing space to error message text
SarahFrench b986709
Fix TF_TEST_EXPERIMENT => TF_TEST_EXPERIMENTS
SarahFrench 2146307
Ensure state stores are configured with a suggested chunk size from Core
SarahFrench 0cc10c5
Small changes to inmem E2E test
SarahFrench 9979fe1
Add filesystem state store (no locking) and E2E test
SarahFrench 316d5b5
Replace ioutil.ReadDir with os.ReadDir
SarahFrench 9088fe5
fix: Pass through id of state to delete in grpcwrap's DeleteState met…
SarahFrench File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Copyright (c) HashiCorp, Inc. | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
|
|
||
| package pluggable | ||
|
|
||
| const ( | ||
| // DefaultStateStoreChunkSize is the default chunk size proposed | ||
| // to the provider. | ||
| // This can be tweaked but should provide reasonable performance | ||
| // trade-offs for average network conditions and state file sizes. | ||
| DefaultStateStoreChunkSize int64 = 8 << 20 // 8 MB | ||
|
|
||
| // MaxStateStoreChunkSize is the highest chunk size provider may choose | ||
| // which we still consider reasonable/safe. | ||
| // This reflects terraform-plugin-go's max. RPC message size of 256MB | ||
| // and leaves plenty of space for other variable data like diagnostics. | ||
| MaxStateStoreChunkSize int64 = 128 << 20 // 128 MB | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
internal/command/e2etest/testdata/full-workflow-with-state-store-fs/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| terraform { | ||
| required_providers { | ||
| simple6 = { | ||
| source = "registry.terraform.io/hashicorp/simple6" | ||
| } | ||
| } | ||
|
|
||
| state_store "simple6_fs" { | ||
| provider "simple6" {} | ||
| } | ||
| } | ||
|
|
||
| variable "name" { | ||
| default = "world" | ||
| } | ||
|
|
||
| resource "terraform_data" "my-data" { | ||
| input = "hello ${var.name}" | ||
| } | ||
|
|
||
| output "greeting" { | ||
| value = resource.terraform_data.my-data.output | ||
| } |
23 changes: 23 additions & 0 deletions
23
internal/command/e2etest/testdata/full-workflow-with-state-store-inmem/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| terraform { | ||
| required_providers { | ||
| simple6 = { | ||
| source = "registry.terraform.io/hashicorp/simple6" | ||
| } | ||
| } | ||
|
|
||
| state_store "simple6_inmem" { | ||
| provider "simple6" {} | ||
| } | ||
| } | ||
|
|
||
| variable "name" { | ||
| default = "world" | ||
| } | ||
|
|
||
| resource "terraform_data" "my-data" { | ||
| input = "hello ${var.name}" | ||
| } | ||
|
|
||
| output "greeting" { | ||
| value = resource.terraform_data.my-data.output | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realised that we never sent the default chunk size data from Core to the provider at the start of chunk size negotiation 😬