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

aws_sagemaker_model support for ModelPackage ARN #23968

Closed
mateuszboryn opened this issue Mar 31, 2022 · 10 comments · Fixed by #31755
Closed

aws_sagemaker_model support for ModelPackage ARN #23968

mateuszboryn opened this issue Mar 31, 2022 · 10 comments · Fixed by #31755
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sagemaker Issues and PRs that pertain to the sagemaker service.

Comments

@mateuszboryn
Copy link

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

It is possible to create SageMaker Model with aws_sagemaker_model by specifying image and model_data_url.
However it is not possible to specify ModelPackageName (according to https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ContainerDefinition.html#sagemaker-Type-ContainerDefinition-ModelPackageName)
Also, according to the mentioned document, image is an optional field, but in Terraform it is marked as required field.

New or Affected Resource(s)

Resources:

  • aws_sagemaker_model

Potential Terraform Configuration

resource "aws_sagemaker_model" "example" {
  name               = "my-model"
  execution_role_arn = aws_iam_role.example.arn

  primary_container {
    model_package = "arn:aws:sagemaker:eu-west-1:123456789:model-package/abalonemodelpackagegroup-example/2"
  }
}

References

@mateuszboryn mateuszboryn added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 31, 2022
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/sagemaker Issues and PRs that pertain to the sagemaker service. labels Mar 31, 2022
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 31, 2022
@mateuszboryn
Copy link
Author

Hi, I can see PR open, which is great. When can I expect merging it and appear in provider release?

@abajorat
Copy link

Hi, any chance of this being merged soon?

@cj-dainius-prakapavicius

Any updates on this?

1 similar comment
@michaelrod64
Copy link

Any updates on this?

@michaelrod64
Copy link

michaelrod64 commented Apr 19, 2023

Also, has anyone come up with a workaround to this issue? I'd like to create an endpoint for a model with package arn:
arn:aws:sagemaker:us-east-1:865070037744:model-package/j2-jumbo-instruct-v1-1-033-87b797db88313edf9c3851adf6fc371f

Would rather not have to do it manually

I tried just using the container image url directly as a workaround, but got this error:

creating SageMaker model: ValidationException: Cannot directly specify Container Image: 985815980388.dkr.ecr.eu-west-1.amazonaws.com/c04ded87a128d61fa692651bda36bbdda70bb966f961a19ba9b79a65db8055c4:c2c066b6-14c1-483b-9c29-acdbdc3c9f9f; must use a model-package arn in order to use this image

As far as I can tell, there's no workaround for this, and a core part of Sagemaker functionality (using any AWS provided Jumpstart models) is broken in terraform

@cj-dainius-prakapavicius

I had to work around it by using a null_resource that calls local-exec with the Python script. In the Python code, there's a boto3 call to client.sagemaker.create_model() method.

@michaelrod64
Copy link

@daipra , would you mind sharing a code sample?

@AlbertoRossettini
Copy link

Hi, any chance of this being merged soon?

@bschaatsbergen
Copy link
Member

Thanks for picking this up @holly-evans, we're closing to having your PR merged 🥇

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

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 github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/sagemaker Issues and PRs that pertain to the sagemaker service.
Projects
None yet
7 participants