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

Add show logs to context menu of experiments running in the queue #3347

Closed
wants to merge 2 commits into from

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Feb 24, 2023

Part of #3178

WIP.

Lots of duplication in the PR that can will be removed. Need to think more about how to set this out so that it can be used under certain circumstances for things like dvc pull. Thinking maybe

  1. show progress notification which contains "show logs" link
  2. show logs link opens a terminal and starts piping the output in (like demo below)

Demo

Screen.Recording.2023-02-24.at.3.48.00.pm.mov

@mattseddon mattseddon added the product PR that affects product label Feb 24, 2023
@mattseddon mattseddon self-assigned this Feb 24, 2023
@mattseddon
Copy link
Member Author

image

you got me

return this.config.getCliPath()
}

private createProcess({ cwd, args }: { cwd: string; args: Args }): Process {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

private currentProcess: Process | undefined
private readonly config: Config

constructor(
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

return this.run(cwd, Command.QUEUE, QueueSubCommand.LOGS, expName, '-f')
}

public stop() {
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

this.sendTelemetryEvent({ command, duration, exitCode, killed, stderr })
}

private sendTelemetryEvent({
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

)
}

private notifyCompleted({
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

@dberenbaum
Copy link
Contributor

@mattseddon Will it work for failed/successful experiments that were run by the queue also?

@shcheklein
Copy link
Member

Looks great! Q: is there a way to control the Terminal name? To include the experiment name in it:

Screenshot 2023-02-24 at 10 22 04 AM

So that I can see the list of Tasks (experiments) / terminals like in this case ^^, switch between them, etc?


private isActive = false

constructor(
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

}

protected createInstance() {
return new Promise<void>(resolve => {
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

)
}

private notifyActiveStatus() {
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

})
}

private deleteReferenceOnClose() {
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

import { StopWatch } from '../../util/time'

export class SingleUsePseudoTerminal extends BasePseudoTerminal {
constructor(
Copy link

Choose a reason for hiding this comment

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

Function constructor has 42 lines of code (exceeds 30 allowed). Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Feb 26, 2023

Code Climate has analyzed commit 63b13de and detected 13 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 12

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

This pull request will bring the total coverage in the repository to 95.4% (-0.5% change).

View more on Code Climate.

@mattseddon
Copy link
Member Author

@mattseddon Will it work for failed/successful experiments that were run by the queue also?

It can. Not sure if all of the required data is actually in exp show but I can work it out.

Q: is there a way to control the Terminal name?

Yep, was getting there.

@mattseddon mattseddon closed this Feb 27, 2023
@mattseddon mattseddon deleted the follow-queue-logs branch February 27, 2023 02:32
@mattseddon
Copy link
Member Author

Need to refactor before I can get this in.

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