-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from aitomatic/feat/integrate_deploy_train_furuno
Integrate command to trigger Furuno training job
- Loading branch information
Showing
7 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[metadata] | ||
name = aitomatic-cli | ||
name = aitomatic | ||
version = file: version.txt | ||
author = Pham Hoang Tuan | ||
author_email = [email protected] | ||
|
@@ -19,6 +19,7 @@ packages = | |
src | ||
src.app | ||
src.login | ||
src.api | ||
install_requires = | ||
click == 8.0.4 | ||
requests == 2.27.1 | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import click | ||
from src.login.main import authenticated | ||
from src.api.aitomatic import AiCloudApi | ||
|
||
|
||
@click.command() | ||
@click.argument('app_name', type=str) | ||
@click.pass_obj | ||
@authenticated | ||
def execute(obj, app_name): | ||
'''Execute app in Aitomatic cluster''' | ||
|
||
click.echo(f'Execute {app_name} app in Aitomatic...') | ||
|
||
api = AiCloudApi(token=obj.get("access_token")) | ||
res = api.execute(app_id=app_name, data={"foo": "bar"}) | ||
|
||
data = res.json() | ||
if data['status'] == 'OK': | ||
click.echo(f'{data["message"]}. Open {data["url"]} for more information') | ||
else: | ||
click.echo(f'{data["message"]}.') |
This file contains 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
This file contains 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