-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workflows: update durabletask dependency #757
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. Please run tox -e ruff
and tox -e flake8
to fix linter errors.
We'll also need to update the grpc library to >= 1.67.0, for compatibility with durabletask.
And finally, we'll need to update the tests in test_dapr_workflow_context.py
to cover set-custom_status
. Something like
class FakeOrchestrationContext:
def __init__(self):
self.instance_id = mock_instance_id
self.custom_status = None. # <- adding this
def set_custom_status(self, custom_status):
self.custom_status = custom_status
...
class DaprWorkflowContextTest(unittest.TestCase):
...
def test_workflow_context_functions(self):
...
dapr_wf_ctx.set_custom_status(mock_status)
assert fakeContext.custom_status == mock_status
ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py
Outdated
Show resolved
Hide resolved
setup.cfg
Outdated
@@ -26,8 +26,8 @@ include_package_data = True | |||
zip_safe = False | |||
install_requires = | |||
protobuf >= 4.22 | |||
grpcio >= 1.37.0 | |||
grpcio-status>=1.37.0 | |||
grpcio >= 1.67.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@berndverst any objections on bumping the grpc library version?
This has been updated in the durable task fork and it's a dependency here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 1.37.0 is very old, it's from April 2021. I think we're safe to update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not mean it would use 1.37 but that 1.37 would be possible to be used. Pip by default will always install the latest version matching the constraint unless an older version is cached (that behavior can be changed by the way). But if another library a customer is using required grpcio==1.47.0
for example it would be possible for that specific version to be used.
In Python two versions cannot coexist unlike in other languages. So it's really really important not to force the minimum version to something recent unless this is absolutely necessary.
To provide a specific example, at this time the tensorflow
development test container pins grpcio
1.42.0 and this is common for folks using Python 3.9 with compatible tensorflow packages for example. A lot of people use libraries in production that pin specific grpcio
versions and they want to use Dapr for added functionality.
Pinning a recent grpcio
as the minimum version prevents a lot of compatibility with other packages.
For this reason I must strongly disagree with pinning 1.67.0 as the minimum version. You could argue it is the fault of those other packages for constraining the maximum version of grpcio
- and that would be true, but that is a pedantic viewpoint. We need to ensure a good experience for customers.
Note - I have been here before: I made this very mistake as a Dapr maintainer - then several ML users complained about incompatibilities between Dapr and their ML package and a hotfix release had to be made.
Now from a security perspective it is wrong to say that a low minimum version (which includes vulnerable package versions) is a security issue in Dapr. Python resolves dependency versions at install time.
Installing dapr
via pip install dapr --no-cache-dir
would ensure to install the latest version of all dependencies from pypi. Folks who do not want this can manually add specific dependencies to their own requirements.txt
to control the transitive dependency versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grpcio >= 1.67.0 | |
grpcio >= 1.42.0 |
Short of auditing the Dapr community to figure out what libraries everyone uses and what the dependencies are pinning... here is a quick thing I identified. This is evidence of at least 1.42.0 being used for something.
If as a project we want to say that we do not care about ML users - or that ML users must be on the latest official grpcio
packages (highly unlikely because ML package authors are very slow to update packages) then we could consider increasing the minimum version of grpcio
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this version is imposed by the protos used in the durable task library.
@cgillum and @famarting, can we regenerate the protos with an older grpcio version? I suggest we pin it to a version we agree on in the requirements file. I'll check for any CVEs and share here, so we can decide which version would make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes let's please do that -- you should not use the latest grpcio-tools to generate the protos -- instead use an older version for wider compatibility with more versions of grpcio.
Is this only an issue in the "fork" or also the upstream version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's coming from the upstream, here's the commit: microsoft/durabletask-python#31.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we have to update the protos, I would suggest doing it here https://github.com/dapr/durabletask-protobuf , since dapr is already based on that one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the PR: dapr/durabletask-python#6
Once that's merged I'll publish a new version and we can update this PR.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #757 +/- ##
==========================================
- Coverage 86.63% 86.14% -0.50%
==========================================
Files 84 89 +5
Lines 4473 4993 +520
==========================================
+ Hits 3875 4301 +426
- Misses 598 692 +94 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending @berndverst 's approval on the grpcio version bump
setup.cfg
Outdated
@@ -26,8 +26,8 @@ include_package_data = True | |||
zip_safe = False | |||
install_requires = | |||
protobuf >= 4.22 | |||
grpcio >= 1.37.0 | |||
grpcio-status>=1.37.0 | |||
grpcio >= 1.67.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grpcio >= 1.67.0 | |
grpcio >= 1.42.0 |
Short of auditing the Dapr community to figure out what libraries everyone uses and what the dependencies are pinning... here is a quick thing I identified. This is evidence of at least 1.42.0 being used for something.
If as a project we want to say that we do not care about ML users - or that ML users must be on the latest official grpcio
packages (highly unlikely because ML package authors are very slow to update packages) then we could consider increasing the minimum version of grpcio
.
tools/requirements.txt
Outdated
@@ -1 +1 @@ | |||
grpcio-tools>=1.57.0 | |||
grpcio-tools>=1.67.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful. Changing this version is prone to huge changes to the resulting compiled protos, which therefore requires new versions of grpcio
.
New versions of grpcio
can load compiled protos from older grpcio-tools
. But older grpcio
versions cannot load compiled protos from the newest grpcio-tools
.
I strongly recommend carefully testing this compatibility matrix - it is best not to change this version here (which is only used once as part of the release process -- it is a build dependency for maintainers only).
Unless you have a reason to change this, don't.
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Hannah Hunter <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
This option was replaced in 2020, deprecated, and eventually removed in tox 4. The correct option already appears elseware in this tox.ini file. This fix is necessary to run `tox -e doc` per the README.md instructions on tox 4. Signed-off-by: Eric Searcy <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
* Moved files to new branch to avoid weird git bug Signed-off-by: Lorenzo Curcio <[email protected]> * requested documentation changes Signed-off-by: Lorenzo Curcio <[email protected]> * forgot to move file back to starting point Signed-off-by: Lorenzo Curcio <[email protected]> * result of ruff format Signed-off-by: Lorenzo Curcio <[email protected]> * fixed minor formatting issues, fixed type issues Signed-off-by: Lorenzo Curcio <[email protected]> * minor test fix Signed-off-by: Lorenzo Curcio <[email protected]> * fixes try_add_state Signed-off-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Revert "fixes try_add_state" This reverts commit 254ad17. Signed-off-by: Lorenzo Curcio <[email protected]> * Update dapr/actor/runtime/mock_state_manager.py Fixing bug in try_add_state as mentioned in PR dapr#756 Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update dapr/actor/runtime/mock_actor.py Whoops missed this Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * minor error in docs Signed-off-by: Lorenzo Curcio <[email protected]> * fixed and added more unit tests. Added example Signed-off-by: Lorenzo Curcio <[email protected]> * unittest fix Signed-off-by: Lorenzo Curcio <[email protected]> * Update examples/demo_actor/README.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * concentrated some tests Signed-off-by: Lorenzo Curcio <[email protected]> * removed unnecessary type hint Signed-off-by: Lorenzo Curcio <[email protected]> * Update daprdocs/content/en/python-sdk-docs/python-actor.md didnt see this earlier whoops Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * Update examples/demo_actor/README.md Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> * documentation changes Signed-off-by: Lorenzo Curcio <[email protected]> * now requires #type: ignore Signed-off-by: Lorenzo Curcio <[email protected]> * small docs change Signed-off-by: Elena Kolevska <[email protected]> * examples test fix Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Lorenzo Curcio <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Lorenzo Curcio <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
* workflows, remove deprecated functions Signed-off-by: Fabian Martinez <[email protected]> * revert changes to example Signed-off-by: Fabian Martinez <[email protected]> * update warning messages Signed-off-by: Fabian Martinez <[email protected]> * Typos Signed-off-by: Elena Kolevska <[email protected]> * fixes linter Signed-off-by: Elena Kolevska <[email protected]> * Apply suggestions from code review Signed-off-by: Elena Kolevska <[email protected]> * Apply suggestions from code review Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Fabian Martinez <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Co-authored-by: Elena Kolevska <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
Signed-off-by: Elena Kolevska <[email protected]>
* Updates protos and fixes grpc-tools for protos generation Signed-off-by: Elena Kolevska <[email protected]> * bumps grpcio tools version Signed-off-by: Elena Kolevska <[email protected]> --------- Signed-off-by: Elena Kolevska <[email protected]>
85cdc62
to
73e5ac9
Compare
Description
Update durabletask dependency to use new dapr fork
Also implements support for purge API #711
Implements support for reuse id policy and set custom status from #739
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: