Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zstd support for faster tarball creation or extraction in eessi_container.sh #994

Conversation

casparvl
Copy link
Collaborator

@casparvl casparvl commented Apr 2, 2025

When --resume and/or --save is used and zstd is available.

The builds in this PR show the benefit on a system that has zstd available. For SAMtools, the total time for the build job goes down from 12 to 4 minutes (tarballs for saving the container state of the build_step are something like 1.7GB for this build). For pmt, it goes down from 22 to 3.5 minutes (tarballs for saving the container state of the build step are around 3.2 GB for this build). Note also that the tarball size goes down (2.7 GB for pmt for the build_step), so zstd is not only faster, it also compresses better. Could also be nice for our file size footprint on the AWS storage.

…ume and/or --save is used and zstd is avaialble
Copy link

eessi-bot bot commented Apr 2, 2025

Instance eessi-bot-mc-aws is configured to build for:

  • architectures: x86_64/generic, x86_64/intel/haswell, x86_64/intel/sapphirerapids, x86_64/intel/skylake_avx512, x86_64/amd/zen2, x86_64/amd/zen3, aarch64/generic, aarch64/neoverse_n1, aarch64/neoverse_v1
  • repositories: eessi.io-2023.06-software, eessi.io-2023.06-compat

Copy link

eessi-bot bot commented Apr 2, 2025

Instance eessi-bot-mc-azure is configured to build for:

  • architectures: x86_64/amd/zen4
  • repositories: eessi.io-2023.06-compat, eessi.io-2023.06-software

@eessi-bot-trz42
Copy link

Instance trz42-GH200-jr is configured to build for:

  • architectures: aarch64/nvidia/grace
  • repositories: eessi.io-2023.06-software

@eessi-bot-toprichard
Copy link

Instance rt-Grace-jr is configured to build for:

  • architectures: aarch64/nvidia/grace
  • repositories: eessi.io-2023.06-software

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

Instance eessi-bot-surf is configured to build for:

  • architectures: x86_64/amd/zen4, x86_64/amd/zen2
  • repositories: eessi-hpc.org-2023.06-compat, eessi-hpc.org-2023.06-software, eessi.io-2023.06-compat, eessi.io-2023.06-software

@casparvl
Copy link
Collaborator Author

casparvl commented Apr 2, 2025

Hmmm, I'm not sure if I need more of the changes from #903 to make things work on Snellius. Nor if I can actually build some CPU-only stuff there. But let's try :)

bot: build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-aws (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-azure (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

@eessi-bot-trz42
Copy link

Updates by the bot instance trz42-GH200-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-surf (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

@eessi-bot-toprichard
Copy link

Updates by the bot instance rt-Grace-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

New job on instance eessi-bot-surf for CPU micro-architecture x86_64-amd-zen4 and accelerator nvidia/cc90 for repository eessi.io-2023.06-software in job dir /projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938268

date job status comment
Apr 02 19:59:14 UTC 2025 submitted job id 10938268 will be eligible to start in about 20 seconds
Apr 02 19:59:18 UTC 2025 received job awaits launch by Slurm scheduler
Apr 02 19:59:41 UTC 2025 running job 10938268 is running
Apr 02 20:04:07 UTC 2025 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-10938268.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.gz created!
Artefacts
eessi-2023.06-software-linux-x86_64-amd-zen4-1743624186.tar.gzsize: 1 MiB (1976194 bytes)
entries: 123
modules under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/modules/all
SAMtools/1.19.2-GCC-13.2.0.lua
software under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/software
SAMtools/1.19.2-GCC-13.2.0
other under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90
no other files in tarball
Apr 02 20:04:07 UTC 2025 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ PASSED ] Ran 0/0 test case(s) from 0 check(s) (0 failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-10938268.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case

@casparvl
Copy link
Collaborator Author

casparvl commented Apr 2, 2025

bot: build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-aws (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-azure (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-surf (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

@eessi-bot-toprichard
Copy link

Updates by the bot instance rt-Grace-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-trz42
Copy link

Updates by the bot instance trz42-GH200-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

New job on instance eessi-bot-surf for CPU micro-architecture x86_64-amd-zen4 and accelerator nvidia/cc90 for repository eessi.io-2023.06-software in job dir /projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938430

date job status comment
Apr 02 20:11:56 UTC 2025 submitted job id 10938430 will be eligible to start in about 20 seconds
Apr 02 20:12:04 UTC 2025 received job awaits launch by Slurm scheduler
Apr 02 20:12:27 UTC 2025 running job 10938430 is running
Apr 02 20:24:07 UTC 2025 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-10938430.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.gz created!
Artefacts
eessi-2023.06-software-linux-x86_64-amd-zen4-1743625092.tar.gzsize: 1 MiB (1975814 bytes)
entries: 123
modules under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/modules/all
SAMtools/1.19.2-GCC-13.2.0.lua
software under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/software
SAMtools/1.19.2-GCC-13.2.0
other under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90
no other files in tarball
Apr 02 20:24:07 UTC 2025 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ PASSED ] Ran 0/0 test case(s) from 0 check(s) (0 failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-10938430.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case

@casparvl
Copy link
Collaborator Author

casparvl commented Apr 2, 2025

bot: build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-aws (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-azure (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

@eessi-bot-trz42
Copy link

Updates by the bot instance trz42-GH200-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-toprichard
Copy link

Updates by the bot instance rt-Grace-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

New job on instance eessi-bot-surf for CPU micro-architecture x86_64-amd-zen4 and accelerator nvidia/cc90 for repository eessi.io-2023.06-software in job dir /projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938934

date job status comment
Apr 02 20:29:25 UTC 2025 submitted job id 10938934 will be eligible to start in about 20 seconds
Apr 02 20:29:32 UTC 2025 received job awaits launch by Slurm scheduler
Apr 02 20:29:55 UTC 2025 running job 10938934 is running
Apr 02 20:35:05 UTC 2025 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-10938934.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.gz created!
Artefacts
eessi-2023.06-software-linux-x86_64-amd-zen4-1743625999.tar.gzsize: 1 MiB (1975791 bytes)
entries: 123
modules under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/modules/all
SAMtools/1.19.2-GCC-13.2.0.lua
software under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/software
SAMtools/1.19.2-GCC-13.2.0
other under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90
no other files in tarball
Apr 02 20:35:05 UTC 2025 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ PASSED ] Ran 0/0 test case(s) from 0 check(s) (0 failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-10938934.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case

@casparvl
Copy link
Collaborator Author

casparvl commented Apr 2, 2025

bot: build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-aws (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-surf (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-azure (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

@eessi-bot-toprichard
Copy link

Updates by the bot instance rt-Grace-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-trz42
Copy link

Updates by the bot instance trz42-GH200-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

New job on instance eessi-bot-surf for CPU micro-architecture x86_64-amd-zen4 and accelerator nvidia/cc90 for repository eessi.io-2023.06-software in job dir /projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938964

date job status comment
Apr 02 20:33:20 UTC 2025 submitted job id 10938964 will be eligible to start in about 20 seconds
Apr 02 20:33:37 UTC 2025 received job awaits launch by Slurm scheduler
Apr 02 20:34:13 UTC 2025 running job 10938964 is running
Apr 02 20:56:24 UTC 2025 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-10938964.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.gz created!
Artefacts
eessi-2023.06-software-linux-x86_64-amd-zen4-1743626556.tar.gzsize: 0 MiB (405929 bytes)
entries: 39
modules under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/modules/all
pmt/1.2.0-GCCcore-12.3.0-CUDA-12.1.1.lua
software under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/software
pmt/1.2.0-GCCcore-12.3.0-CUDA-12.1.1
other under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90
no other files in tarball
Apr 02 20:56:24 UTC 2025 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ PASSED ] Ran 0/0 test case(s) from 0 check(s) (0 failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-10938964.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case

@casparvl
Copy link
Collaborator Author

casparvl commented Apr 2, 2025

bot: build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-aws (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

Copy link

eessi-bot bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-mc-azure (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

    • no jobs were submitted

@eessi-bot-toprichard
Copy link

Updates by the bot instance rt-Grace-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-trz42
Copy link

Updates by the bot instance trz42-GH200-jr (click for details)
  • account casparvl has NO permission to send commands to the bot

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

Updates by the bot instance eessi-bot-surf (click for details)
  • received bot command build instance:eessi-bot-surf repo:eessi.io-2023.06-software arch:zen4 accel:nvidia/cc90 from casparvl

    • expanded format: build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90
  • handling command build instance:eessi-bot-surf repository:eessi.io-2023.06-software architecture:zen4 accelerator:nvidia/cc90 resulted in:

@eessi-bot-surf
Copy link

eessi-bot-surf bot commented Apr 2, 2025

New job on instance eessi-bot-surf for CPU micro-architecture x86_64-amd-zen4 and accelerator nvidia/cc90 for repository eessi.io-2023.06-software in job dir /projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10939509

date job status comment
Apr 02 21:00:07 UTC 2025 submitted job id 10939509 will be eligible to start in about 20 seconds
Apr 02 21:00:19 UTC 2025 received job awaits launch by Slurm scheduler
Apr 02 21:00:33 UTC 2025 running job 10939509 is running
Apr 02 21:04:14 UTC 2025 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-10939509.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.gz created!
Artefacts
eessi-2023.06-software-linux-x86_64-amd-zen4-1743627784.tar.gzsize: 0 MiB (409017 bytes)
entries: 39
modules under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/modules/all
pmt/1.2.0-GCCcore-12.3.0-CUDA-12.1.1.lua
software under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90/software
pmt/1.2.0-GCCcore-12.3.0-CUDA-12.1.1
other under 2023.06/software/linux/x86_64/amd/zen4/accel/nvidia/cc90
no other files in tarball
Apr 02 21:04:14 UTC 2025 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ PASSED ] Ran 0/0 test case(s) from 0 check(s) (0 failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-10939509.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case

@casparvl casparvl marked this pull request as ready for review April 2, 2025 21:06
Copy link
Collaborator

@trz42 trz42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'll give it a try later today.

if [[ -d ${SAVE} ]]; then
# assume SAVE is name of a directory to which tarball shall be written to
# name format: tmp_storage-{TIMESTAMP}.tgz
ts=$(date +%s)
TGZ=${SAVE}/tmp_storage-${ts}.tgz
if [[ -x "$(command -v zstd)" ]]; then
TARBALL=${SAVE}/tmp_storage-${ts}.zst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is .zst the standard extensions for zstd-compressed tarballs?
I've never seen that anywhere...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is. https://en.wikipedia.org/wiki/Zstd

I believe if your tar is build with zstd support, you can do -xaf to inflate and it will infer from the extension that it needs to use zstd. But: I guess you could have zstd on your system and not have your tar compiled with zstd support, so my current implementation is more portable.

if [[ "${RESUME}" == *.tgz ]]; then
tar xf ${RESUME} -C ${EESSI_HOST_STORAGE}
# Add support for resuming from zstd-compressed tarballs
elif [[ "${RESUME}" == *.zst && -x "$(command -v zstd)" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not check once if zstd is supported, define a constant, and use that everywhere:

if [[ -x $(command -v zstd) ]]; then
    USE_ZSTD=true
else
    USE_ZSTD=false
fi

Copy link
Collaborator Author

@casparvl casparvl Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, you can, but then you have to check if [[ "${USE_ZSTD}" == 'true' ]] (remember, this is bash, not python, there is no boolean in bash.

Since you have to do a test anyway, the current is explicit, equally short, and execution time of command -v is negligible. No point in storing it in an environment variable, then having to remember what the value to check for is (true or True or whatever).

Copy link
Collaborator

@trz42 trz42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as intended.

Tested with tarballs of about 14 GB size. Resuming with gzip2 took about 3-4 minutes, saving about 12-13 minutes. With zstd resuming took about 2 minutes, saving about 2-3 minutes.

Nice! 👍

@trz42 trz42 merged commit 4623765 into EESSI:2023.06-software.eessi.io Apr 10, 2025
51 of 67 checks passed
Copy link

eessi-bot bot commented Apr 10, 2025

PR merged! Moved [] to /project/def-users/SHARED/trash_bin/EESSI/software-layer/2025.04.10

1 similar comment
Copy link

eessi-bot bot commented Apr 10, 2025

PR merged! Moved [] to /project/def-users/SHARED/trash_bin/EESSI/software-layer/2025.04.10

@gpu-bot-ugent
Copy link

gpu-bot-ugent bot commented Apr 10, 2025

PR merged! Moved [] to /scratch/gent/vo/002/gvo00211/SHARED/trash_bin/EESSI/software-layer/2025.04.10

@eessi-bot-surf
Copy link

PR merged! Moved ['/projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938268', '/projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938964', '/projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938430', '/projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10939509', '/projects/eessibot/eessi-bot-surf/jobs/2025.04/pr_994/10938934'] to /projects/eessibot/eessi-bot-surf/trash_bin/EESSI/software-layer/2025.04.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants