-
Notifications
You must be signed in to change notification settings - Fork 29
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
Experiments Commands #2: Add "Run All Queued Experiments" Command #268
Changes from all commits
32f8b2a
dd6e407
070ab4c
5b93e3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,22 @@ export enum Commands { | |
ADD = 'add', | ||
CHECKOUT = 'checkout', | ||
CHECKOUT_RECURSIVE = 'checkout --recursive', | ||
EXPERIMENT_RUN = 'exp run', | ||
EXPERIMENT_SHOW = 'exp show --show-json', | ||
INITIALIZE_SUBDIRECTORY = 'init --subdir', | ||
PULL = 'pull', | ||
PUSH = 'push', | ||
STATUS = 'status --show-json', | ||
QUEUE_EXPERIMENT = 'exp run --queue' | ||
} | ||
|
||
const getCliCommand = (command: string, ...options: string[]): string => { | ||
return `dvc ${command} ${options.join(' ')}` | ||
EXPERIMENT_RUN = 'exp run', | ||
EXPERIMENT_SHOW = 'exp show --show-json', | ||
EXPERIMENT_QUEUE = 'exp run --queue', | ||
EXPERIMENT_RUN_ALL = 'exp run --run-all', | ||
EXPERIMENT_GC = 'exp gc -f -w' | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Making these builder commands for every possible string interpolation seems a bit overkill in the face of there being more commands, so instead this PR opts to remove these and go full enum. We'll likely adopt some sort of shared command-building solution as we start using configurable options more, but I don't think this one is it. |
||
|
||
export const getRunExperimentCommand = (): string => { | ||
return getCliCommand(Commands.EXPERIMENT_RUN) | ||
export enum GcPreserveFlag { | ||
ALL_BRANCHES = '--all-branches', | ||
ALL_TAGS = '--all-tags', | ||
ALL_COMMITS = '--all-commits', | ||
QUEUED = '--queued' | ||
} | ||
|
||
export const getCommandWithTarget = ( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[C] This is super weird 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old test is weird, or the fact this change was needed is weird?
For the latter, it's just a consequence of removing the
exp run
command builder, which built the command with a space at the end due to how it anticipated options.For the former, agreed.