feat: support export to output path for pull command #36
+305
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to enhance the functionality of the pull and push operations, as well as refactoring some parts of the codebase. The most significant changes include adding support for specifying an output path for exporting model artifacts, renaming and refactoring the
tar.go
file, and updating the progress bar style.Enhancements to pull and push operations:
cmd/pull.go
: Added a new flag--output
to specify the output path for exporting the model artifact and updated therunPull
function to handle this new configuration. [1] [2]pkg/backend/options.go
: Introduced a new optionWithOutputPath
to set the output path for the pull operation. [1] [2]pkg/backend/pull.go
: Implemented the logic to export the target model artifact to the specified output directory if theoutputPath
option is set. [1] [2]pkg/backend/push.go
: Refined thepushIfNotExist
function to fetch the manifest from the source storage and push it to the destination, ensuring the content is correctly handled. [1] [2]Refactoring and codebase improvements:
pkg/archiver/archiver.go
: Renamed frompkg/backend/build/tar.go
and refactored theTarFileToStream
function toTar
. Added a newUntar
function to handle untarring streams to a destination path. [1] [2]pkg/backend/build/build.go
: Updated the import paths and changed the call fromTarFileToStream
toarchiver.Tar
. [1] [2]Progress bar style update:
pkg/backend/progress.go
: Modified the progress bar style to use a more consistent and simplified style.