Store optimization data using blobs - #13948
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13948 +/- ##
==========================================
- Coverage 91.93% 91.93% -0.01%
==========================================
Files 482 483 +1
Lines 33516 33558 +42
==========================================
+ Hits 30813 30850 +37
- Misses 2703 2708 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Pull request overview
This PR updates ERT’s local storage format to store Everest optimization “batch” parquet dataframes as ensemble blobs (instead of loose *.parquet files under the ensemble directory), including a migration to move existing batch parquet files into blob storage and tests validating the new behavior (including dark-storage HTTP access).
Changes:
- Add a new blob metadata type (
EVEREST_BATCH_DATA/EverestBatchData) and persist Everest batch dataframes as blobs viaLocalEnsemble.save_batch_dataframes(). - Introduce local-storage schema version 36 and a
to36migration that moves legacybatch_*.parquetfiles intoensembles/<ens>/blobs/. - Extend unit tests to cover blob persistence, migration behavior, and dark-storage
/ensembles/{id}/blobs+/blobs/{uri}endpoints for Everest batch data.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ert/unit_tests/storage/test_local_storage.py | Adds tests that batch dataframes are saved as Everest batch blobs and that missing batch data returns None. |
| tests/ert/unit_tests/storage/migration/test_to36.py | Adds migration tests ensuring batch parquet files are moved into blob storage and non-batch parquet files remain untouched. |
| tests/ert/unit_tests/dark_storage/test_http_endpoints.py | Adds endpoint tests for listing Everest batch dataframe blobs and fetching parquet bytes via blob URI. |
| src/ert/storage/migration/to36.py | Implements the v36 migration that moves batch_*.parquet into blobs/ with Everest batch blob metadata. |
| src/ert/storage/local_storage.py | Bumps local storage version to 36 and wires in the to36 migration. |
| src/ert/storage/local_ensemble.py | Writes Everest batch dataframes into blob storage and reads them back from blobs via new helper logic. |
| src/ert/storage/blob_data.py | Adds the EVEREST_BATCH_DATA discriminator and EverestBatchData model to the blob metadata union. |
46e03a3 to
bcdee6a
Compare
bcdee6a to
6fafe67
Compare
|
Screenshots differ from baselines. A baseline update PR has been prepared: equinor/ert-testdata#49 |
| info = "Remove is_improvement flag from ensembles" | ||
|
|
||
|
|
||
| def migrate(path: Path) -> None: |
There was a problem hiding this comment.
I guess this migration is not required for this PR.
If it is only cleanup then maybe it might be merged with the other migration.
|
Screenshot tests now pass. The baseline update PR equinor/ert-testdata#49 has been closed. |
| def _read_batch_dataframe(self, dataframe_name: str) -> pl.DataFrame | None: | ||
| for meta in self.load_blobs(BlobType.EVEREST_BATCH_DATA): | ||
| if ( | ||
| isinstance(meta.blob_info, EverestBatchData) |
There was a problem hiding this comment.
I guess this isinstance validation is there for the sake of mypy otherwise it is redundant
There was a problem hiding this comment.
Its only for better typing
9391612 to
dbb6238
Compare
xjules
left a comment
There was a problem hiding this comment.
No more comments. Good job @frode-aarstad !
Remember to squash the commits.
Issue
Resolves #13901
Approach
Short description of the approach
(Screenshot of new behavior in GUI if applicable)
git rebase -i main --exec 'just rapid-tests')When applicable