Skip to content

Epic: context & storage#753

Draft
atravitz wants to merge 13 commits into
mainfrom
feat/warehouse
Draft

Epic: context & storage#753
atravitz wants to merge 13 commits into
mainfrom
feat/warehouse

Conversation

@atravitz

@atravitz atravitz commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Changes to how we handle contexts and storage.

This introduces breaking changes that will require updates to openfe protocols and exorcist (as described in openfe #1833).

Whether we do this in 2.0 or a highly-advertised 1.x is TBD.

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 <31974495+atravitz@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>

* 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 <31974495+atravitz@users.noreply.github.com>

* fix docs env build by mocking zstandard

* test: add a context test for validating cleanup

---------

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
Co-authored-by: Alyssa Travitz <alyssa.travitz@omsf.io>
* 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 <31974495+atravitz@users.noreply.github.com>

---------

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
… backend (#745)

* refactor: split out transfer functionality

* test: split out transfer functionality tests

Signed-off-by: Ethan Holz <ethan.holz@omsf.io>

---------

Signed-off-by: Ethan Holz <ethan.holz@omsf.io>
Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.44%. Comparing base (571cca3) to head (def02e2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #753      +/-   ##
==========================================
- Coverage   98.56%   98.44%   -0.13%     
==========================================
  Files          43       45       +2     
  Lines        2797     2832      +35     
==========================================
+ Hits         2757     2788      +31     
- Misses         40       44       +4     

☔ View full report in Codecov by Harness.
📢 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 <ethan.holz@omsf.io>

* 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 <31974495+atravitz@users.noreply.github.com>

* 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 <31974495+atravitz@users.noreply.github.com>

* fix typo

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>

* 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 <31974495+atravitz@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>

* Apply suggestion from @atravitz

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>

* fix formatting for docs build

* Apply suggestions from code review

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>

* clean up

---------

Signed-off-by: Ethan Holz <ethan.holz@omsf.io>
Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
Co-authored-by: Alyssa Travitz <alyssa.travitz@omsf.io>
@dotsdl dotsdl self-requested a review April 10, 2026 19:36

@dotsdl dotsdl left a comment

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.

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).

@atravitz atravitz changed the title Epic: warehouse Epic: context & storage Jun 9, 2026
@github-actions

Copy link
Copy Markdown

🚨 API breaking changes detected! 🚨
View logs for this step

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