Skip to content

Commit

Permalink
Compress release archive sources
Browse files Browse the repository at this point in the history
We now compress the sources before copying them into the GCB archive
directory. This allows us faster retrieval of those sources.

Signed-off-by: Sascha Grunert <[email protected]>
  • Loading branch information
saschagrunert committed Jun 17, 2021
1 parent e8b49f0 commit 5333511
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/release/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"k8s.io/release/pkg/gcp"
"k8s.io/release/pkg/object"
"sigs.k8s.io/release-utils/command"
"sigs.k8s.io/release-utils/tar"

"sigs.k8s.io/release-utils/util"
)
Expand Down Expand Up @@ -288,10 +289,14 @@ func (a *defaultArchiverImpl) CopyReleaseToBucket(releaseBuildDir, archiveBucket
return errors.Wrap(err, "normalizing destination path")
}

logrus.Infof("Copy %s to %s...", releaseBuildDir, remoteDest)
tarball := releaseBuildDir + ".tar.gz"
logrus.Infof("Compressing %s to %s", releaseBuildDir, tarball)
if err := tar.Compress(tarball, releaseBuildDir); err != nil {
return errors.Wrap(err, "create source tarball")
}

// logrun $GSUTIL -mq cp $dash_args $WORKDIR/* $archive_bucket/$build_dir || true
if err := gcs.RsyncRecursive(releaseBuildDir, remoteDest); err != nil {
logrus.Infof("Copy %s to %s", tarball, remoteDest)
if err := gcs.CopyToRemote(tarball, remoteDest); err != nil {
return errors.Wrap(err, "copying release directory to bucket")
}
return nil
Expand Down

0 comments on commit 5333511

Please sign in to comment.