Skip to content

Conversation

@RyanLettieri
Copy link
Contributor

@RyanLettieri RyanLettieri commented Jan 22, 2025

This PR adds in the completion token to the worker.py class for DTS to understand when a task or work item is complete.

This PR also adds in an example of using the DTS backend and updates the README to reflect the necessary steps

Signed-off-by: Ryan Lettieri <67934986+RyanLettieri@users.noreply.github.com>
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

The code changes look good, though I have feedback on the sample and README.

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Copy link
Member

@torosent torosent left a comment

Choose a reason for hiding this comment

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

Please add pip install azure-identity

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
@RyanLettieri RyanLettieri force-pushed the durabletask-scheduler branch from 05af892 to 6050771 Compare January 28, 2025 18:00
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

Haven't finished reviewing the whole thing yet, but have some fairly significant feedback for what I've reviewed so far.

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

The updated design is looking great. A few technical things that we still need to clean up. I haven't reviewed everything quite yet, though.

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

I think we're super close. A few more things to clean up.

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

Looks like the tests are failing, but just a couple more things in addition to that.

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
RyanLettieri and others added 4 commits February 13, 2025 15:50
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

OK, changes look good. I'll sign off after doing some local validation. I may add another commit as well depending on how things go.

Copy link
Member

@torosent torosent left a comment

Choose a reason for hiding this comment

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

LGTM

@berndverst
Copy link
Member

berndverst commented Feb 14, 2025

EDIT: Never mind - I see the pyproject is nested. All good there.

But it feels weird to have a top level pyproject and then another pyproject somewhere in a nested folder. Maybe we could consider rearranging that structure in the future.

@berndverst
Copy link
Member

berndverst commented Feb 14, 2025

durabletask/azuremanaged/internal/access_token_manager.py:28: error: Incompatible types in assignment (expression has type "None", variable has type "datetime")  [assignment]

While this is not strictly necessary - it may be a good idea to use type hints throughout. For example here we have an attribute that has a datetime but also None assigned to it. I ran mypy for type checking which produced the error. So if we were to introduce types (which can help make debugging and reasoning about core correctness easier) we should make this Optional[Datetime].

For now since you don't have any typing at other than the method signature (and neither does durabletask itself) - you can ignore this.

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
@RyanLettieri RyanLettieri merged commit 151308a into microsoft:main Feb 18, 2025
6 checks passed
@RyanLettieri RyanLettieri deleted the durabletask-scheduler branch February 18, 2025 22:46
acroca pushed a commit to acroca/dapr-durabletask-python that referenced this pull request Jun 17, 2025
* Creation of DTS example and passing of completionToken

Signed-off-by: Ryan Lettieri <67934986+RyanLettieri@users.noreply.github.com>

* Adressing review feedback

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Reverting dapr readme

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding accessTokenManager class for refreshing credential token

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding comments to the example

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding in requirement for azure-identity

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Moving dts logic into its own module

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing whitesapce

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Updating dts client to refresh token

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Cleaning up construction of dts objects and improving examples

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Migrating shared access token logic to new grpc class

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding log statements to access_token_manager

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* breaking for loop when setting interceptors

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Removing changes to client.py and adding additional steps to readme.md

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Refactoring client and worker to pass around interceptors

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing import for DefaultClientInterceptorImpl

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adressing round 1 of feedback

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing interceptor issue

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Moving some files around to remove dependencies

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adressing more feedback

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* More review feedback

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Passing token credential as an argument rather than 2 strings

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* More review feedback for token passing

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Addressing None comment and using correct metadata

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Updating unit tests

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing the type for the unit test

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fixing grpc calls

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Fix linter errors and update documentation

* Specifying version reqiuirement for pyproject.toml

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Updating README

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

* Adding comment for credential type

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>

---------

Signed-off-by: Ryan Lettieri <67934986+RyanLettieri@users.noreply.github.com>
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
Co-authored-by: Chris Gillum <cgillum@microsoft.com>
Signed-off-by: Albert Callarisa <albert@diagrid.io>
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.

4 participants