terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

tests/resource/sagemaker_endpoint: Make test GovCloud compatible

Open YakDriver opened this issue 5 years ago • 1 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

This issue is a follow on of #16135.

The base config for SageMaker endpoint tests includes an aws_sagemaker_model that references a test fixture ("test-fixtures/sagemaker-tensorflow-serving-test-model.tar.gz") that uses TensorFlow Serving. In GovCloud, there is no prebuilt ECR image available for TensorFlow Serving (see aws/sagemaker-tensorflow-serving-container#176).

To fix these tests, allowing them to run in GovCloud, one of these solutions may work:

  1. Switching the algorithm and test fixture test model to an algorithm supported in GovCloud (see below)
  2. Wait for AWS to add a prebuilt ECR TensorFlow Serving image to GovCloud (see aws/sagemaker-tensorflow-serving-container#176) and then use that
  3. Wait for AWS to add a prebuilt ECR TensorFlow Serving image to ECR Public (see the announcement) and then use that

Libraries/algorithms available in GovCloud:

  • "blazingtext"
  • "factorization-machines"
  • "forecasting-deepar"
  • "image-classification"
  • "ipinsights"
  • "kmeans"
  • "knn"
  • "lda"
  • "linear-learner"
  • "ntm"
  • "object-detection"
  • "object2vec"
  • "pca"
  • "randomcutforest"
  • "sagemaker-scikit-learn"
  • "sagemaker-sparkml-serving"
  • "sagemaker-xgboost"
  • "semantic-segmentation"
  • "seq2seq"

New or Affected Resource(s)

  • aws_sagemaker_model
  • aws_sagemaker_endpoint_configuration

Potential Terraform Configuration

resource "aws_s3_bucket_object" "test" {
  bucket = aws_s3_bucket.test.id
  key    = "model.tar.gz"
   source = "test-fixtures/sagemaker-tensorflow-serving-test-model.tar.gz"
 }

 data "aws_sagemaker_prebuilt_ecr_image" "test" {  // currently errors in GovCloud
   repository_name = "sagemaker-tensorflow-serving"
   image_tag       = "1.12-cpu"
 }

 resource "aws_sagemaker_model" "test" {
   name               = "yaktest"
   execution_role_arn = aws_iam_role.test.arn

   primary_container {
     image          = data.aws_sagemaker_prebuilt_ecr_image.test.registry_path // currently errors in GovCloud
     model_data_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_bucket_object.test.key}"
   }

  depends_on = [aws_iam_role_policy.test]
}
resource "aws_sagemaker_endpoint_configuration" "test" {
  name = "yaktest"
  production_variants {
    initial_instance_count = 1
    initial_variant_weight = 1
    instance_type          = "ml.t2.medium"
    model_name             = aws_sagemaker_model.test.name
    variant_name           = "variant-1"
  }
}

References

  • #16135
  • aws/sagemaker-tensorflow-serving-container#176

YakDriver avatar Dec 07 '20 18:12 YakDriver

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

github-actions[bot] avatar Nov 28 '22 17:11 github-actions[bot]

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Jan 30 '23 02:01 github-actions[bot]