This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Example workflow pipeline script for abalone pipeline. | |
| . -RegisterModel | |
| . | |
| Process-> Train -> Evaluate -> Condition . | |
| . | |
| . -(stop) | |
| Implements a get_pipeline(**kwargs) method. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| step_train = TrainingStep( | |
| name="TrainAbaloneModel", | |
| estimator=xgb_train, | |
| inputs={...}, | |
| retry_policies=[ | |
| step_retry_policy, | |
| job_retry_policy | |
| ] | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sagemaker.workflow.retry import ( | |
| StepRetryPolicy, | |
| StepExceptionTypeEnum, | |
| SageMakerJobStepRetryPolicy, | |
| SageMakerJobExceptionTypeEnum | |
| ) | |
| step_retry_policy = StepRetryPolicy( | |
| exception_types=[ | |
| StepExceptionTypeEnum.SERVICE_FAULT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "VPCDeployment", | |
| "Effect": "Deny", | |
| "Action": [ | |
| "sagemaker:CreateAutoMLJob", | |
| "sagemaker:CreateDataQualityJobDefinition", | |
| "sagemaker:CreateDomain", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Action": [ | |
| "sagemaker:CreateApp" | |
| ], | |
| "Resource": [ | |
| "*" | |
| ], | |
| "Effect": "Deny", | |
| "Sid": "BlockSagemakerOtherThanT3", | |
| "Condition": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ## GET MODELS FROM S3 INTO THE /TMP FOLDER | |
| aws s3 sync ${MODEL_REPOSITORY} /tmp/model_repository | |
| # RUN TRITON | |
| /opt/tritonserver/bin/tritonserver --model-repository=/tmp/model_repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aws_cdk import core | |
| from stacks.iam_stack import IamStack | |
| from stacks.vpc_stack import VpcStack | |
| from stacks.ecs_stack import EcsStack | |
| class InferenceStack(core.Stack): | |
| def __init__(self, scope: core.Construct, id: str, **kwargs) -> None: | |
| super().__init__(scope, id, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM nvcr.io/nvidia/tritonserver:21.05-py3 | |
| # INSTALL AWS CLI | |
| RUN apt-get update && apt-get install -y \ | |
| unzip \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | |
| && unzip awscliv2.zip \ | |
| && ./aws/install \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "DomainId": "<domain-id>", | |
| "DefaultUserSettings": { | |
| "KernelGatewayAppSettings": { | |
| "CustomImages": [ | |
| { | |
| "ImageName": "tf25", | |
| "AppImageConfigName": "tf25-config" | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 0.2 | |
| phases: | |
| pre_build: | |
| commands: | |
| - IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-8) | |
| - sh build_and_push.sh ${IMAGE_NAME} ${IMAGE_TAG} | |
| - echo "IMAGE PUSHED TO ECR" | |
| build: |