Skip to content

Add context manager to load workflow resources#166

Merged
christopherwharrop-noaa merged 15 commits into
mainfrom
feature/context-manager
Mar 9, 2026
Merged

Add context manager to load workflow resources#166
christopherwharrop-noaa merged 15 commits into
mainfrom
feature/context-manager

Conversation

@christopherwharrop-noaa

Copy link
Copy Markdown
Collaborator

This udpate adds a workflow context manager that wraps parsl.load() so that users do not have to interact with Parsl to use Chiltepin. It allows resource configs to be loaded with an include option. It also allows for custom paths for runinfo and parsl logging.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new workflow() context manager to centralize Parsl configuration + lifecycle management so callers can run Chiltepin workflows without directly interacting with Parsl.

Changes:

  • Introduces src/chiltepin/workflow.py providing workflow(), workflow_from_file(), and workflow_from_dict().
  • Updates tests to use the new context manager instead of manually calling parsl.load()/cleanup.
  • Updates documentation and CI test commands to reflect the new workflow API and pytest invocation.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/chiltepin/workflow.py New context managers wrapping configure.load() + parsl.load() with cleanup and optional Parsl file logging.
src/chiltepin/__init__.py Exposes workflow helpers from the package root for simpler imports.
tests/test_workflow.py Adds coverage for the new context managers (dict/file configs, aliases, cleanup behavior).
tests/test_tasks.py Replaces manual Parsl setup/teardown fixture with workflow(...).
tests/test_parsl_hello.py Uses workflow(...) for Parsl lifecycle in integration tests.
tests/test_parsl_mpi.py Uses workflow(...) for Parsl lifecycle in MPI integration tests.
tests/test_globus_compute_hello.py Uses workflow(...) for Parsl lifecycle in Globus Compute integration tests.
tests/test_globus_compute_mpi.py Uses workflow(...) for Parsl lifecycle in Globus Compute + MPI integration tests.
tests/test_data.py Uses workflow(...) for Parsl lifecycle in data tests.
docs/quickstart.rst Updates examples to use the workflow context manager (but currently has a broken import/usage mismatch).
docs/configuration.rst Updates configuration loading docs to use workflow(...).
docs/data.rst Updates data workflow example to use workflow(...).
docs/testing.rst Updates pytest command examples.
docs/container.rst Updates container pytest command examples.
.github/workflows/test-suite.yaml Updates CI pytest invocation options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chiltepin/workflow.py Outdated
Comment thread docs/quickstart.rst Outdated
Comment thread docs/quickstart.rst Outdated
Comment thread docs/quickstart.rst Outdated
@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 2 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 34 0 100.00%
TOTAL 445 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chiltepin/workflow.py Outdated
Comment thread src/chiltepin/__init__.py Outdated
Comment thread docs/data.rst
@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 2 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 36 0 100.00%
TOTAL 447 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/quickstart.rst
Comment thread docs/quickstart.rst
Comment thread src/chiltepin/workflow.py Outdated
Comment thread src/chiltepin/workflow.py Outdated
Comment thread src/chiltepin/workflow.py
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:FAIL (Coverage: 98.28% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 48 8 83.33% 125-126, 130-131, 137-138, 142-145
TOTAL 464 8 98.28%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

1 similar comment
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:FAIL (Coverage: 98.28% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 48 8 83.33% 125-126, 130-131, 137-138, 142-145
TOTAL 464 8 98.28%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chiltepin/workflow.py Outdated
Comment thread tests/test_workflow.py Outdated
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:FAIL (Coverage: 99.79% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 53 1 98.11% 133
TOTAL 469 1 99.79%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_tasks.py Outdated
Comment thread tests/test_workflow.py Outdated
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 63 0 100.00%
TOTAL 479 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_workflow.py
Comment thread tests/test_workflow.py
Comment thread tests/test_workflow.py
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status: ⚠️ UNKNOWN (Coverage: N/A% | Threshold: 100%)

❌ Coverage report not available


Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chiltepin/workflow.py
Comment thread tests/test_workflow.py Outdated
Comment thread tests/test_workflow.py Outdated
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 69 0 100.00%
TOTAL 485 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/configuration.rst
Comment thread src/chiltepin/workflow.py
Comment thread src/chiltepin/workflow.py
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 59 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 69 0 100.00%
TOTAL 485 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/chiltepin/configure.py Outdated
Comment thread docs/configuration.rst
Comment on lines +510 to +513
.. note::
The default **"local"** resource is always available, regardless of the ``include``
parameter. You do not need to add "local" to the include list to use it. This ensures
you always have a fallback resource available for tasks.

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The note says the default "local" resource is always available regardless of include, but there are important edge cases: (1) if a user defines their own local resource and omits it from include, the workflow will fall back to the default local instead of the user-defined one; and (2) include containing "local" may currently error if "local" is not present in the config. Clarifying these behaviors here would prevent user confusion.

Copilot uses AI. Check for mistakes.
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 61 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 69 0 100.00%
TOTAL 487 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_configure.py Outdated
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 63 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 69 0 100.00%
TOTAL 489 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

📊 Test Coverage Report

Status:PASS (Coverage: 100.00% | Threshold: 100%)

Name Stmts Miss Cover Missing
src/chiltepin/__init__.py 7 0 100.00%
src/chiltepin/cli.py 38 0 100.00%
src/chiltepin/configure.py 63 0 100.00%
src/chiltepin/data.py 58 0 100.00%
src/chiltepin/endpoint.py 215 0 100.00%
src/chiltepin/tasks.py 39 0 100.00%
src/chiltepin/workflow.py 69 0 100.00%
TOTAL 489 0 100.00%

Coverage report generated by pytest-cov. Full HTML report available in workflow artifacts.

@christopherwharrop-noaa christopherwharrop-noaa merged commit ff1e953 into main Mar 9, 2026
12 checks passed
@christopherwharrop-noaa christopherwharrop-noaa deleted the feature/context-manager branch March 9, 2026 21:01
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.

2 participants