Skip to content

Commit

Permalink
Remove checkpoints model and file system watcher (#3684)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Apr 17, 2023
1 parent ead10f9 commit 269840a
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 512 deletions.
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

0 comments on commit 269840a

Please sign in to comment.