Skip to content

Commit b5395e5

Browse files
authored
fix:fix cli bugs (#44)
* chore: remove doc link * feat: add version * fix: update percent of ECS health status * chore: add message for quota limits
1 parent a6bf049 commit b5395e5

File tree

9 files changed

+21
-19
lines changed

9 files changed

+21
-19
lines changed

src/emd/cfn/ecs/cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: EMD ECS Cluster - Ensure all associated models are deleted before removing this stack.
2+
Description: Easy Model Deployer ECS Cluster - Ensure all associated models are deleted before removing this stack. Please go to https://github.com/aws-samples/easy-model-deployer for more information.
33
Parameters:
44
VPCID:
55
Type: AWS::EC2::VPC::Id

src/emd/cfn/ecs/template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: Deploy an ECS cluster with GPU-optimized AMI to run EMD model in a new VPC with secure networking.
2+
Description: Easy Model Deployer model deployment stack for Amazon ECS. The invoke URL can be found in the stack Outputs. Please go to https://github.com/aws-samples/easy-model-deployer for more information.
33
Parameters:
44
VPCID:
55
Type: AWS::EC2::VPC::Id
@@ -302,7 +302,7 @@ Resources:
302302
- !Ref ServiceSecurityGroup
303303
Subnets: !Ref Subnets
304304
DeploymentConfiguration:
305-
MaximumPercent: 200
305+
MaximumPercent: 100
306306
MinimumHealthyPercent: 75
307307
DesiredCount: !Ref DesiredCount
308308
TaskDefinition: !Ref TaskDefinition

src/emd/cfn/sagemaker/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: Create a SageMaker Endpoint using an ECR image URI
2+
Description: Easy Model Deployer model deployment stack for Amazon SageMaker. The invoke endpoint can be found in the stack Outputs. Please go to https://github.com/aws-samples/easy-model-deployer for more information.
33

44
Parameters:
55
ECRImageURI:

src/emd/cfn/sagemaker_async/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: Create a SageMaker Endpoint using an ECR image URI
2+
Description: Easy Model Deployer model deployment stack for Amazon SageMaker. The invoke endpoint can be found in the stack Outputs. Please go to https://github.com/aws-samples/easy-model-deployer for more information.
33

44
Parameters:
55
ECRImageURI:

src/emd/cfn/vpc/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: EMD Networking - Ensure all associated models are deleted before removing this stack.
2+
Description: Easy Model Deployer Networking - Ensure all associated models are deleted before removing this stack. Please go to https://github.com/aws-samples/easy-model-deployer for more information.
33
# This template creates a VPC, 2 public subnets in 2 different
44
# availability zones (to be used with EMD), and S3 endpoint to allow
55
# the ECS cluster to access the S3 bucket.

src/emd/cli.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@
7474
name="config",
7575
help="Set default config",
7676
)
77-
# app.add_typer(
78-
# version.app,
79-
# name="version",
80-
# help="Show version",
81-
# )
77+
78+
app.add_typer(
79+
version.app,
80+
name="version",
81+
help="Show version",
82+
)
83+
8284
@app.command(help="List supported models")
8385
@catch_aws_credential_errors
8486
def list_supported_models(model_id: Annotated[
@@ -105,6 +107,9 @@ def callback(ctx: typer.Context):
105107
)
106108
# Show main help
107109
console.print(ctx.get_help())
110+
console.print(
111+
" [dim]Further help: [link=https://github.com/aws-samples/easy-model-deployer]https://github.com/aws-samples/easy-model-deployer[/link][/dim]\n",
112+
)
108113

109114
if __name__ == "__main__":
110115
bootstrap.bootstrap()

src/emd/commands/deploy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ def deploy(
387387
choices=[
388388
Choice(
389389
title=instance.instance_type,
390-
description=instance.description,
390+
description=(instance.description + '\n\n' +
391+
"Note: If your deployment takes over 20 minutes, check your AWS service quotas, especially for G or P instances. Quotas are based on vCPUs, not instance count. Ensure your requests fit the limits. See Amazon EC2 instance type quotas for detail: https://docs.aws.amazon.com/ec2/latest/instances/ec2-instance-quota-types.html."
392+
)
391393
)
392394
for instance in supported_instances
393395
],

src/emd/commands/version.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from emd.revision import VERSION
1+
from emd.revision import VERSION, COMMIT_HASH
22
import typer
3-
from emd.utils.decorators import load_aws_profile, catch_aws_credential_errors, check_emd_env_exist
43
from emd.utils.logger_utils import make_layout
54

65
app = typer.Typer(pretty_exceptions_enable=False)
@@ -9,8 +8,5 @@
98

109
#@app.callback(invoke_without_command=True)(invoke_without_command=True)
1110
@app.callback(invoke_without_command=True)
12-
@catch_aws_credential_errors
13-
@check_emd_env_exist
14-
@load_aws_profile
1511
def version():
16-
print(VERSION)
12+
print(f"emd {VERSION} (build {COMMIT_HASH})")

src/emd/sdk/destroy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def stop_pipeline_execution(
6161
def destroy_ecs(model_id,model_tag,stack_name):
6262
cf_client = boto3.client('cloudformation')
6363
cf_client.delete_stack(StackName=stack_name)
64-
logger.warning(f"model: {model_id}, model_tag: {model_tag} is a ECS service, if the destruction fails, please destroy it manually using the guide at https://amzn-chn.feishu.cn/docx/YjTadv82Po7IBXxmS1RcmMGHndg")
6564

6665
def destroy(model_id:str,model_tag=MODEL_DEFAULT_TAG,waiting_until_complete=True):
6766
check_env_stack_exist_and_complete()

0 commit comments

Comments
 (0)