|
1 | 1 | import typer
|
2 |
| -from rich.console import Console |
3 |
| -from rich.panel import Panel |
4 |
| -from typing import Optional |
5 |
| -from pathlib import Path |
6 |
| -import boto3 |
7 |
| -from botocore.exceptions import ClientError, NoCredentialsError |
8 |
| -import time |
9 |
| -import os |
10 |
| -from enum import Enum |
11 |
| -import shutil |
12 |
| -import zipfile |
13 |
| -from emd.revision import VERSION, COMMIT_HASH |
14 |
| - |
15 | 2 | from emd.commands import (
|
16 | 3 | bootstrap,
|
17 | 4 | deploy,
|
18 |
| - # models, |
| 5 | + models, |
19 | 6 | destroy,
|
20 | 7 | version,
|
21 | 8 | status,
|
22 |
| - config |
| 9 | + config, |
| 10 | + example |
23 | 11 | )
|
24 | 12 | from emd.commands.invoke import invoke
|
25 |
| -from emd.utils.aws_service_management import check_aws_environment |
26 |
| -from typing_extensions import Annotated |
27 |
| -from emd.utils.decorators import load_aws_profile,catch_aws_credential_errors |
28 |
| -from emd.models import Model |
29 |
| -import json |
| 13 | +from emd.revision import VERSION, COMMIT_HASH |
| 14 | +from rich.console import Console |
| 15 | +from rich.panel import Panel |
30 | 16 |
|
31 | 17 | app = typer.Typer(
|
32 | 18 | add_completion=False,
|
|
38 | 24 | app.add_typer(
|
39 | 25 | bootstrap.app,
|
40 | 26 | name="bootstrap",
|
41 |
| - help="Set up AWS environment for model deployment", |
| 27 | + help="Initialize AWS resources for model deployment", |
42 | 28 | )
|
43 | 29 | app.add_typer(
|
44 | 30 | deploy.app,
|
45 | 31 | name="deploy",
|
46 |
| - help="Deploy a model", |
| 32 | + help="Deploy models to AWS infrastructure", |
47 | 33 | )
|
48 | 34 | app.add_typer(
|
49 | 35 | status.app,
|
50 | 36 | name="status",
|
51 |
| - help="Query model status", |
| 37 | + help="Display status of deployed models", |
52 | 38 | )
|
53 | 39 |
|
54 | 40 | # app.add_typer(
|
|
58 | 44 | # )
|
59 | 45 |
|
60 | 46 | app.add_typer(
|
61 |
| - destroy.app, |
62 |
| - name="destroy", |
63 |
| - help="Destroy a model deployment", |
| 47 | + invoke.app, |
| 48 | + name="invoke", |
| 49 | + help="Test deployed models with sample requests", |
64 | 50 | )
|
65 | 51 |
|
66 | 52 | app.add_typer(
|
67 |
| - invoke.app, |
68 |
| - name="invoke", |
69 |
| - help="Invoke a model for testing, after deployment", |
| 53 | + example.app, |
| 54 | + name="example", |
| 55 | + help="Generate sample code for API integration", |
| 56 | +) |
| 57 | + |
| 58 | +app.add_typer( |
| 59 | + destroy.app, |
| 60 | + name="destroy", |
| 61 | + help="Remove deployed models and clean up resources", |
70 | 62 | )
|
71 | 63 |
|
| 64 | +app.add_typer(models.app, name="list-supported-models", help="Display available models") |
| 65 | + |
72 | 66 | app.add_typer(
|
73 | 67 | config.app,
|
74 |
| - name="config", |
75 |
| - help="Set default config", |
| 68 | + name="profile", |
| 69 | + help="Configure AWS profile credentials", |
76 | 70 | )
|
77 | 71 |
|
78 | 72 | app.add_typer(
|
79 | 73 | version.app,
|
80 | 74 | name="version",
|
81 |
| - help="Show version", |
| 75 | + help="Display tool version information", |
82 | 76 | )
|
83 | 77 |
|
84 |
| -@app.command(help="List supported models") |
85 |
| -@catch_aws_credential_errors |
86 |
| -def list_supported_models( |
87 |
| - model_id: Annotated[ |
88 |
| - str, typer.Argument(help="Model ID") |
89 |
| - ] = None, |
90 |
| - detail: Annotated[ |
91 |
| - Optional[bool], |
92 |
| - typer.Option("-a", "--detail", help="output model information in details.") |
93 |
| - ] = False |
94 |
| -): |
95 |
| - # console.print("[bold blue]Retrieving models...[/bold blue]") |
96 |
| - support_models = Model.get_supported_models(detail=detail) |
97 |
| - if model_id: |
98 |
| - support_models = [model for _model_id,model in support_models.items() if _model_id == model_id] |
99 |
| - r = json.dumps(support_models,indent=2,ensure_ascii=False) |
100 |
| - print(f"{r}") |
101 |
| - |
102 |
| -# app.add_typer(models.app, name="model",help="list supported models") |
103 |
| - |
104 | 78 | @app.callback(invoke_without_command=True)
|
105 | 79 | def callback(ctx: typer.Context):
|
106 | 80 | if ctx.invoked_subcommand is None:
|
|
0 commit comments