Skip to content

Commit 76d0376

Browse files
committed
add tagging support for create ir job
1 parent 624cac8 commit 76d0376

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/sagemaker/session.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5313,6 +5313,7 @@ def _create_inference_recommendations_job_request(
53135313
framework: str,
53145314
sample_payload_url: str,
53155315
supported_content_types: List[str],
5316+
tags: Dict[str, str],
53165317
model_name: str = None,
53175318
model_package_version_arn: str = None,
53185319
job_duration_in_seconds: int = None,
@@ -5348,6 +5349,8 @@ def _create_inference_recommendations_job_request(
53485349
benchmarked by Amazon SageMaker Inference Recommender that matches your model.
53495350
supported_instance_types (List[str]): A list of the instance types that are used
53505351
to generate inferences in real-time.
5352+
tags (Dict[str, str]): Tags used to identify where the Inference Recommendatons Call
5353+
was made from.
53515354
endpoint_configurations (List[Dict[str, any]]): Specifies the endpoint configurations
53525355
to use for a job. Will be used for `Advanced` jobs.
53535356
traffic_pattern (Dict[str, any]): Specifies the traffic pattern for the job.
@@ -5386,6 +5389,7 @@ def _create_inference_recommendations_job_request(
53865389
"InputConfig": {
53875390
"ContainerConfig": containerConfig,
53885391
},
5392+
"Tags": tags,
53895393
}
53905394

53915395
request.get("InputConfig").update(
@@ -5477,6 +5481,8 @@ def create_inference_recommendations_job(
54775481
job_name = "SMPYTHONSDK-" + str(unique_tail)
54785482
job_description = "#python-sdk-create"
54795483

5484+
tags = [{"Key": "ClientType", "Value": "PythonSDK-RightSize"}]
5485+
54805486
create_inference_recommendations_job_request = (
54815487
self._create_inference_recommendations_job_request(
54825488
role=role,
@@ -5496,6 +5502,7 @@ def create_inference_recommendations_job(
54965502
traffic_pattern=traffic_pattern,
54975503
stopping_conditions=stopping_conditions,
54985504
resource_limit=resource_limit,
5505+
tags=tags,
54995506
)
55005507
)
55015508

tests/unit/test_session.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4704,6 +4704,10 @@ def create_inference_recommendations_job_default_happy_response():
47044704
"ModelPackageVersionArn": IR_MODEL_PACKAGE_VERSION_ARN,
47054705
},
47064706
"JobDescription": "#python-sdk-create",
4707+
"Tags": [{
4708+
"Key": "ClientType",
4709+
"Value": "PythonSDK-RightSize"
4710+
}]
47074711
}
47084712

47094713

@@ -4728,6 +4732,10 @@ def create_inference_recommendations_job_default_model_name_happy_response():
47284732
"ModelName": IR_MODEL_NAME,
47294733
},
47304734
"JobDescription": "#python-sdk-create",
4735+
"Tags": [{
4736+
"Key": "ClientType",
4737+
"Value": "PythonSDK-RightSize"
4738+
}]
47314739
}
47324740

47334741

0 commit comments

Comments
 (0)