Skip to content

Epic: warehouse#753

Draft
atravitz wants to merge 10 commits intomainfrom
feat/warehouse
Draft

Epic: warehouse#753
atravitz wants to merge 10 commits intomainfrom
feat/warehouse

Conversation

@atravitz
Copy link
Copy Markdown
Contributor

@atravitz atravitz commented Feb 27, 2026

Changes to how we handle contexts and storage.

Implemented by @ethanholz - this epic is to track the work as a long-lived branch.

Tips

  • Comment "pre-commit.ci autofix" to have pre-commit.ci atomically format your PR.
    Since this will create a commit, it is best to make this comment when you are finished with your work.

Checklist

  • Added a news entry

Developers certificate of origin

ethanholz and others added 7 commits December 19, 2025 10:19
* feat(warehouse): initial re-implementation of StorageManager

* feat(warehouse): initial implementation with test

* feat(warehouse): add support for new context object

* feat(warehouse): experimental implementation of executing a DAG

* feat!: Replace Context with new implementation

BREAKING CHANGE: This completely breaks existing `Context` to leverage
our new context management.

* test(warehouse): add a context test

* test: cleanup test_protocolunit.py

* refactor(StorageManager)!: make _convert_to_namespace a static method

* test(ProtocolDAG): fix ProtocolDAG tests

* test(Protocol): cleanup testing for transformation and protocol

* test(Protocol): remove reliance on mixin in two cases since StorageManger isn't tokenizable

* chore: remove commented out code

* Revert "chore: remove commented out code"

This reverts commit 7e6bb03.

* chore: fix comments and cleanup code

* fix: satisfy typing

* refactor(StorageManager)!: make _convert_to_namespace, convert_to_namespace

* docs: storagemanager

* docs: add docstrings to Context object

* Update gufe/protocols/protocolunit.py

Co-authored-by: Alyssa Travitz <[email protected]>

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <[email protected]>

* fix: indents from code review web ui

* fix: remove TODO

* chore: rename scratch_path to scratch_dir

* chore: remove dead comment

* chore: remove redudndant fixtures

* refactor: rename convert_to_namespace to append_to_namespace

* docs: added news

* Apply suggestions from code review on news item

Co-authored-by: Alyssa Travitz <[email protected]>

* fix docs env build by mocking zstandard

* test: add a context test for validating cleanup

---------

Co-authored-by: Alyssa Travitz <[email protected]>
Co-authored-by: Alyssa Travitz <[email protected]>
* feat: return namespaced handles so other untis can ingest these handles

* test: add a test to validate

* Update gufe/storage/storagemanager.py

Co-authored-by: Alyssa Travitz <[email protected]>

---------

Co-authored-by: Alyssa Travitz <[email protected]>
… backend (#745)

* refactor: split out transfer functionality

* test: split out transfer functionality tests

Signed-off-by: Ethan Holz <[email protected]>

---------

Signed-off-by: Ethan Holz <[email protected]>
Co-authored-by: Alyssa Travitz <[email protected]>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (07d5540) to head (23137fa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
- Coverage   98.89%   98.75%   -0.14%     
==========================================
  Files          43       45       +2     
  Lines        2705     2740      +35     
==========================================
+ Hits         2675     2706      +31     
- Misses         30       34       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atravitz atravitz self-assigned this Feb 27, 2026
atravitz and others added 2 commits March 4, 2026 15:17
* docs: add information on storage

Signed-off-by: Ethan Holz <[email protected]>

* docs: initial draft on context

* docs: improve context docs

* docs: migrate how to write a custom implementation

* doc: update with comments from review

Co-authored-by: Alyssa Travitz <[email protected]>

* fix docs build

* docs: Add information on changes in feat/return-storage-handles

This adds new information on how storage is handled, and how storage
gets passed around by units.

* docs: add information on pre-namespaced objects from other branch

* docs: add suggestion to back link to Context docs

* docs: add becomes in migration guide per suggestion

* docs: add link to protocol how to

* docs: add more informaton on StorageManagers

* docs: clean up storage code example

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <[email protected]>

* fix typo

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <[email protected]>

* docs: add more context on context

* fix note formatting

* move serialization constraints to the end

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <[email protected]>

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <[email protected]>

* Apply suggestion from @atravitz

Co-authored-by: Alyssa Travitz <[email protected]>

* fix formatting for docs build

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <[email protected]>

* clean up

---------

Signed-off-by: Ethan Holz <[email protected]>
Co-authored-by: Alyssa Travitz <[email protected]>
Co-authored-by: Alyssa Travitz <[email protected]>
@dotsdl dotsdl self-requested a review April 10, 2026 19:36
@github-actions
Copy link
Copy Markdown

No API break detected ✅

Copy link
Copy Markdown
Member

@dotsdl dotsdl left a comment

Choose a reason for hiding this comment

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

This is looking excellent! Did a quick review of the new concept docs; just a couple notes I think should be addressed.

Will give the rest of the PR a thorough review at a later time! Can't wait to use this in alchemiscale to finally support result file retention!

Comment thread docs/concepts/context.rst

.. code-block:: python

path = ctx.shared.scratch_dir / "myfile.dat"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
path = ctx.shared.scratch_dir / "myfile.dat"
path = ctx.shared / "myfile.dat"

Comment thread docs/concepts/context.rst
Comment on lines +158 to +161
3. **Handle ctx.permanent.** There was no equivalent in the legacy API.
Decide which results must persist between DAG executions and write them via
``ctx.permanent``. For migration you can start by mirroring whatever used
to live in ``ctx.shared`` and refine later.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should recommend that protocol authors switch from shared to permanent by default, as this could result in large in-DAG intermediate files getting held by execution engines for no good reason.

The recommendation here should be to switch to permanent any files that must survive DAG execution for the purposes of continuation or understanding results later; the default should not be keep everything.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To elaborate: in alchemiscale, we plan to retain permanent files by default (unless opted out of by the Task creator) for DAGs, and only retain shared during the duration of DAG execution (for continuation if interrupted) or retain shared indenfinitely if opted into by the Task creator (for debugging problematic cases).

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