feat: pigz#254
Open
rrsettgast wants to merge 3 commits into
Open
Conversation
Prefer a tar-to-pigz pipeline when packing integrated test baselines so gzip compression can use the available CPU cores. Keep the existing Python gztar path as a fallback when tar or pigz is unavailable, and preserve the existing .tar.gz archive format.
There was a problem hiding this comment.
Pull request overview
This PR introduces an optional fast-path for creating baseline tarballs using external tar + parallel gzip (pigz), while keeping the existing Python shutil.make_archive(..., format="gztar") behavior as a fallback. It also expands the default restart-check exclusion patterns to ignore additional HDF5 paths that are likely unstable across runs.
Changes:
- Add a
tar | pigzpipeline for baseline archive creation, falling back to Pythongztarif tools are unavailable or the pipeline fails. - Add a helper to determine an appropriate CPU thread count for
pigz. - Update
restart_check.pydefault exclusion regex list to includedNdXanddetJ.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| geos-ats/src/geos/ats/helpers/restart_check.py | Extends default HDF5 exclusion patterns used during restart comparisons. |
| geos-ats/src/geos/ats/baseline_io.py | Adds an external tar + pigz archiving path to speed up baseline archive creation with a fallback to Python’s gztar. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+181
to
+205
| try: | ||
| with open( archive_path, 'wb' ) as output: | ||
| tar_process = subprocess.Popen( [ tar_bin, '-C', baseline_path, '-cf', '-', '.' ], | ||
| stdout=subprocess.PIPE ) | ||
| if tar_process.stdout is None: | ||
| raise RuntimeError( 'failed to capture tar output' ) | ||
| pigz_process = subprocess.Popen( [ pigz_bin, '-9', '-p', threads ], | ||
| stdin=tar_process.stdout, | ||
| stdout=output ) | ||
| tar_process.stdout.close() | ||
|
|
||
| pigz_status = pigz_process.wait() | ||
| tar_status = tar_process.wait() | ||
|
|
||
| if tar_status != 0 or pigz_status != 0: | ||
| try: | ||
| os.remove( archive_path ) | ||
| except FileNotFoundError: | ||
| pass | ||
| raise RuntimeError( f'tar exited with {tar_status}; pigz exited with {pigz_status}' ) | ||
|
|
||
| except Exception as e: | ||
| logger.warning( 'Parallel baseline archive creation failed; using Python gztar archiver' ) | ||
| logger.warning( repr( e ) ) | ||
| return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
uses parallel gzip (pigz) for creating archives.