You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create model package groups in registry in CodeBuild, and remove from Notebook. Update API to ensure deploye stage matches.
* Update to pass sagemaker tags for testing register
* Updates to include additional permission required to deploy CDK resources
* Updates to add experiments to project, and include tuning jobs
* Update to add boto retry
* Minor tweaks to README
Copy file name to clipboardExpand all lines: README.md
+74-7Lines changed: 74 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,18 +110,53 @@ cdk bootstrap
110
110
111
111
To bootstrap and deploy, you will require permissions create AWS CloudFormation Stacks and the associated resources for your current execution role.
112
112
113
-
If you have cloned this notebook into SageMaker Studio, you can find your user's role by browsing to the Studio dashboard.
113
+
If you have cloned this notebook into SageMaker Studio, you will need to add additional permissions to the SageMaker Studio execution role. You can find your user's role by browsing to the Studio dashboard.
|`api_name`| The API Gateway Name | "ab-testing" |
148
183
|`stage_name`| The stage namespace for resource and API Gateway path | "dev" |
149
-
|`endpoint_prefix`| A prefix to filter which Amazon SageMaker endpoints the API can invoked.| "" |
184
+
|`endpoint_prefix`| A prefix to filter Amazon SageMaker endpoints the API can invoke. | "" |
150
185
|`api_lambda_memory`| The [lambda memory](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) allocation for API endpoint. | 768 |
151
186
|`api_lambda_timeout`| The lambda timeout for the API endpoint. | 10 |
152
187
|`metrics_lambda_memory`| The [lambda memory](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) allocated for metrics processing Lambda | 768 |
153
188
|`metrics_lambda_timeout`| The lambda timeout for the processing lambda. | 10 |
154
189
|`dynamodb_read_capacity`| The [Read Capacity](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html) for the DynamoDB tables | 5 |
155
190
|`dynamodb_write_capacity`| The [Write Capacity](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html) for the DynamoDB tables | 5 |
156
-
|`delivery_sync`| When set to `true`, metrics will be written directly to DynamoDB in real-time, instead of written to Amazon Kinesis for processing (recommend for testing only)| false |
157
-
|`firehose_interval`| The [buffering](https://docs.aws.amazon.com/firehose/latest/dev/create-configure.html) interval in seconds at which the firehose will flush events to S3. | 60 |
191
+
|`delivery_sync`| When`true` metrics will be written directly to DynamoDB, instead of the Amazon Kinesis for processing. | false |
192
+
|`firehose_interval`| The [buffering](https://docs.aws.amazon.com/firehose/latest/dev/create-configure.html) interval in seconds which firehose will flush events to S3.| 60 |
158
193
|`firehose_mb_size`| The buffering size in MB before the firehose will flush its events to S3. | 1 |
159
194
|`log_level`| Logging level for AWS Lambda functions | "INFO" |
160
195
161
196
Run the following command to deploy the API and testing infrastructure, optionally override context values.
This stack will ask you to confirm any changes, and output the `ApiEndpoint` which you will provide to the A/B Testing sample notebook.
@@ -320,6 +355,38 @@ With the Deployment Pipeline complete, you will be able to continue with the nex
320
355
5. Plot the beta distributions of the course of the test.
321
356
6. Calculate the statistical significance of the test.
322
357
358
+
## Running Cost
359
+
360
+
This section outlines cost considerations for running the A/B Testing Pipeline. Completing the pipeline will deploy an endpoint with 2 production variants which will cost less than $3 per day. Further cost breakdowns are below.
361
+
362
+
-**CodeBuild** – Charges per minute used. First 100 minutes each month come at no charge. For information on pricing beyond the first 100 minutes, see [AWS CodeBuild Pricing](https://aws.amazon.com/codebuild/pricing/).
363
+
-**CodeCommit** – $1/month if you didn't opt to use your own GitHub repository.
364
+
-**CodePipeline** – CodePipeline costs $1 per active pipeline* per month. Pipelines are free for the first 30 days after creation. More can be found at [AWS CodePipeline Pricing](https://aws.amazon.com/codepipeline/pricing/).
365
+
-**SageMaker** – Prices vary based on EC2 instance usage for the Notebook Instances, Model Hosting, Model Training and Model Monitoring; each charged per hour of use. For more information, see [Amazon SageMaker Pricing](https://aws.amazon.com/sagemaker/pricing/).
366
+
- The ten `ml.c5.4xlarge`*training jobs* run for approx 4 minutes at $0.81 an hour, and cost less than $1.
367
+
- The two `ml.t2.medium` instances for production *hosting* endpoint costs 2 x $0.056 per hour, or $2.68 per day.
368
+
-**S3** – Low cost, prices will vary depending on the size of the models/artifacts stored. The first 50 TB each month will cost only $0.023 per GB stored. For more information, see [Amazon S3 Pricing](https://aws.amazon.com/s3/pricing/).
369
+
-**API Gateway** - Low cost, $1.29 for first 300 million requests. For more info see [Amazon API Gateway pricing](https://aws.amazon.com/api-gateway/pricing/)
370
+
-**Lambda** - Low cost, $0.20 per 1 million request see [AWS Lambda Pricing](https://aws.amazon.com/lambda/pricing/).
371
+
372
+
## Cleaning Up
373
+
374
+
Once you have cleaned up the SageMaker Endpoints and Project as described in the [Sample Notebook](notebook/mab-reviews-helpfulness.ipynb), complete the clean up by deleting the **Service Catalog** and **API** resources with the AWS CDK:
375
+
376
+
1. Delete the Service Catalog Portfolio and Project Template
377
+
378
+
```
379
+
cdk destroy ab-testing-service-catalog
380
+
```
381
+
382
+
2. Delete the API and testing infrastructure
383
+
384
+
Before destroying the API stack, is is recommend you [empty](https://docs.aws.amazon.com/AmazonS3/latest/userguide/empty-bucket.html) and [delete](https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-bucket.html) the S3 Bucket that contains the S3 logs persisted by the Kinesis Firehose.
385
+
386
+
```
387
+
cdk destroy ab-testing-api
388
+
```
389
+
323
390
## Want to know more?
324
391
325
392
The [FAQ](FAQ.md) page has some answers to questions on the design principals of this sample.
0 commit comments