@aws/ml-container-creator 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +62 -298
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,342 +1,106 @@
1
- # sharp-transformer-deployment
1
+ # ML Container Creator
2
2
 
3
- SageMaker-compatible ML container for deploying transformers models using vllm.
3
+ A CLI tool that creates SageMaker-compatible Docker containers for deploying ML models using the Bring Your Own Container (BYOC) paradigm.
4
4
 
5
- Generated on 2026-05-08T09-52-06 using [ML Container Creator](https://github.com/yourusername/ml-container-creator).
5
+ > **Note:** This is a pre-release (`0.x`). APIs may change between minor versions. Weekly releases are planned until v1.
6
6
 
7
- ## Quick Start
8
-
9
- ### 1. Build the Container
10
-
11
- ```bash
12
- ./do/build
13
- ```
14
-
15
- Builds a Docker image tagged as `sharp-transformer-deployment:latest`.
16
-
17
- ### 2. Test Locally
18
-
19
- ```bash
20
- # Start the container
21
- ./do/run
22
-
23
- # In another terminal, test the endpoints
24
- ./do/test
25
- ```
26
-
27
- ### 3. Push to ECR
28
-
29
- ```bash
30
- ./do/push
31
- ```
32
-
33
- Pushes the image to Amazon ECR in the `us-west-2` region.
34
-
35
- ### 4. Deploy to SageMaker
36
-
37
- ```bash
38
- ./do/deploy <your-sagemaker-execution-role-arn>
39
- ```
40
-
41
- Creates a SageMaker endpoint named `sharp-transformer-deployment-endpoint`.
42
-
43
- ### 5. Test the Endpoint
44
-
45
- ```bash
46
- ./do/test sharp-transformer-deployment-endpoint
47
- ```
48
-
49
- ## Project Structure
50
-
51
- ```
52
- sharp-transformer-deployment/
53
- ├── do/ # do-framework lifecycle scripts
54
- │ ├── build # Build Docker image
55
- │ ├── push # Push to Amazon ECR
56
- │ ├── deploy # Deploy to SageMaker
57
- │ ├── run # Run container locally
58
- │ ├── test # Test container or endpoint
59
- │ ├── clean # Clean up resources
60
- │ ├── submit # Submit build to CodeBuild
61
- │ ├── config # Configuration variables
62
- │ └── README.md # Detailed do-framework documentation
63
- ├── code/ # Model serving code
64
- │ └── serve # vllm entrypoint script
65
- ├── deploy/ # Legacy scripts (deprecated)
66
- │ ├── build_and_push.sh # Use ./do/build && ./do/push instead
67
- │ └── deploy.sh # Use ./do/deploy instead
68
-
69
- ├── test/ # Test suite
70
- │ ├── test_endpoint.sh # Test SageMaker endpoint
71
- │ └── test_local_image.sh # Test local container
72
-
73
- ├── Dockerfile # Container definition
74
- ├── requirements.txt # Python dependencies
75
- └── README.md # This file
76
- ```
77
-
78
- ## Configuration
79
-
80
- All deployment configuration is centralized in `do/config`:
81
-
82
- ```bash
83
- # Project identification
84
- PROJECT_NAME="sharp-transformer-deployment"
85
- DEPLOYMENT_CONFIG="transformers-vllm"
86
-
87
- # AWS configuration
88
- AWS_REGION="us-west-2"
89
- INSTANCE_TYPE="ml.g5.xlarge"
90
-
91
- # Framework configuration
92
- FRAMEWORK="transformers"
93
- MODEL_SERVER="vllm"
94
-
95
- # Model configuration
96
- MODEL_NAME="openai/gpt-oss-20b"
97
-
98
- ```
99
-
100
- You can override these values by setting environment variables before running do scripts.
101
-
102
- ## Deployment Workflows
103
-
104
- ### Local Development Workflow
105
-
106
- ```bash
107
- # Build and test locally
108
- ./do/build
109
- ./do/run &
110
- ./do/test
111
-
112
- # When satisfied, push to ECR
113
- ./do/push
114
- ```
115
-
116
- ### CodeBuild Workflow
117
-
118
- ```bash
119
- # Submit build to CodeBuild (builds and pushes to ECR)
120
- ./do/submit
121
-
122
- # Deploy to SageMaker
123
- ./do/deploy <role-arn>
124
-
125
- # Test the endpoint
126
- ./do/test sharp-transformer-deployment-endpoint
127
- ```
7
+ ## Supported Configurations
128
8
 
129
- ### Cleanup
9
+ | Architecture | Model Servers | Use Case |
10
+ |---|---|---|
11
+ | HTTP (traditional ML) | Flask, FastAPI | sklearn, XGBoost, TensorFlow |
12
+ | Transformers (LLMs) | vLLM, SGLang, TensorRT-LLM, DJL/LMI | HuggingFace models, JumpStart, S3 |
13
+ | Triton | FIL, ONNX, Python, TensorRT-LLM, vLLM | Multi-framework serving |
14
+ | Diffusors | vLLM | Image generation models |
130
15
 
131
- ```bash
132
- # Remove local images
133
- ./do/clean local
134
-
135
- # Remove ECR images
136
- ./do/clean ecr
137
-
138
- # Delete SageMaker endpoint
139
- ./do/clean endpoint
140
-
141
- # Clean everything
142
- ./do/clean all
143
- ```
144
-
145
- ## do-framework Commands
146
-
147
- This project uses the [do-framework](https://github.com/iankoulski/do-framework) for standardized container lifecycle management.
148
-
149
- ### Available Commands
150
-
151
- | Command | Description |
152
- |---------|-------------|
153
- | `./do/build` | Build Docker image locally |
154
- | `./do/push` | Push image to Amazon ECR |
155
- | `./do/deploy <role-arn>` | Deploy to SageMaker endpoint |
156
- | `./do/run` | Run container locally on port 8080 |
157
- | `./do/test [endpoint]` | Test local container or SageMaker endpoint |
158
- | `./do/clean <target>` | Clean up resources (local/ecr/endpoint/all) |
159
- | `./do/submit` | Submit build to AWS CodeBuild |
160
-
161
- For detailed documentation on each command, see `do/README.md`.
162
-
163
- ## Framework-Specific Information
164
-
165
- ### Transformers (vllm)
166
-
167
- This container serves transformer models using vllm.
168
-
169
- **Model**: openai/gpt-oss-20b
170
-
171
- **Server**: vLLM - High-throughput LLM serving with PagedAttention
172
-
173
- **Features**:
174
- - Continuous batching
175
- - Optimized CUDA kernels
176
- - OpenAI-compatible API
177
-
178
-
179
- **Inference**: Send requests to `/invocations` endpoint with:
180
- ```json
181
- {
182
- "inputs": "Your prompt here",
183
- "parameters": {
184
- "max_new_tokens": 100,
185
- "temperature": 0.7
186
- }
187
- }
188
- ```
189
-
190
-
191
-
192
- ## SageMaker Endpoints
193
-
194
- ### Health Check
195
-
196
- SageMaker calls the `/ping` endpoint to verify container health:
197
-
198
- ```bash
199
- curl http://localhost:8080/ping
200
- ```
16
+ | Deployment Target | Description |
17
+ |---|---|
18
+ | Real-Time Inference | SageMaker real-time endpoints |
19
+ | Async Inference | SageMaker async endpoints with S3 output |
20
+ | Batch Transform | SageMaker batch processing |
21
+ | HyperPod EKS | Kubernetes-based deployment |
201
22
 
202
- Expected response: `200 OK`
203
-
204
- ### Inference
205
-
206
- Send prediction requests to the `/invocations` endpoint:
207
-
208
- ```bash
209
- curl -X POST http://localhost:8080/invocations \
210
- -H "Content-Type: application/json" \
211
- -d '{
212
- "inputs": "What is machine learning?",
213
- "parameters": {
214
- "max_new_tokens": 100,
215
- "temperature": 0.7
216
- }
217
- }'
218
- ```
219
-
220
-
221
- ## AWS Requirements
222
-
223
- ### IAM Permissions
224
-
225
- The SageMaker execution role needs these permissions:
226
-
227
- - `ecr:GetAuthorizationToken`
228
- - `ecr:BatchCheckLayerAvailability`
229
- - `ecr:GetDownloadUrlForLayer`
230
- - `ecr:BatchGetImage`
231
- - `s3:GetObject` (if using S3 for model artifacts)
232
- - `logs:CreateLogGroup`
233
- - `logs:CreateLogStream`
234
- - `logs:PutLogEvents`
235
-
236
- See `IAM_PERMISSIONS.md` for detailed permission requirements.
237
-
238
- ### AWS CLI Configuration
23
+ ## Quick Start
239
24
 
240
- Ensure AWS CLI is configured with appropriate credentials:
25
+ ### Install from npm
241
26
 
242
27
  ```bash
243
- aws configure
28
+ npm install -g @aws/ml-container-creator
244
29
  ```
245
30
 
246
- Or use environment variables:
31
+ ### Or use without installing (npx)
247
32
 
248
33
  ```bash
249
- export AWS_ACCESS_KEY_ID=your-access-key
250
- export AWS_SECRET_ACCESS_KEY=your-secret-key
251
- export AWS_DEFAULT_REGION=us-west-2
34
+ npx @aws/ml-container-creator --help
252
35
  ```
253
36
 
254
- ## Troubleshooting
37
+ ### Or install from source
255
38
 
256
- ### Build Issues
257
-
258
- **Docker Not Found**
259
-
260
- Install Docker: https://docs.docker.com/get-docker/
261
-
262
- **Permission Denied**
263
-
264
- Add your user to the docker group:
265
39
  ```bash
266
- sudo usermod -aG docker $USER
40
+ git clone https://github.com/awslabs/ml-container-creator.git
41
+ cd ml-container-creator
42
+ npm install && npm link
267
43
  ```
268
44
 
269
- ### Deployment Issues
45
+ ### Bootstrap AWS infrastructure (one-time)
270
46
 
271
- **ECR Push Failed**
272
-
273
- Check AWS credentials and IAM permissions:
274
47
  ```bash
275
- aws sts get-caller-identity
48
+ ml-container-creator bootstrap
276
49
  ```
277
50
 
278
- **Endpoint Creation Failed**
279
-
280
- - Verify the execution role ARN is correct
281
- - Check IAM permissions
282
- - Ensure the instance type is available in your region
51
+ Sets up an IAM execution role, ECR repository, optional S3 buckets, and optional CI Integration Harness for automated testing. Configuration is saved to `~/.ml-container-creator/config.json`.
283
52
 
284
- **Endpoint Stuck in Creating**
53
+ ### Generate a project
285
54
 
286
- Check CloudWatch logs:
287
55
  ```bash
288
- aws logs tail /aws/sagemaker/Endpoints/sharp-transformer-deployment-endpoint --follow
289
- ```
56
+ # Interactive
57
+ ml-container-creator
290
58
 
291
- ### Runtime Issues
292
-
293
- **Container Exits Immediately**
294
-
295
- Check container logs:
296
- ```bash
297
- docker logs $(docker ps -a | grep sharp-transformer-deployment | awk '{print $1}')
59
+ # Non-interactive
60
+ ml-container-creator my-model \
61
+ --deployment-config=transformers-vllm \
62
+ --model-name=openai/gpt-oss-20b \
63
+ --instance-type=ml.g6.12xlarge \
64
+ --region=us-east-1 \
65
+ --skip-prompts
298
66
  ```
299
67
 
300
- **Out of Memory**
68
+ ### Build, push, deploy
301
69
 
302
- Increase instance size or optimize model:
303
70
  ```bash
304
- # Edit do/config
305
- INSTANCE_TYPE="ml.m5.2xlarge" # Larger instance
71
+ ./do/build # Build Docker image
72
+ ./do/push # Push to Amazon ECR
73
+ ./do/deploy # Deploy to SageMaker
74
+ ./do/test # Test the endpoint
306
75
  ```
307
76
 
308
- ## Migration from Legacy Scripts
309
-
310
- If you're familiar with the old `deploy/` scripts, see `MIGRATION.md` for a command mapping guide.
311
-
312
- **Quick Reference**:
313
-
314
- | Legacy Command | do-framework Command |
315
- |----------------|---------------------|
316
- | `./deploy/build_and_push.sh` | `./do/build && ./do/push` |
317
- | `./deploy/deploy.sh <role>` | `./do/deploy <role>` |
318
- | `./deploy/submit_build.sh` | `./do/submit` |
77
+ ## Documentation
319
78
 
320
- The legacy scripts are still available but deprecated. They will display warnings and forward to do-framework commands.
79
+ Full documentation is available at [awslabs.github.io/ml-container-creator](https://awslabs.github.io/ml-container-creator/).
321
80
 
322
- ## Additional Resources
81
+ - [Getting Started](https://awslabs.github.io/ml-container-creator/getting-started/) — Installation and walkthroughs
82
+ - [Configuration](https://awslabs.github.io/ml-container-creator/configuration/) — CLI flags, env vars, config files, MCP servers
83
+ - [Deployment Guide](https://awslabs.github.io/ml-container-creator/deployments/) — All deployment targets and lifecycle scripts
84
+ - [CI Integration](https://awslabs.github.io/ml-container-creator/ci-integration/) — Automated lifecycle testing for all deployment configurations
85
+ - [Examples](https://awslabs.github.io/ml-container-creator/EXAMPLES/) — Framework-specific walkthroughs
86
+ - [Troubleshooting](https://awslabs.github.io/ml-container-creator/TROUBLESHOOTING/) — Common issues and solutions
323
87
 
324
- - [do-framework Documentation](https://github.com/iankoulski/do-framework)
325
- - [AWS SageMaker Documentation](https://docs.aws.amazon.com/sagemaker/)
326
- - [SageMaker BYOC Guide](https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html)
88
+ ## Prerequisites
327
89
 
328
- - [vLLM Documentation](https://docs.vllm.ai/)
90
+ | Tool | Version | Purpose |
91
+ |---|---|---|
92
+ | [Node.js](https://nodejs.org/) | 24+ | Runs the CLI |
93
+ | [Docker](https://docs.docker.com/get-docker/) | 20+ | Container builds |
94
+ | [AWS CLI](https://aws.amazon.com/cli/) | 2+ | AWS resource management |
329
95
 
96
+ ## Contributing
330
97
 
331
- ## Support
98
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
332
99
 
333
- For issues or questions:
100
+ ## Security
334
101
 
335
- 1. Check `do/README.md` for detailed command documentation
336
- 2. Review CloudWatch logs for deployment issues
337
- 3. See `MIGRATION.md` if migrating from legacy scripts
338
- 4. Open an issue on the [ML Container Creator repository](https://github.com/yourusername/ml-container-creator)
102
+ See [CONTRIBUTING.md](CONTRIBUTING.md#security-issue-notifications) for reporting security issues.
339
103
 
340
104
  ## License
341
105
 
342
- This generated project is provided as starter code. Modify as needed for your use case.
106
+ Apache-2.0. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/ml-container-creator",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Generator for SageMaker AI BYOC paradigm for predictive inference use-cases.",
5
5
  "type": "module",
6
6
  "main": "src/app.js",