Skip to content

[UX]: live table when provisioning dstack configuration runs#1978

Closed
Tob-iee wants to merge 2 commits intodstackai:masterfrom
Tob-iee:issue_1951_live-table-for-runs
Closed

[UX]: live table when provisioning dstack configuration runs#1978
Tob-iee wants to merge 2 commits intodstackai:masterfrom
Tob-iee:issue_1951_live-table-for-runs

Conversation

@Tob-iee
Copy link
Copy Markdown
Contributor

@Tob-iee Tob-iee commented Nov 9, 2024

fixes #1951

# 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))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run = self.api.client.runs.get(self.api.project, run.name) is not needed.

Comment on lines -168 to -186
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})[/]"
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@r4victor
Copy link
Copy Markdown
Collaborator

@Tob-iee, the PR does not work. Please test the code before opening the PRs.

@Tob-iee
Copy link
Copy Markdown
Contributor Author

Tob-iee commented Nov 18, 2024

@Tob-iee, the PR does not work. Please test the code before opening the PRs.

@r4victor I have fixed the comments you pointed out and tested. Kindly have a look

@jvstme
Copy link
Copy Markdown
Collaborator

jvstme commented Nov 26, 2024

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 dstackai:master into your branch, but no new changes have been added. So far, Victor's comments are still relevant, and the PR doesn't work - I get the AttributeError exception whenever I run dstack apply with any run configuration.

I will close the PR for now, but please reopen it if you manage to make it work.

@jvstme jvstme closed this Nov 26, 2024
jvstme added a commit that referenced this pull request Nov 26, 2024
superprat pushed a commit to bahaal-tech/dstack that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Show a live table in `dstack apply for provisioning runs (similar to fleets, volumes, gateways, etc)

3 participants