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

[BUG] Tags are not added to sagemaker endpoints during deployment. #9159

Closed
4 of 23 tasks
clarkh-ncino opened this issue Jul 25, 2023 · 10 comments · Fixed by #9310
Closed
4 of 23 tasks

[BUG] Tags are not added to sagemaker endpoints during deployment. #9159

clarkh-ncino opened this issue Jul 25, 2023 · 10 comments · Fixed by #9310
Labels
area/models MLmodel format, model serialization/deserialization, flavors area/scoring MLflow Model server, model deployment tools, Spark UDFs bug Something isn't working has-closing-pr This issue has a closing PR integrations/sagemaker Sagemaker integrations

Comments

@clarkh-ncino
Copy link
Contributor

clarkh-ncino commented Jul 25, 2023

Issues Policy acknowledgement

  • I have read and agree to submit bug reports in accordance with the issues policy

Willingness to contribute

Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.

MLflow version

  • Client: 2.5.0
  • Tracking server: n/a

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): n/a
  • Python version: 3.10.9

Describe the problem

When deploying a model to sagemaker, tags passed to the _create_sagemaker_endpoint and _update_sagemaker_endpoint functions are not added to endpoints as expected. Tags for endpoints are being set to an empty array here.

Tracking information

n/a

Code to reproduce issue

from mlflow.deployments import get_deploy_client

sagemaker_client = get_deploy_client('sagemaker')
model_uri = 'a_unique_uri'
tags = {
    "test": "testing-tags-for-sagemaker"
}
bucket_name = "test_bucket"
config = {
    'region_name': "us-east-1",
    'execution_role_arn': role_arn,
    'bucket': bucket_name,
    'instance_type': 'ml.t2.large',
    'tags': tags
}
model_name = "testing-sagemaker"
endpoint = None
flavor = "python_function"
sagemaker_client.create_deployment(
    model_name,
    model_uri,
    flavor,
    config,
    endpoint
)

Stack trace

2023/07/25 16:25:23 INFO mlflow.sagemaker: Using the python_function flavor for deployment!
2023-07-25 16:25:24,584.584 [INFO]: Found credentials in environment variables.
2023/07/25 16:25:25 INFO mlflow.sagemaker: Creating new endpoint with name: testing-sagemaker ...
2023/07/25 16:25:26 INFO mlflow.sagemaker: Created model with arn: arn:aws:sagemaker:us-east-1:-:model/testing-sagemaker-model-hxqure4htgcz1c3titoacg
2023/07/25 16:25:27 INFO mlflow.sagemaker: Created endpoint configuration with arn: arn:aws:sagemaker:us-east-1:-:endpoint-config/testing-sagemaker-config-vo1r7uqgt6ihxbx1q6lahw
2023/07/25 16:25:27 INFO mlflow.sagemaker: Created endpoint with arn: arn:aws:sagemaker:us-east-1:-:endpoint/testing-sagemaker
2023/07/25 16:25:27 INFO mlflow.sagemaker: Waiting for the deployment operation to complete...
2023/07/25 16:25:28 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:25:48 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:26:08 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:26:29 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:26:49 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:27:10 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:27:30 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:27:50 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:28:11 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:28:31 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:28:52 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:29:12 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:29:33 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:29:53 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:30:13 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:30:34 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:30:54 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:31:15 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:31:35 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:31:55 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:32:16 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:32:36 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:32:57 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:33:17 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:33:38 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:33:58 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:34:18 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:34:39 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:34:59 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:35:20 INFO mlflow.sagemaker: Waiting for endpoint to reach the "InService" state. Current endpoint status: "Creating"
2023/07/25 16:35:35 INFO mlflow.sagemaker: The deployment operation completed successfully with message: "The SageMaker endpoint was created successfully."

Other info / logs

n/a

What component(s) does this bug affect?

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/gateway: AI Gateway service, Gateway client APIs, third-party Gateway integrations
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

What interface(s) does this bug affect?

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

What language(s) does this bug affect?

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

What integration(s) does this bug affect?

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations
@clarkh-ncino clarkh-ncino added the bug Something isn't working label Jul 25, 2023
@github-actions github-actions bot added area/models MLmodel format, model serialization/deserialization, flavors area/scoring MLflow Model server, model deployment tools, Spark UDFs integrations/sagemaker Sagemaker integrations labels Jul 25, 2023
@harupy
Copy link
Member

harupy commented Jul 26, 2023

@clarkh-ncino Thanks for reporting the issue! It looks like we use tags when creating a sagemaker model. I'm not familiar with sagemaker. What can be tagged?

@harupy
Copy link
Member

harupy commented Jul 26, 2023

https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Tag.html

You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

Both model and endpoint are taggable.

@clarkh-ncino Would it makes sense to apply the same tag on both model and endpoint?

@clarkh-ncino
Copy link
Contributor Author

@harupy Yes, I believe that is the expected behavior.

@harupy
Copy link
Member

harupy commented Jul 26, 2023

@clarkh-ncino Sounds good. Can you file a RP?

@clarkh-ncino
Copy link
Contributor Author

@harupy Just to clarify, do you mean pull request (PR)? If so, absolutely. Can share it out in the near future.

@harupy
Copy link
Member

harupy commented Jul 26, 2023

yes, I meant pull request.

@clarkh-ncino clarkh-ncino mentioned this issue Jul 28, 2023
34 tasks
@mlflow-automation
Copy link
Collaborator

@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.

@clarkh-ncino
Copy link
Contributor Author

@harupy #9310 is ready for review

@github-actions github-actions bot added the has-closing-pr This issue has a closing PR label Aug 15, 2023
@B-Step62 B-Step62 closed this as completed Jan 1, 2024
@clarkh-ncino
Copy link
Contributor Author

@B-Step62 The associated PR is not merged yet so I'm not sure if we would want to mark this as completed.

BenWilson2 pushed a commit that referenced this issue Jan 2, 2024
@BenWilson2
Copy link
Member

@B-Step62 The associated PR is not merged yet so I'm not sure if we would want to mark this as completed.

Sorry for the delay on that. I just merged it!

annzhang-db pushed a commit to annzhang-db/mlflow that referenced this issue Jan 3, 2024
B-Step62 pushed a commit to B-Step62/mlflow that referenced this issue Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/models MLmodel format, model serialization/deserialization, flavors area/scoring MLflow Model server, model deployment tools, Spark UDFs bug Something isn't working has-closing-pr This issue has a closing PR integrations/sagemaker Sagemaker integrations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants