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 export command #24

Merged
merged 8 commits into from
Feb 21, 2024
Merged

Add export command #24

merged 8 commits into from
Feb 21, 2024

Conversation

amisevsk
Copy link
Contributor

Description

Add export command to the CLI, allowing users to extract resources packaged into a model. The export command supports exporting from remote registries as well as local ones, without needing to pull the model into local storage first.

Flags:

  • -d|--dir - export to a different directory (default is current dir)
  • --http - If communicating with a registry, disable TLS (useful for testing against locally-running registries)
  • --config, --models, --code, --datasets - export only some parts of the model (config, trained models, code, or datasets). Can be combined (e.g. --config --models to export both config and models, but not code/datasets)

In addition, this PR fixes some minor bugs in the build command: previously the tarball we were building did not include directory entries and the prefixes for paths were inconsistent. Also we add some validation to try ensure file paths stay within the specified context when building.

Currently, exporting via direct reference to a hash does not work; we need to figure out how to handle tagging first.

Add command 'jmm export <reference>' to enable exporting contents of a
built model to disk. The export command takes an optional -d|--dir
parameter to optionally export into a specific directory (by default,
the current directory is used).
* Add additional validation to paths to ensure layer paths are
  subdirectories of the overall context
* Fix process of tarring layer directories to include directory entries
  in the tarball
* Minor cleanup of small inconsistencies
Add flags
  --models
  --config
  --code
  --datasets
to control which elements of the package are exported. If none are
specified, the whole model is exported by default; otherwise, only those
components are exported. For example,

  jmm export <ref> --models --config

will only export the trained models and configuration file, ignoring
datasets and code.
Enable jmm export to export artifacts directly from remote registries,
without needing to pull the full artifact into local storage. This
allows e.g. exporting the config file for a model without downloading
the actual parameters.
Add flag --overwrite to the export command; if set, overwrite will
overwrite existing directories and files while exporting.
Verify paths when exporting models to ensure everything is exported into
a subdirectory of the export directory.
@amisevsk amisevsk merged commit e7d7a65 into main Feb 21, 2024
@amisevsk amisevsk deleted the jmm-export branch February 21, 2024 18: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.

2 participants