Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor oci-copy to be more efficient
Originally, this task would download all artifacts requested in the input file, check them all, and then upload them all to the registry in one invocation of "oras push". This had two problems. First, if "oras push" flaked out part way through and the user needed to retry their pipeline, the entire download section would need to be run again needlessly. Second, for extremely large artifacts with lots of medium-sized files, an enormous PVC would be needed to hold all of them between download and push to the registry. The change here addresses both problems. First, files are downloaded, checked, pushed to the registry and then deleted from local storage - one at a time. This obviates the need for a large volume to store all files at once, since only enough storage is needed to store one file, not all of them. Second, as files are considered, first the registry is checked to see if the blob has already been pushed there. If it has, then skip the download step. This has the effect of greatly improving the runtime for artifacts where only one or two of many files have changed since the last taskrun.
- Loading branch information