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 command lines orion db dump and orion db load #1005

Closed
wants to merge 14 commits into from

Conversation

notoraptor
Copy link
Collaborator

Description

Hi @bouthilx ! This is a PR to fix #953 . Commands orion db dump and orion db load are added.

  • orion db dump show already fully work
  • orion db load should work with parameter --exp, and for full import if there is no ID collision.

TODO

  • Make orion db load work when there is ID collision on full import.
  • Add testing

Changes

Add commands orion db dump and orion db load

Checklist

Tests

  • I added corresponding tests for bug fixes and new features. If possible, the tests fail without the changes
  • All new and existing tests are passing ($ tox -e py38; replace 38 by your Python version if necessary)

Documentation

  • I have updated the relevant documentation related to my changes

Quality

  • I have read the CONTRIBUTING doc
  • My commits messages follow this format
  • My code follows the style guidelines ($ tox -e lint)

Move dump logic into a function.
- add and use CLI basic arguments
- use both version and name to find experiment to dump
- Raise DatabaseError when error occurs in the script
- If found many experiments for a given name, pick experiment with lower version
- raise DatabaseError when errors occur in th script
- If found many experiments for a given name, pick experiment with lower version
@notoraptor notoraptor changed the title (WIP) Add command lines orion db dump and orion db load Add command lines orion db dump and orion db load Oct 11, 2022

cli.get_basic_args_group(dump_parser)

dump_parser.add_argument(
Copy link
Member

Choose a reason for hiding this comment

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

We should add a --force option and avoid overwritting the output file if it already exists and --force is not passed.


def dump_database(orig_db, dump_host, experiment=None, version=None):
"""Dump a database
:param orig_db: database to dump
Copy link
Member

Choose a reason for hiding this comment

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

We try to uniformise all docstrings to numpy format.

"-r",
"--resolve",
type=str,
choices=("ignore", "overwrite", "bump"),
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember, did we discuss about making one choice the default one? Is it that if we don't specify one it will be prompted if needed?

notoraptor and others added 2 commits February 7, 2023 03:13
Co-authored-by: Xavier Bouthillier <xavier.bouthillier@gmail.com>
Co-authored-by: Xavier Bouthillier <xavier.bouthillier@gmail.com>
@notoraptor
Copy link
Collaborator Author

Closed, continued here: #1082

@notoraptor notoraptor closed this Mar 14, 2023
@notoraptor notoraptor deleted the command-line-orion-db branch March 14, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support storage checkpointing and restore
2 participants