aws / aws/sagemaker-python-sdk
`ModelBuilder.build()` fails when `image_uri` is a `ParameterString` (V2 -> V3 migration blocker)
- 主要言語
- Python
- スター
- 2.3k
- フォーク
- 1.3k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 35
説明
**PySDK Version**
- [ ] PySDK V2 (2.x)
- [ x] PySDK V3 (3.x)
**Describe the bug**
When using `ModelBuilder` with a `ParameterString` for `image_uri` in a SageMaker pipeline, `model_builder.build()` raises a `TypeError`.
**To reproduce**
```
from sagemaker.core.workflow.parameters import ParameterString
from sagemaker.core.workflow.pipeline_context import PipelineSession
from sagemaker.serve.model_builder import ModelBuilder
model_builder = ModelBuilder(
image_uri=ParameterString(name="ServingImageUri"),
sagemaker_session=PipelineSession(),
)
model_builder.build()
```
```
TypeError: 'ParameterString' object is not subscriptable
File ".../sagemaker/serve/validations/check_image_uri.py", line 301, in is_1p_image_uri
image_uri_account = image_uri[0:12]
```
The `is_1p_image_uri()` function attempts to slice `image_uri` as a string, but `ParameterString` objects cannot be subscripted.
**Expected behavior**
`ModelBuilder` should fully support `ParameterString` parameters for pipeline execution.
**Additional context**
Related to #5524.
コントリビューションガイド
調査の方向性
ModelBuilder、ParameterString、PipelineSession を使用して pipeline のケースを再現し、その後 sagemaker/serve/validations/check_image_uri.py の is_1p_image_uri() 付近を調査します。build() が TypeError なしで ParameterString image_uri を受け入れ、通常の文字列のイメージ URI も引き続きサポートすることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, python
- 領域
- machine-learning
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 72/100