File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ def describe(self, app_handle: AppHandle) -> Optional[AppDef]:
597
597
if not app :
598
598
desc = scheduler .describe (app_id )
599
599
if desc :
600
- app = AppDef (name = app_id , roles = desc .roles )
600
+ app = AppDef (name = app_id , roles = desc .roles , metadata = desc . metadata )
601
601
return app
602
602
603
603
def log_lines (
Original file line number Diff line number Diff line change @@ -440,14 +440,15 @@ def build_workspace_and_update_role(
440
440
441
441
def test_describe (self , _ ) -> None :
442
442
with self .get_runner () as runner :
443
+ metadata = {"a" : "b" , "c" : "d" }
443
444
role = Role (
444
445
name = "sleep" ,
445
446
image = str (self .tmpdir ),
446
447
resource = resource .SMALL ,
447
448
entrypoint = "sleep" ,
448
449
args = ["60" ],
449
450
)
450
- app = AppDef ("sleeper" , roles = [role ])
451
+ app = AppDef ("sleeper" , roles = [role ], metadata = metadata )
451
452
452
453
app_handle = runner .run (app , scheduler = "local_dir" , cfg = self .cfg )
453
454
self .assertEqual (app , runner .describe (app_handle ))
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class DescribeAppResponse:
43
43
the status and description of the application as known by the scheduler.
44
44
For some schedulers implementations this response object has necessary
45
45
and sufficient information to recreate an ``AppDef`` object. For these types
46
- of schedulers, the user can re-``run()`` the recreted application. Otherwise
46
+ of schedulers, the user can re-``run()`` the recreated application. Otherwise
47
47
the user can only call non-creating methods (e.g. ``wait()``, ``status()``,
48
48
etc).
49
49
@@ -61,6 +61,7 @@ class DescribeAppResponse:
61
61
msg : str = NONE
62
62
structured_error_msg : str = NONE
63
63
ui_url : Optional [str ] = None
64
+ metadata : dict [str , str ] = field (default_factory = dict )
64
65
65
66
roles_statuses : List [RoleStatus ] = field (default_factory = list )
66
67
roles : List [Role ] = field (default_factory = list )
You can’t perform that action at this time.
0 commit comments