[UX]: live table when provisioning dstack configuration runs#1978
[UX]: live table when provisioning dstack configuration runs#1978Tob-iee wants to merge 2 commits intodstackai:masterfrom
Conversation
| # Live table setup | ||
| with Live(console=console, refresh_per_second=LIVE_TABLE_REFRESH_RATE_PER_SEC) as live: | ||
| while True: | ||
| live.update(self.get_runs_table([run], verbose=True)) |
There was a problem hiding this comment.
Cannot access attribute "get_runs_table" for class "BaseRunConfigurator*"
Ensure get_runs_table is properly imported and used.
| exit(1) | ||
| time.sleep(LIVE_TABLE_PROVISION_INTERVAL_SECS) | ||
| run.refresh() | ||
| run = self.api.client.runs.get(self.api.project, run.name) |
There was a problem hiding this comment.
run = self.api.client.runs.get(self.api.project, run.name) is not needed.
| while True: | ||
| with console.status(f"Launching [code]{run.name}[/]") as status: | ||
| while run.status in ( | ||
| RunStatus.SUBMITTED, | ||
| RunStatus.PENDING, | ||
| RunStatus.PROVISIONING, | ||
| ): | ||
| job_statuses = "\n".join( | ||
| f" - {job.job_spec.job_name} [secondary]({job.job_submissions[-1].status.value})[/]" | ||
| for job in run._run.jobs | ||
| ) | ||
| status.update( | ||
| f"Launching [code]{run.name}[/] [secondary]({run.status.value})[/]\n{job_statuses}" | ||
| ) | ||
| time.sleep(5) | ||
| run.refresh() | ||
| console.print( | ||
| f"[code]{run.name}[/] provisioning completed [secondary]({run.status.value})[/]" | ||
| ) |
There was a problem hiding this comment.
This code is deleted but without it you will always get Lost run connection. since you later try to check if run is still active but it's not even started yet.
|
@Tob-iee, the PR does not work. Please test the code before opening the PRs. |
|
Hi @Tob-iee. Thank you for your contribution and sorry for the delayed response. Did you push your changes to the PR? I see you merged I will close the PR for now, but please reopen it if you manage to make it work. |
…#1978 (dstackai#2036) Co-authored-by: Jvst Me <git@jvst.me>
fixes #1951