Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Experiment Remote Status #4324

Merged
merged 9 commits into from
Jul 24, 2023
Merged

Show Experiment Remote Status #4324

merged 9 commits into from
Jul 24, 2023

Conversation

mattseddon
Copy link
Contributor

@mattseddon mattseddon commented Jul 21, 2023

Related to #3574

This PR extends the experiment status indicator to the right of an experiment in the table.

The indicator will now show whether or not an experiment has been pushed to the git remote (the extension uses git ls-remote origin 'refs/exps/*' to determine whether or not an experiment is on the remote).

If the experiment is not on the remote then an icon is shown that the user can click to push. If it is on the remote then an icon is shown to indicate that status. If the experiment is pushed via the extension then we show a spinner to indicate that something is happening.

Limitations:

  • Experiments pushed via the CLI will not show a spinner
  • There are no "remote watchers" to trigger table updates for things like other team members deleting your experiments from the remote or even a user running dvc exp remove -g origin <exp-name> themselves.
  • Performance could be an issue

Demo

Screen.Recording.2023-07-24.at.7.31.46.pm.mov
Screen.Recording.2023-07-24.at.7.35.28.pm.mov

cc @dberenbaum

@mattseddon mattseddon added the product PR that affects product label Jul 21, 2023
@mattseddon mattseddon self-assigned this Jul 21, 2023
@mattseddon mattseddon force-pushed the show-exp-remote-status branch from e403be6 to c928747 Compare July 24, 2023 03:17
@@ -68,6 +69,18 @@ export class GitReader extends GitCli {
}
}

public async getRemoteExperimentRefs(cwd: string): Promise<string> {
const options = getOptions({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] Bit concerned with the performance of this. Have spent considerable time trying to find a way around but haven't come up with anything yet.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should start doing status non-essential heavy checks in background for experiments. If we already do - what is your concern then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you mean polling?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should look at setting up WebSockets in Studio.

Copy link
Member

Choose a reason for hiding this comment

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

I mean that it's important that all these statutes don't affect UI. It's fine that some icons/ statuses are missing and appear in a while. WebSockets won't be enough since we need to run it the first time? (I might be missing the context of what we do here btw).

return Toast.delayProgressClosing(15000)
} catch (error: unknown) {
void updateOnCompletion()
throw error
Copy link
Contributor Author

@mattseddon mattseddon Jul 24, 2023

Choose a reason for hiding this comment

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

[F] This will be caught by InternalCommands and offer to show the output channel to the user (which will show the underlying error). We just need to update the data appropriately before that error is thrown.

}

public unsetPushing(ids: string[]) {
this.experiments.unsetPushing(ids)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] We don't notify here because we want to fetch the data again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've moved update into here to make sure the function is never accidentally called without it.

}

.plotBox {
@extend %iconBox;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[Q] Should I be using cx instead of extending a base class?

Copy link
Contributor

Choose a reason for hiding this comment

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

Extending a base class sounds like a better option to me since this class isn't conditionally added.

Though %iconBox should be moved to the "Extendable Silent Rules" section (starts on line 15).

export const ExperimentStatusIndicator: React.FC<
ExperimentStatusIndicatorProps
> = ({ id, status, gitRemoteStatus }) => {
if (isRunning(status) || gitRemoteStatus === GitRemoteStatus.PUSHING) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[I] This status field should be renamed to executorStatus or similar in a follow up

@mattseddon mattseddon marked this pull request as ready for review July 24, 2023 09:43
@mattseddon mattseddon requested a review from shcheklein July 24, 2023 09:43
Copy link
Contributor

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

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

Great work!


if (gitRemoteStatus === GitRemoteStatus.ON_REMOTE) {
return (
<CellHintTooltip tooltipContent="Experiment on remote">
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make the cloud's icon the same width as other icons (aka 16px instead of 20px)? This will also keep all experiments along the same alignment:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for some reason I thought 16 was the default, updated

}

.plotBox {
@extend %iconBox;
Copy link
Contributor

Choose a reason for hiding this comment

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

Extending a base class sounds like a better option to me since this class isn't conditionally added.

Though %iconBox should be moved to the "Extendable Silent Rules" section (starts on line 15).

@@ -68,6 +69,18 @@ export class GitReader extends GitCli {
}
}

public async getRemoteExperimentRefs(cwd: string): Promise<string> {
const options = getOptions({
args: [Command.LS_REMOTE, DEFAULT_REMOTE, 'refs/exps/*'],
Copy link
Contributor

Choose a reason for hiding this comment

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

There are no "remote watchers" to trigger table updates for things like other team members deleting your experiments from the remote or even a user running dvc exp remove -g origin themselves.

Might have already been discussed, but have we considered adding a refresh button that will run this command again? Could be a generic one that refreshes all table data entirely or adding an extra action to our "remote state" tooltips 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have purposefully avoided a refresh button up to this point. We may have to introduce one for remote action but let's hold off until after we decide on a strategy for fetching the data.

@mattseddon mattseddon enabled auto-merge (squash) July 24, 2023 22:01
@codeclimate
Copy link

codeclimate bot commented Jul 24, 2023

Code Climate has analyzed commit ad0f089 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 96.3% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.2%.

View more on Code Climate.

@mattseddon mattseddon merged commit 1c9fe13 into main Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants