Skip to content

Commit 4423009

Browse files
authored
Merge branch 'master' into feat/public-pipeline-execution
2 parents 1eefa1a + 387213b commit 4423009

File tree

95 files changed

+3787
-2043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3787
-2043
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ env/
4040
sagemaker_train/src/**/container_drivers/sm_train.sh
4141
sagemaker_train/src/**/container_drivers/sourcecode.json
4242
sagemaker_train/src/**/container_drivers/distributed.json
43+
.kiro

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
# Changelog
2+
## v3.7.1 (2026-03-31)
3+
4+
### Features
5+
- **Telemetry**: Added telemetry emitter to `ScriptProcessor` and `FrameworkProcessor`, enabling SDK usage tracking for processing jobs via the telemetry attribution module (new `PROCESSING` feature enum added to telemetry constants)
6+
7+
### Fixes
8+
- **ModelBuilder**: Fixed `accept_eula` handling in ModelBuilder's LoRA deployment path — previously hardcoded to `True`, now respects the user-provided value and raises a `ValueError` if not explicitly set to `True`
9+
- **Evaluate**: Fixed Lambda handler name derivation in the Evaluator — hardcoded the handler to `lambda_function.lambda_handler` instead of deriving it from the source filename, which caused invocation failures when the source file had a non-default name
10+
11+
## v3.7.0 (2026-03-25)
12+
13+
### Fixes
14+
- **ModelBuilder**: Sync Nova hosting configs with AGISageMakerInference (#5664)
15+
- **Evaluate**: Remove GPT OSS model evaluation restriction (#5658)
16+
17+
### Features
18+
- **AWS Batch**: Add support for Quota Management job submission and job priority update (#5659)
19+
- **AWS Batch**: Extend list_jobs_by_share for quota_share_name (#5669)
20+
- **Evaluate**: Support IAM role for BaseEvaluator (#5671)
21+
- **Telemetry**: Add telemetry attribution module for SDK usage provenance (#5661)
22+
- **MLflow**: Metrics visualization, enhanced wait UI, and eval job links (#5662)
23+
24+
### Chores
25+
- Updated SDK to use latest LMIv22 image for v3.x (#5640)
26+
- Migration guide update (#5655)
27+
- AWS Batch integ test resources are now uniquely named by test run (#5666)
28+
229
## v3.6.0 (2026-03-19)
330

431
### Fixes

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.0
1+
3.7.1

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ classifiers = [
3333
"Programming Language :: Python :: 3.12",
3434
]
3535
dependencies = [
36-
"sagemaker-core>=2.6.0,<3.0.0",
37-
"sagemaker-train>=1.6.0,<2.0.0",
38-
"sagemaker-serve>=1.6.0,<2.0.0",
39-
"sagemaker-mlops>=1.6.0,<2.0.0",
36+
"sagemaker-core>=2.7.1,<3.0.0",
37+
"sagemaker-train>=1.7.1,<2.0.0",
38+
"sagemaker-serve>=1.7.1,<2.0.0",
39+
"sagemaker-mlops>=1.7.1,<2.0.0",
4040
]
4141

4242
[project.optional-dependencies]

sagemaker-core/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
# Changelog
2+
## v2.7.1 (2026-03-31)
3+
4+
### Features
5+
6+
- **Telemetry**: Added telemetry emitter to `ScriptProcessor` and `FrameworkProcessor`, enabling SDK usage tracking for processing jobs via the telemetry attribution module (new `PROCESSING` feature enum added to telemetry constants)
7+
8+
### Bug Fixes
9+
10+
- **ModelBuilder**: Fixed `accept_eula` handling in ModelBuilder's LoRA deployment path — previously hardcoded to `True`, now respects the user-provided value and raises a `ValueError` if not explicitly set to `True`
11+
- **Evaluate**: Fixed Lambda handler name derivation in the Evaluator — hardcoded the handler to `lambda_function.lambda_handler` instead of deriving it from the source filename, which caused invocation failures when the source file had a non-default name
12+
13+
## v2.7.0 (2026-03-25)
14+
15+
### Bug fixes and Other Changes
16+
17+
- **Enhancement**: Add telemetry attribution module for SDK usage provenance (#5661)
18+
- **Enhancement**: Updated SDK to use latest LMIv22 image for v3.x (#5640)
19+
- **Enhancement**: Resources codegen update for eval job links (#5662)
20+
221
## v2.6.0 (2026-03-19)
322

423
### Bug fixes and Other Changes

sagemaker-core/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.0
1+
2.7.1

sagemaker-core/src/sagemaker/core/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
# Partner App
1616
from sagemaker.core.partner_app.auth_provider import PartnerAppAuthProvider # noqa: F401
1717

18+
# Attribution
19+
from sagemaker.core.telemetry.attribution import Attribution, set_attribution # noqa: F401
20+
1821
# Note: HyperparameterTuner and WarmStartTypes are in sagemaker.train.tuner
1922
# They are not re-exported from core to avoid circular dependencies

sagemaker-core/src/sagemaker/core/processing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
from sagemaker.core.workflow.execution_variables import ExecutionVariables
7878
from sagemaker.core.workflow.functions import Join
7979
from sagemaker.core.workflow.pipeline_context import runnable_by_pipeline
80+
from sagemaker.core.telemetry.telemetry_logging import _telemetry_emitter
81+
from sagemaker.core.telemetry.constants import Feature
8082

8183
from sagemaker.core._studio import _append_project_tags
8284
from sagemaker.core.config.config_utils import _append_sagemaker_config_tags
@@ -771,6 +773,7 @@ def __init__(
771773
network_config=network_config,
772774
)
773775

776+
@_telemetry_emitter(feature=Feature.PROCESSING, func_name="ScriptProcessor.run")
774777
@runnable_by_pipeline
775778
def run(
776779
self,
@@ -1171,6 +1174,7 @@ def _package_code(
11711174
os.unlink(tmp.name)
11721175
return s3_uri
11731176

1177+
@_telemetry_emitter(feature=Feature.PROCESSING, func_name="FrameworkProcessor.run")
11741178
@runnable_by_pipeline
11751179
def run(
11761180
self,

sagemaker-core/src/sagemaker/core/resources.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35788,7 +35788,7 @@ def stop(self) -> None:
3578835788
ResourceNotFound: Resource being access is not found.
3578935789
"""
3579035790

35791-
client = SageMakerClient().client
35791+
client = SageMakerClient().sagemaker_client
3579235792

3579335793
operation_input_args = {
3579435794
"TrainingJobName": self.training_job_name,
@@ -35833,15 +35833,17 @@ def wait(
3583335833
progress.add_task("Waiting for TrainingJob...")
3583435834
status = Status("Current status:")
3583535835

35836-
instance_count = (
35837-
sum(
35838-
instance_group.instance_count
35839-
for instance_group in self.resource_config.instance_groups
35840-
)
35841-
if self.resource_config.instance_groups
35842-
and not isinstance(self.resource_config.instance_groups, Unassigned)
35843-
else self.resource_config.instance_count
35844-
)
35836+
instance_count = 1 # Default
35837+
if not isinstance(self.resource_config, Unassigned):
35838+
if (hasattr(self.resource_config, 'instance_groups') and
35839+
self.resource_config.instance_groups and
35840+
not isinstance(self.resource_config.instance_groups, Unassigned)):
35841+
instance_count = sum(
35842+
instance_group.instance_count
35843+
for instance_group in self.resource_config.instance_groups
35844+
)
35845+
elif hasattr(self.resource_config, 'instance_count'):
35846+
instance_count = self.resource_config.instance_count
3584535847

3584635848
if logs:
3584735849
multi_stream_logger = MultiLogStreamHandler(
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
"""Attribution module for tracking the provenance of SDK usage."""
14+
from __future__ import absolute_import
15+
import os
16+
from enum import Enum
17+
18+
_CREATED_BY_ENV_VAR = "SAGEMAKER_PYSDK_CREATED_BY"
19+
20+
21+
class Attribution(Enum):
22+
"""Enumeration of known SDK attribution sources."""
23+
24+
SAGEMAKER_AGENT_PLUGIN = "awslabs/agent-plugins/sagemaker-ai"
25+
26+
27+
def set_attribution(attribution: Attribution):
28+
"""Sets the SDK usage attribution to the specified source.
29+
30+
Call this at the top of scripts generated by an agent or integration
31+
to enable accurate telemetry attribution.
32+
33+
Args:
34+
attribution (Attribution): The attribution source to set.
35+
36+
Raises:
37+
TypeError: If attribution is not an Attribution enum member.
38+
"""
39+
if not isinstance(attribution, Attribution):
40+
raise TypeError(f"attribution must be an Attribution enum member, got {type(attribution)}")
41+
os.environ[_CREATED_BY_ENV_VAR] = attribution.value

0 commit comments

Comments
 (0)