Skip to content

Commit 6a1ba54

Browse files
authored
docs: Add migration tool (MCP server) section to migration guide (aws#5628)
* docs: Add migration tool (MCP server) section to migration guide Add instructions for installing and configuring the SageMaker SDK migration MCP server tool. Includes setup for Kiro, Kiro CLI, VS Code (Cline), Claude Desktop, and Cursor. Documents available tools (analyze_code, transform_code, validate_code, ask_question), example usage, and troubleshooting steps. * docs: Update Feature Store status to supported in migration guide Feature Store is now supported in V3 via sagemaker.core.resources.FeatureGroup and FeatureStore. Update the status from REMOVED to SUPPORTED.
1 parent a0b3b99 commit 6a1ba54

File tree

1 file changed

+117
-2
lines changed

1 file changed

+117
-2
lines changed

migration.md

Lines changed: 117 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,122 @@
2323
* **Intelligent Defaults**: Smart default values based on context
2424
* **Advanced Features**: Access to latest SageMaker capabilities
2525

26+
## Migration Tool (MCP Server)
27+
28+
An AI-powered migration tool is available as an MCP server that can analyze your V2 code, transform it to V3, validate the results, and answer migration questions interactively through your IDE.
29+
30+
### Installation
31+
32+
```bash
33+
pip install --no-cache-dir https://d3azyja9oqj8z1.cloudfront.net/sagemaker_sdk_helper-0.2.0.tar.gz --force-reinstall
34+
```
35+
36+
Verify installation:
37+
38+
```bash
39+
which sagemaker-migration-mcp # Should output the path to the executable
40+
sagemaker-migration-mcp --help # Test the server runs
41+
```
42+
43+
### IDE Setup
44+
45+
Add the following to your MCP configuration file:
46+
47+
| IDE | Config Location |
48+
|-----|----------------|
49+
| Kiro | `~/.kiro/settings/mcp.json` |
50+
| Kiro CLI | `~/.kiro/settings/mcp.json` |
51+
| VS Code (Cline) | Cline extension settings → MCP Servers |
52+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) |
53+
| Cursor | Settings → MCP section |
54+
55+
**Minimal configuration (works without artifacts):**
56+
57+
```json
58+
{
59+
"mcpServers": {
60+
"sagemaker-migration": {
61+
"command": "sagemaker-migration-mcp",
62+
"args": ["--log-level", "INFO"]
63+
}
64+
}
65+
}
66+
```
67+
68+
> **Note**: If you installed in a virtual environment, use the full path to the executable (find it with `which sagemaker-migration-mcp`).
69+
70+
**With SDK source artifacts (recommended, 20-30% better accuracy):**
71+
72+
```json
73+
{
74+
"mcpServers": {
75+
"sagemaker-migration": {
76+
"command": "/path/to/.venv/bin/sagemaker-migration-mcp",
77+
"args": [
78+
"--log-level", "INFO",
79+
"--v2-artifacts", "/path/to/sdk_v2/sagemaker-python-sdk",
80+
"--v3-artifacts", "/path/to/sdk_v3/sagemaker-python-sdk"
81+
]
82+
}
83+
}
84+
}
85+
```
86+
87+
After updating the config, restart your IDE or reconnect MCP servers (in Kiro: Command Palette → "MCP: Reconnect Servers").
88+
89+
### Kiro CLI
90+
91+
For Kiro CLI, add the same configuration to `~/.kiro/settings/mcp.json`:
92+
93+
```json
94+
{
95+
"mcpServers": {
96+
"sagemaker-migration": {
97+
"command": "sagemaker-migration-mcp",
98+
"args": ["--log-level", "INFO"]
99+
}
100+
}
101+
}
102+
```
103+
104+
After saving the config, quit Kiro CLI (`/quit`) and relaunch it. The migration tools will then be available in your chat session.
105+
106+
### Available Tools
107+
108+
| Tool | Description |
109+
|------|-------------|
110+
| `analyze_code` | Analyze V2 SDK code and identify migration requirements |
111+
| `transform_code` | Transform V2 code to V3 equivalents |
112+
| `validate_code` | Validate transformed code for V3 compliance |
113+
| `ask_question` | Ask migration questions about V2-to-V3 mappings and best practices |
114+
115+
### Example Usage
116+
117+
```
118+
# Analyze V2 code
119+
Analyze this V2 code for migration:
120+
[paste your V2 code]
121+
122+
# Transform V2 code to V3
123+
Transform this V2 code to V3:
124+
[paste your V2 code]
125+
126+
# Ask migration questions
127+
What is ModelTrainer in V3?
128+
How do I migrate Estimator to V3?
129+
```
130+
131+
You can also point the tool at entire notebooks for full conversion.
132+
133+
### Troubleshooting
134+
135+
- **Server not starting**: Verify the command path with `which sagemaker-migration-mcp`. Requires Python 3.9+.
136+
- **Permission denied**: Run `chmod +x /path/to/.venv/bin/sagemaker-migration-mcp`
137+
- **Artifacts not loading**: Paths must be absolute. The server works without artifacts but with reduced accuracy.
138+
- **Manual test**: `echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | sagemaker-migration-mcp`
139+
140+
---
141+
26142
## Key Architectural Changes
27143

28144
### Package Structure
@@ -368,7 +484,7 @@ pipeline = Pipeline(
368484
|--------------|--------------|--------------|--------|
369485
| Run processing jobs | `Processor(...)`, `ScriptProcessor(...)` | `sagemaker.core.resources.ProcessingJob` | ❌ REMOVED |
370486
| PySpark processing | `PySparkProcessor(...)` | `sagemaker.core.resources.ProcessingJob` | ❌ REMOVED |
371-
| Feature Store | `FeatureGroup`, `FeatureStore` | `sagemaker.core.resources.ProcessingJob` | ❌ REMOVED |
487+
| Feature Store | `FeatureGroup`, `FeatureStore` | `sagemaker.core.resources.FeatureGroup`, `FeatureStore` | ✅ SUPPORTED |
372488
| Data Wrangler | `sagemaker.wrangler` | `sagemaker.core.resources.ProcessingJob` | ❌ REMOVED |
373489
| Ground Truth (Labeling) | Not directly in V2 SDK (AWS console) | `sagemaker.core.resources.GroundTruthJob` (28 classes) | 🆕 NEW IN V3 |
374490

@@ -727,4 +843,3 @@ def setup_training_data() -> List[InputData]:
727843

728844
Migrating from SageMaker Python SDK V2 to V3 provides significant benefits in terms of developer experience, code organization, and access to new features. While the migration requires updating code patterns and imports, the structured approach of V3 leads to more maintainable and robust machine learning workflows.
729845

730-
The key to successful migration is understanding the new architectural patterns and gradually adopting the structured configuration approach that V3 promotes. Start with simple training jobs and gradually migrate more complex workflows, taking advantage of V3's enhanced features like resource chaining and improved type safety.

0 commit comments

Comments
 (0)