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

r/sagemaker_app - new resource #17251

Merged
merged 35 commits into from
Feb 25, 2021
Merged

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Jan 22, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #17402

Output from acceptance testing:

$ ACCTEST_PARALLELISM=1 make testacc TESTARGS='-run=TestAccAWSSagemakerApp_'

--- PASS: TestAccAWSSagemakerApp_tags (940.80s)
--- PASS: TestAccAWSSagemakerApp_basic (853.22s)
--- PASS: TestAccAWSSagemakerApp_resourceSpec (1016.37s)
--- PASS: TestAccAWSSagemakerApp_disappears (737.55s)
$ ACCTEST_PARALLELISM=1 make testacc TESTARGS='-run=TestAccAWSSagemakerUserProfile_disappears'

--- PASS: TestAccAWSSagemakerUserProfile_disappears (263.88s)
$ ACCTEST_PARALLELISM=1 make testacc TESTARGS='-run=TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage'
--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage (383.50s)

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/sagemaker Issues and PRs that pertain to the sagemaker service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 22, 2021
@DrFaust92 DrFaust92 added the new-resource Introduces a new resource. label Jan 22, 2021
Base automatically changed from master to main January 23, 2021 01:00
@DrFaust92 DrFaust92 force-pushed the r/sagemaker_app branch 3 times, most recently from baab6f6 to 927aede Compare January 28, 2021 22:53
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Jan 28, 2021
@DrFaust92 DrFaust92 marked this pull request as ready for review January 29, 2021 10:36
@DrFaust92 DrFaust92 requested a review from a team as a code owner January 29, 2021 10:36
@ewbankkit ewbankkit self-assigned this Jan 29, 2021
.changelog/17251.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerApp_\|TestAccAWSSagemakerUserProfile_disappears' ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run=TestAccAWSSagemakerApp_\|TestAccAWSSagemakerUserProfile_disappears -timeout 120m
=== RUN   TestAccAWSSagemakerApp_basic
=== PAUSE TestAccAWSSagemakerApp_basic
=== RUN   TestAccAWSSagemakerApp_resourceSpec
=== PAUSE TestAccAWSSagemakerApp_resourceSpec
=== RUN   TestAccAWSSagemakerApp_tags
=== PAUSE TestAccAWSSagemakerApp_tags
=== RUN   TestAccAWSSagemakerApp_disappears
=== PAUSE TestAccAWSSagemakerApp_disappears
=== RUN   TestAccAWSSagemakerUserProfile_disappears
=== PAUSE TestAccAWSSagemakerUserProfile_disappears
=== CONT  TestAccAWSSagemakerApp_basic
--- PASS: TestAccAWSSagemakerApp_basic (602.93s)
=== CONT  TestAccAWSSagemakerApp_disappears
--- PASS: TestAccAWSSagemakerApp_disappears (775.08s)
=== CONT  TestAccAWSSagemakerUserProfile_disappears
--- PASS: TestAccAWSSagemakerUserProfile_disappears (196.78s)
=== CONT  TestAccAWSSagemakerApp_tags
--- PASS: TestAccAWSSagemakerApp_tags (942.22s)
=== CONT  TestAccAWSSagemakerApp_resourceSpec
--- PASS: TestAccAWSSagemakerApp_resourceSpec (826.60s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	3343.715s
$ SAGEMAKER_IMAGE_VERSION_BASE_IMAGE=x make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage -timeout 120m
=== RUN   TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage
=== PAUSE TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage
=== CONT  TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage
--- PASS: TestAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage (260.99s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	261.094s

@DrFaust92 DrFaust92 marked this pull request as draft February 4, 2021 08:29
@DrFaust92 DrFaust92 marked this pull request as ready for review February 4, 2021 10:21
@DrFaust92 DrFaust92 marked this pull request as draft February 4, 2021 10:22
@DrFaust92
Copy link
Collaborator Author

Serialized Sagemaker Studio tests

rName := acctest.RandomWithPrefix("tf-acc-test")
resourceName := "aws_sagemaker_app.test"

resource.ParallelTest(t, resource.TestCase{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get test serialization you will also have to change all the relevant resource.ParallelTest(...) calls into resource.Test(...) calls, otherwise I get errors like:

$ SAGEMAKER_IMAGE_VERSION_BASE_IMAGE=x make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_\|TestAccAWSSagemakerApp_\|TestAccAWSSagemakerUserProfile_disappears'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSSagemakerDomain_\|TestAccAWSSagemakerApp_\|TestAccAWSSagemakerUserProfile_disappears -timeout 120m
=== RUN   TestAccAWSSagemakerDomain_serial
=== RUN   TestAccAWSSagemakerDomain_serial/Domain
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/basic
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/basic
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/tags
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/tags
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettings
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings_customImage
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings_customImage
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/jupyterServerAppSettings
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/kms
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/kms
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/disappears
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/disappears
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettingsWithImage
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettingsWithImage
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/securityGroup
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/securityGroup
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/sharingSettings
=== PAUSE TestAccAWSSagemakerDomain_serial/Domain/sharingSettings
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/basic
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/sharingSettings
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/securityGroup
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettingsWithImage
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/disappears
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/kms
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/jupyterServerAppSettings
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings_customImage
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettings
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/tags
=== CONT  TestAccAWSSagemakerDomain_serial/Domain/securityGroup
    resource_aws_sagemaker_domain_test.go:224: Step 1/3 error: Error running apply: 2021/02/04 07:51:43 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.12.0
        
        Error: error creating SageMaker domain: ResourceLimitExceeded: The account-level service limit 'Total domains' is 1 Domains, with current utilization of 1 Domains and a request delta of 1 Domains. Please contact AWS support to request an increase for this limit.

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/service/sagemaker/finder"
)

func TestAccAWSSagemakerDomain_serial(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment noting that SageMaker app and user profile tests are also serialized as they reference a SageMaker domain resource and there is a low overall account limit to the number of domains.

@breathingdust
Copy link
Member

LGTM 🚀 Thanks @DrFaust92!

Verified Acceptance Tests in Commercial (us-west-2)

ACCTEST_TIMEOUT=600m SAGEMAKER_IMAGE_VERSION_BASE_IMAGE=x.dkr.ecr.us-west-2.amazonaws.com/smtest make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSagemakerDomain_serial'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSSagemakerDomain_serial -timeout 600m
=== RUN   TestAccAWSSagemakerDomain_serial
=== RUN   TestAccAWSSagemakerDomain_serial/Domain
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/sharingSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/basic
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/tags
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettingsWithImage
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/kms
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/disappears
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings_customImage
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/Domain/securityGroup
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/kernelGatewayAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/jupyterServerAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/basic
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/disappears
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/tags
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/tensorboardAppSettings
=== RUN   TestAccAWSSagemakerDomain_serial/UserProfile/tensorboardAppSettingsWithImage
=== RUN   TestAccAWSSagemakerDomain_serial/App
=== RUN   TestAccAWSSagemakerDomain_serial/App/basic
=== RUN   TestAccAWSSagemakerDomain_serial/App/disappears
=== RUN   TestAccAWSSagemakerDomain_serial/App/tags
=== RUN   TestAccAWSSagemakerDomain_serial/App/resourceSpec
--- PASS: TestAccAWSSagemakerDomain_serial (7755.79s)
    --- PASS: TestAccAWSSagemakerDomain_serial/Domain (2413.67s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/sharingSettings (253.48s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/basic (178.50s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/tags (218.93s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettings (310.72s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/tensorboardAppSettingsWithImage (249.84s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/kms (190.80s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/disappears (236.71s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings (191.01s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/kernelGatewayAppSettings_customImage (74.11s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/jupyterServerAppSettings (189.90s)
        --- PASS: TestAccAWSSagemakerDomain_serial/Domain/securityGroup (319.67s)
    --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile (2218.77s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/kernelGatewayAppSettings (266.94s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/jupyterServerAppSettings (368.26s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/basic (226.84s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/disappears (437.79s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/tags (369.45s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/tensorboardAppSettings (272.96s)
        --- PASS: TestAccAWSSagemakerDomain_serial/UserProfile/tensorboardAppSettingsWithImage (276.51s)
    --- PASS: TestAccAWSSagemakerDomain_serial/App (3123.35s)
        --- PASS: TestAccAWSSagemakerDomain_serial/App/basic (800.60s)
        --- PASS: TestAccAWSSagemakerDomain_serial/App/disappears (788.74s)
        --- PASS: TestAccAWSSagemakerDomain_serial/App/tags (800.01s)
        --- PASS: TestAccAWSSagemakerDomain_serial/App/resourceSpec (734.00s)
PASS
Ok    github.com/terraform-providers/terraform-provider-aws/aws       7759.179s

@breathingdust breathingdust merged commit a2ae208 into hashicorp:main Feb 25, 2021
@github-actions github-actions bot added this to the v3.30.0 milestone Feb 26, 2021
@ghost
Copy link

ghost commented Feb 26, 2021

This has been released in version 3.30.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 28, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 28, 2021
@DrFaust92 DrFaust92 deleted the r/sagemaker_app branch April 15, 2021 10:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/sagemaker Issues and PRs that pertain to the sagemaker service. size/XXL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/service/sagemaker: Serialize or Enable Configurable Synchronization for Domain Testing
3 participants