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

Use DVCLive step completed signal file events to trigger experiments and plots data updates #4579

Merged
merged 1 commit into from
Aug 29, 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
8 changes: 6 additions & 2 deletions extension/src/cli/dvc/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ export const TEMP_PLOTS_DIR = join(DOT_DVC, 'tmp', 'plots')
export const FIELD_SEPARATOR = '::'

export const TEMP_EXP_DIR = join(DOT_DVC, 'tmp', 'exps')
const TEMP_EXP_RUN_DIR = join(TEMP_EXP_DIR, 'run')
export const DVCLIVE_ONLY_RUNNING_SIGNAL_FILE = join(
TEMP_EXP_DIR,
'run',
TEMP_EXP_RUN_DIR,
'DVCLIVE_ONLY'
)
export const DVCLIVE_STEP_COMPLETED_SIGNAL_FILE = join(
TEMP_EXP_RUN_DIR,
'DVCLIVE_STEP_COMPLETED'
)
Copy link
Member Author

@mattseddon mattseddon Aug 29, 2023

Choose a reason for hiding this comment

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

[F] This is the new file that gets written to every time a DVCLive step is completed. It will be a file in the dvc root for experiments running in the queue as well (not in their temp directory).

export const EXP_RWLOCK_FILE = join(TEMP_EXP_DIR, 'rwlock.lock')

export const DEFAULT_CURRENT_BRANCH_COMMITS_TO_SHOW = 3
Expand Down
9 changes: 8 additions & 1 deletion extension/src/experiments/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import {
Args,
DOT_DVC,
DVCLIVE_STEP_COMPLETED_SIGNAL_FILE,
ExperimentFlag,
TEMP_EXP_DIR
} from '../../cli/dvc/constants'
Expand All @@ -38,7 +39,13 @@ export class ExperimentsData extends BaseData<ExperimentsOutput> {
internalCommands,
[{ name: 'update', process: () => this.update() }],
subProjects,
['dvc.lock', 'dvc.yaml', 'params.yaml', DOT_DVC]
[
'dvc.lock',
'dvc.yaml',
'params.yaml',
DOT_DVC,
DVCLIVE_STEP_COMPLETED_SIGNAL_FILE
]
)

this.experiments = experiments
Expand Down
3 changes: 2 additions & 1 deletion extension/src/plots/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AvailableCommands, InternalCommands } from '../../commands/internal'
import { BaseData } from '../../data'
import { sameContents, uniqueValues } from '../../util/array'
import { PlotsModel } from '../model'
import { DVCLIVE_STEP_COMPLETED_SIGNAL_FILE } from '../../cli/dvc/constants'

export class PlotsData extends BaseData<{
data: PlotsOutputOrError
Expand Down Expand Up @@ -39,7 +40,7 @@ export class PlotsData extends BaseData<{
}
],
subProjects,
['dvc.yaml', 'dvc.lock']
['dvc.yaml', 'dvc.lock', DVCLIVE_STEP_COMPLETED_SIGNAL_FILE]
)
this.model = model
this.onDidTrigger = this.triggered.event
Expand Down