File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import click
2
+
3
+ from launch .cli .client import init_client
4
+ from launch .cli .console import pretty_print , spinner
5
+
6
+
7
+ @click .group ("batch-jobs" )
8
+ @click .pass_context
9
+ def batch_jobs (ctx : click .Context ):
10
+ """
11
+ Batch Jobs is a wrapper around batch jobs in Scale Launch
12
+ """
13
+
14
+
15
+ @batch_jobs .command ("get" )
16
+ @click .argument ("job_id" )
17
+ @click .pass_context
18
+ def get_bundle (ctx : click .Context , job_id : str ):
19
+ """Print bundle info"""
20
+ client = init_client (ctx )
21
+
22
+ with spinner (f"Fetching batch job '{ job_id } '" ):
23
+ batch_job = client .get_batch_async_response (job_id )
24
+
25
+ pretty_print (f"status: { batch_job ['status' ]} " )
26
+ pretty_print (f"result: { batch_job ['result' ]} " )
27
+ pretty_print (f"duration: { batch_job ['duration' ]} " )
28
+ pretty_print (f"# tasks pending: { batch_job ['num_tasks_pending' ]} " )
29
+ pretty_print (f"# tasks completed: { batch_job ['num_tasks_completed' ]} " )
Original file line number Diff line number Diff line change 1
1
import click
2
2
3
+ from launch .cli .batch_jobs import batch_jobs
3
4
from launch .cli .bundles import bundles
4
5
from launch .cli .config import ContextObject , config , set_config
5
6
from launch .cli .endpoints import endpoints
@@ -26,6 +27,7 @@ def entry_point(ctx, **kwargs):
26
27
ctx .invoke (set_config )
27
28
28
29
30
+ entry_point .add_command (batch_jobs ) # type: ignore
29
31
entry_point .add_command (bundles ) # type: ignore
30
32
entry_point .add_command (config ) # type: ignore
31
33
entry_point .add_command (endpoints ) # type: ignore
You can’t perform that action at this time.
0 commit comments