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

New Resource: aws_sagemaker_notebook_instance #2999

Merged

Conversation

ddcprg
Copy link
Contributor

@ddcprg ddcprg commented Jan 15, 2018

Helps resolving #2493

@ddcprg ddcprg mentioned this pull request Jan 15, 2018
@radeksimko radeksimko added service/sagemaker Issues and PRs that pertain to the sagemaker service. new-resource Introduces a new resource. labels Jan 16, 2018
@radeksimko radeksimko changed the title New resource: SageMaker Notebook Instance New Resource: aws_sagemaker_notebook_instance Jan 16, 2018
} else {
name = v.(string)
}

Choose a reason for hiding this comment

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

This else clause is not needed since we return in the error case anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, I'll fix the training job as well

@ddcprg ddcprg force-pushed the feature/sagemaker-vendor-notebook-instance branch 2 times, most recently from aa694da to c0d40d6 Compare January 26, 2018 14:59
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"log"
"time"
Copy link

Choose a reason for hiding this comment

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

The common pattern in this codebase is to separate stdlib imports from others, so these across this PR should be

"fmt"
"log"
"time"

"github.com/aws/aws-sdk-go/aws"
...

etc, eg: https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_api_gateway_api_key_test.go#L4

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI goimports is the tool that does this automatically (personally I have it setup in my editor on save): https://godoc.org/golang.org/x/tools/cmd/goimports

Copy link
Contributor Author

@ddcprg ddcprg Jan 30, 2018

Choose a reason for hiding this comment

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

Thanks both, I'll fix this and the other PR today

@ddcprg ddcprg force-pushed the feature/sagemaker-vendor-notebook-instance branch from c0d40d6 to 4f9e248 Compare January 30, 2018 10:54
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jan 30, 2018
@toyama0919
Copy link

How is this PR going?

@ddcprg
Copy link
Contributor Author

ddcprg commented Mar 22, 2018

The build has failed due to S3 errors in aws/validators_test.go

@ddcprg
Copy link
Contributor Author

ddcprg commented May 16, 2018

The build error is unrelated to this PR

@bcornils
Copy link
Contributor

Looks like we have a check failing. Were we able to identify the criticality of it?

@ddcprg
Copy link
Contributor Author

ddcprg commented Jun 12, 2018

@bcornils I'll merge master and build again, the error was unrelated to this change last time I checked

@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jun 12, 2018
@ddcprg
Copy link
Contributor Author

ddcprg commented Jun 13, 2018

I was missing the sidebar in the docs so I've added it. I've merged master into this branch and the build still fails with this error:

# github.com/terraform-providers/terraform-provider-aws/aws
aws/validators_test.go:559:16: undefined: validateS3BucketLifecycleExpirationDays
aws/validators_test.go:571:16: undefined: validateS3BucketLifecycleExpirationDays
aws/validators_test.go:587:16: undefined: validateS3BucketLifecycleTransitionDays
aws/validators_test.go:598:16: undefined: validateS3BucketLifecycleTransitionDays
aws/validators_test.go:612:13: cannot assign 1 values to 2 variables
aws/validators_test.go:612:53: too many arguments in call to validateS3BucketLifecycleStorageClass
	have (string, string)
	want ()
aws/validators_test.go:623:13: cannot assign 1 values to 2 variables
aws/validators_test.go:623:53: too many arguments in call to validateS3BucketLifecycleStorageClass
	have (string, string)
	want ()
aws/validators_test.go:639:16: undefined: validateS3BucketReplicationRuleId
aws/validators_test.go:650:16: undefined: validateS3BucketReplicationRuleId
aws/validators_test.go:650:16: too many errors
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
FAIL	github.com/terraform-providers/terraform-provider-aws/aws [build failed]
make: *** [test] Error 2

Same issue in PR #2955

@ddcprg
Copy link
Contributor Author

ddcprg commented Jun 13, 2018

@bflad can we get some eyes on this PR?

@ibash
Copy link

ibash commented Jul 17, 2018

🙌

@nhjiejan
Copy link

Any Update on this? working version available yet?

@ddcprg
Copy link
Contributor Author

ddcprg commented Sep 21, 2018

we've not received any feedback from Hashicorp

@rainmanh
Copy link

rainmanh commented Oct 5, 2018

Updates? When will be sagemaker ready?

@ghost ghost added the documentation Introduces or discusses updates to documentation. label Nov 1, 2018
@ghost ghost added provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 1, 2018
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hello @ddcprg, I'm sorry for the delay on reviewing this PR. This review is fairly large but the design looks great. Feel free to leave any comments on concerns on any of the points mentioned and we'll get this merged in soon

}

resource "aws_iam_role" "foo" {
name = "terraform-testacc-sagemaker-foo"
Copy link
Member

Choose a reason for hiding this comment

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

If this test fails, the rest of the tests will fail as well since this name isn't randomized. Do you mind randomizing this and all other names to prevent one test failure bringing the rest of the tests down?

}

resource "aws_iam_role" "foo" {
name = "terraform-testacc-sagemaker-foo"
Copy link
Member

Choose a reason for hiding this comment

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

Same randomization note as above

}

resource "aws_iam_role" "foo" {
name = "terraform-testacc-sagemaker-foo"
Copy link
Member

Choose a reason for hiding this comment

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

Same randomization note as above.

}

resource "aws_iam_role" "foo" {
name = "terraform-testacc-sagemaker-foo"
Copy link
Member

Choose a reason for hiding this comment

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

Same randomization note as above

ForceNew: true,
},

"creation_time": {
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe time attributes carry the most beneficial of information that Terraform needs to keep track of it. Is there a good reason for having it in this resource or can we remove it?

}
log.Printf("[INFO] Stopping Sagemaker training job: %s", d.Id())

return resource.Retry(5*time.Minute, func() *resource.RetryError {
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest using the StateChangeConf method noted above.


const sagemakerTestAccSagemakerTrainingJobResourceNamePrefix = "terraform-testacc-"

func init() {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this sweeper is unfinished and unneeded since we can't delete the training job. Do you mind removing this?

trainingJobName := resource.PrefixedUniqueId(sagemakerTestAccSagemakerTrainingJobResourceNamePrefix)
bucketName := resource.PrefixedUniqueId(sagemakerTestAccSagemakerTrainingJobResourceNamePrefix)

resource.Test(t, resource.TestCase{
Copy link
Member

Choose a reason for hiding this comment

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

We can set all of these resource.Test to resource.ParrallelTest

log.Printf("[ERR] Error setting Stopping Condition: %s", err)
return err
}
if err := d.Set("hyper_parameters", fromStringPMapToTerraformMapSagemaker(&trainingJob.HyperParameters)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

We can use the helper for maps instead of this custom function.

return err
}

d.Set("tags", tagsToMapSagemaker(tagsOutput.Tags))
Copy link
Member

Choose a reason for hiding this comment

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

Just in case, we should check for an error while setting tags

@mbfrahry mbfrahry self-assigned this Jan 10, 2019
@mbfrahry
Copy link
Member

Hey all. These changes from this review are being tracked in a new branch here

@ghost
Copy link

ghost commented Apr 1, 2020

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 and limited conversation to collaborators Apr 1, 2020
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.