tiup icon indicating copy to clipboard operation
tiup copied to clipboard

Support different compression format of packages

Open sticnarf opened this issue 4 years ago • 4 comments

Feature Request

Describe the feature you'd like:

tiup cluster patch now only accepts a .tar.gz archive. I would like it could accept something like .tar.lz4, .tar.zstd or just .tar.

Why the featue is needed:

Gzip is an obsolete compression algorithm. Waiting for gzipping my binary is painful... It is much slower than new competitors like lz4 and zstd. And sometimes I don't care about the network bandwidth, so a vanilla.tar is good to me.

sticnarf avatar May 26 '21 08:05 sticnarf

The component tarball used to deploy them are decompressed on the (remote) deploy server, so it's possible the compress format is not supported by the target system. This is also true for patch command in tiup-cluster.

For tiup itself, local installed components are decompressed by tiup so it would be much easier to support multiple formats.

AstroProfundis avatar Jul 27 '21 09:07 AstroProfundis

The component tarball used to deploy them are decompressed on the (remote) deploy server, so it's possible the compress format is not supported by the target system. This is also true for patch command in tiup-cluster.

For tiup itself, local installed components are decompressed by tiup so it would be much easier to support multiple formats.

I understand the tarball may be not supported by the target system. But I don't think it a problem for patch.

From my experience, tiup cluster patch has two use cases:

  1. Hotfix a component in the production environment.
  2. Replace binaries in a testing cluster in development.

In the first case, the developers will certainly use a conservative compression format like gzip.

In both cases, the system manager should be aware of the compression formats that the system supports. It is also not a big deal to encounter errors reporting that the format is not supported by the target system.

sticnarf avatar Jul 27 '21 09:07 sticnarf

I think it's too expensive to only support multiple compress format for the patch command, it's more reasonable to make it a general feature for everywhere a compressed file is present, as we need to implement some methods to detect compress format of the file anyway.

AstroProfundis avatar Jul 27 '21 10:07 AstroProfundis

memo: the InstallPackage task (in pkg/cluster/task/install_package.go) need to be updated to support multiple compress formats as well, the current implementation is hard coded to only support .tar.gz.

AstroProfundis avatar Oct 20 '21 07:10 AstroProfundis