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

Remove checkpoints model and file system watcher #3684

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions extension/src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export abstract class BaseData<
T extends { data: PlotsOutputOrError; revs: string[] } | ExpShowOutput
> extends DeferredDisposable {
public readonly onDidUpdate: Event<T>
public readonly onDidChangeDvcYaml: Event<void>

protected readonly dvcRoot: string
protected readonly processManager: ProcessManager
Expand All @@ -25,6 +26,10 @@ export abstract class BaseData<
new EventEmitter()
)

private readonly dvcYamlChanged: EventEmitter<void> = this.dispose.track(
new EventEmitter<void>()
)

constructor(
dvcRoot: string,
internalCommands: InternalCommands,
Expand All @@ -42,6 +47,8 @@ export abstract class BaseData<
this.onDidUpdate = this.updated.event
this.staticFiles = staticFiles

this.onDidChangeDvcYaml = this.dvcYamlChanged.event

this.watchFiles()

this.waitForInitialData()
Expand Down Expand Up @@ -80,6 +87,10 @@ export abstract class BaseData<
) {
void this.managedUpdate(path)
}

if (path.endsWith('dvc.yaml')) {
this.dvcYamlChanged.fire()
}
}
)
}
Expand Down
117 changes: 0 additions & 117 deletions extension/src/experiments/checkpoints/collect.test.ts

This file was deleted.

22 changes: 0 additions & 22 deletions extension/src/experiments/checkpoints/collect.ts

This file was deleted.

59 changes: 0 additions & 59 deletions extension/src/experiments/checkpoints/model.test.ts

This file was deleted.

21 changes: 0 additions & 21 deletions extension/src/experiments/checkpoints/model.ts

This file was deleted.

28 changes: 7 additions & 21 deletions extension/src/experiments/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,21 @@ export class ExperimentsData extends BaseData<ExpShowOutput> {
dvcRoot,
internalCommands,
updatesPaused,
[
{
name: 'partialUpdate',
process: () => this.update(ExperimentFlag.NO_FETCH)
},
{ name: 'fullUpdate', process: () => this.update() }
],
[{ name: 'update', process: () => this.update() }],
['dvc.lock', 'dvc.yaml', 'params.yaml', DOT_DVC]
)

this.experiments = experiments

void this.watchExpGitRefs()
void this.managedUpdate(QUEUED_EXPERIMENT_PATH)
void this.managedUpdate()
}

public managedUpdate(path?: string) {
if (
path?.includes(QUEUED_EXPERIMENT_PATH) ||
this.processManager.isOngoingOrQueued('fullUpdate')
) {
return this.processManager.run('fullUpdate')
}

return this.processManager.run('partialUpdate')
public managedUpdate() {
return this.processManager.run('update')
}

public async update(...args: (ExperimentFlag | string)[]): Promise<void> {
public async update(): Promise<void> {
const flags = this.experiments.getIsBranchesView()
? [ExperimentFlag.ALL_BRANCHES]
: [
Expand All @@ -68,8 +55,7 @@ export class ExperimentsData extends BaseData<ExpShowOutput> {
const data = await this.internalCommands.executeCommand<ExpShowOutput>(
AvailableCommands.EXP_SHOW,
this.dvcRoot,
...flags,
...args
...flags
)

this.collectFiles(data)
Expand Down Expand Up @@ -106,7 +92,7 @@ export class ExperimentsData extends BaseData<ExpShowOutput> {
if (
watchedRelPaths.some(watchedRelPath => path.includes(watchedRelPath))
) {
return this.managedUpdate(path)
return this.managedUpdate()
}
}
)
Expand Down
Loading