Skip to content

Tags not propogating to Endpoints and Models #586

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

Closed
AnshumanRanjan opened this issue Jan 7, 2019 · 5 comments
Closed

Tags not propogating to Endpoints and Models #586

AnshumanRanjan opened this issue Jan 7, 2019 · 5 comments

Comments

@AnshumanRanjan
Copy link

Please fill out the form below.

System Information

  • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Sklearn
  • Framework Version:NA
  • Python Version: 3.6.6
  • CPU or GPU: CPU
  • Python SDK Version:1.16.3
  • Are you using a custom image: NO

Describe the problem

Based on my testing , tags parameter defined in the Estimator objects are not propagated to Models and Endpoints . Although they do get propagated to Training jobs .

The other thing we notice is that things like subnets and security group do get propogated from Estimator object to Endpoints and models

  • Exact command to reproduce:
    Using sample notebook and modifying :
    notebooks/scikit_learn_inference_pipeline_2019-01-07/Inference Pipeline with Scikit-learn and Linear Learner.ipynb
from sagemaker.sklearn.estimator import SKLearn
script_path = 'sklearn_abalone_featurizer.py'
tagtobeadded = [{'Key':'TagtestKey','Value':'TagtestValue'}]
sklearn_preprocessor = SKLearn(
    entry_point=script_path,
    role=role,
    tags=tagtobeadded,
    train_instance_type="ml.c4.xlarge",
    sagemaker_session=sagemaker_session)

The below training Job will have tags propogated
sklearn_preprocessor.fit({'train': train_input})

The below Endpoint and Model created will not have the tag information

endpoint_name = 'TagsTest'
sklearn_preprocessor.deploy(initial_instance_count=1, instance_type='ml.c4.large', endpoint_name=endpoint_name)
@nadiaya nadiaya assigned nadiaya and unassigned nadiaya Jan 7, 2019
@nadiaya
Copy link
Contributor

nadiaya commented Jan 7, 2019

Currently tags from training job are not getting propagated to the Endpoint and Model. Adding a feature request label.

As a temporarily work around, while we are getting this change prioritized and implemented, you can try doing the following:

model = sklearn_preprocessor.create_model()
model.deploy(
            instance_type=instance_type,
            initial_instance_count=initial_instance_count,
            endpoint_name=endpoint_name,
            tags=tagtobeadded)

@mvsusp
Copy link
Contributor

mvsusp commented Mar 14, 2019

Hello @AnshumanRanjan

Thanks for your feature request. We just merged your requested changes to master branch. These changes will be available in the next version released.

Thanks for using SageMaker.

@mvsusp
Copy link
Contributor

mvsusp commented Apr 4, 2019

Merged additional changes #732

@laurenyu
Copy link
Contributor

#732 and #741 have been released. closing this issue.

@nathansegers
Copy link

nathansegers commented May 15, 2019

The propagation of tags is correct now, but the documentation is not clear.
The arguments in the referenced lines read that the tags can be used as a parameter. Yet they cannot be given as argument nor keyword-argument (**kwargs)

It is not clear that the Estimator's tags can be set by using estimator.tags = [{'Key': 'tagname', 'Value': 'tagvalue'}]

tags(List[dict[str, str]]): Optional. The list of tags to attach to this specific endpoint. Example:
>>> tags = [{'Key': 'tagname', 'Value': 'tagvalue'}]
For more information about tags, see https://boto3.amazonaws.com/v1/documentation\
/api/latest/reference/services/sagemaker.html#SageMaker.Client.add_tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants