From e71bdfcc05fb103f6745d1695dc44fd12d79dc47 Mon Sep 17 00:00:00 2001 From: michaelact <86778470+michaelact@users.noreply.github.com> Date: Fri, 5 Apr 2024 11:18:36 +0700 Subject: [PATCH] feat(cache): compression .tgz with pigz --- cache/Dockerfile-save | 7 ++++++- cache/save_cache | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cache/Dockerfile-save b/cache/Dockerfile-save index 5bf8e668e..c9f5e4dcc 100644 --- a/cache/Dockerfile-save +++ b/cache/Dockerfile-save @@ -1,4 +1,9 @@ ARG project_id FROM gcr.io/${project_id}/cache -ENTRYPOINT ["save_cache"] \ No newline at end of file +RUN apt-get update \ + && apt-get install -y pigz \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +ENTRYPOINT ["save_cache"] diff --git a/cache/save_cache b/cache/save_cache index 2c5381786..14c632315 100755 --- a/cache/save_cache +++ b/cache/save_cache @@ -84,7 +84,7 @@ if [ "$NO_CLOBBER" = true ];then fi echo "Compressing cache to ${CACHE_FILE}..." -tar cpzf "$CACHE_FILE" ${PATHS[@]} -P +tar --use-compress-program="pigz -k " -cpf "$CACHE_FILE" ${PATHS[@]} -P if [ -n "$BUCKET" ];then echo "Uploading cache to Google Cloud Storage..."