-
Notifications
You must be signed in to change notification settings - Fork 16
DTS Support #201
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
Merged
Merged
DTS Support #201
Changes from 11 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
51d210f
Add gradle task to update submodule and update proto to latest version
YunchuWang 8660f1b
bump build pipeline github action version to non deprecated version
YunchuWang 8a54ce4
initial dts support changes
YunchuWang f951428
placeholder
YunchuWang 12e9e50
ignore
YunchuWang 3b09d59
update
YunchuWang 32eca1e
remove
YunchuWang ea2e181
update
YunchuWang e025538
update
YunchuWang 6ea3a65
update
YunchuWang 2270ed2
signing is disabled, should not exclude as there is no sign
YunchuWang 9a02b23
save
YunchuWang 8fb193f
feedback changes
YunchuWang a51ba86
delete legacy lib/java
YunchuWang 7241e34
create skeleton project for pkg "com.microsoft.durabletask-azuremanaged"
YunchuWang 8688320
split pkg in progress
YunchuWang 628c093
move out
YunchuWang a7e8d19
progress
YunchuWang ab89785
p
YunchuWang 6fc0748
progress
YunchuWang e3406d7
progress
YunchuWang 110306e
fix
YunchuWang b7a88af
p
YunchuWang 1b7fe1c
save
YunchuWang b74d699
save
YunchuWang f6611af
save
YunchuWang 03df094
save
YunchuWang 3cd3598
clientoptions done
YunchuWang 357ecdd
client ext
YunchuWang df4a0e4
client refactored
YunchuWang 0f79297
worker done
YunchuWang c7eb4f1
sample update
YunchuWang aa94d9c
fix
YunchuWang 02f92ea
save
YunchuWang 2b9d8eb
fix
YunchuWang 3eca075
cleanup
YunchuWang 6e9a6e8
cleanup
YunchuWang 2f2a359
Merge branch 'main' into wangbill/update-proto
YunchuWang 41ef360
Merge branch 'main' into wangbill/update-proto
YunchuWang d9e20ec
unit tests
YunchuWang f59af6b
Update Gradle build command to include stacktrace option for better d…
YunchuWang f7c5376
cleanup
YunchuWang 538033c
Enhance build validation workflow to handle build failures by uploadi…
YunchuWang bb1fbb1
Update PATH_TO_TEST_JAVA_RUNTIME in build.gradle files to use environ…
YunchuWang 637863c
Revert "Update PATH_TO_TEST_JAVA_RUNTIME in build.gradle files to use…
YunchuWang 8d530cb
separate build and unit tests
YunchuWang 5f3ebfb
use jdk11 for unit tests
YunchuWang 02ec66d
update sample
YunchuWang f23edcc
clean up
YunchuWang 299ab73
rename azuremanaged module names to avoid colliding module names name…
YunchuWang 8cf6cdb
update azure managed to one package
YunchuWang 1bebf5a
conn str support
YunchuWang 98cf7eb
changelog
YunchuWang 8705055
Add support for Visual Studio Code and Interactive Browser authentica…
YunchuWang ad72eca
Add support for IntelliJ authentication type in DurableTaskSchedulerC…
YunchuWang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ pool: | |
|
|
||
| steps: | ||
| - checkout: self | ||
| submodules: true | ||
|
|
||
| - task: Gradle@3 | ||
| inputs: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
client/src/main/java/com/microsoft/durabletask/AccessTokenCache.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package com.microsoft.durabletask; | ||
YunchuWang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| import com.azure.core.credential.TokenCredential; | ||
| import com.azure.core.credential.AccessToken; | ||
| import com.azure.core.credential.TokenRequestContext; | ||
|
|
||
| import java.time.Duration; | ||
| import java.time.OffsetDateTime; | ||
|
|
||
| public final class AccessTokenCache { | ||
| private final TokenCredential credential; | ||
| private final TokenRequestContext context; | ||
| private final Duration margin; | ||
| private AccessToken cachedToken; | ||
|
|
||
| public AccessTokenCache(TokenCredential credential, TokenRequestContext context, Duration margin) { | ||
| this.credential = credential; | ||
| this.context = context; | ||
| this.margin = margin; | ||
| } | ||
|
|
||
| public AccessToken getToken() { | ||
| OffsetDateTime nowWithMargin = OffsetDateTime.now().plus(margin); | ||
|
|
||
| if (cachedToken == null | ||
| || cachedToken.getExpiresAt().isBefore(nowWithMargin)) { | ||
| this.cachedToken = credential.getToken(context).block(); | ||
| } | ||
|
|
||
| return cachedToken; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ jobs: | |
|
|
||
| steps: | ||
| - checkout: self | ||
| submodules: true | ||
|
|
||
| - task: Gradle@3 | ||
| inputs: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
YunchuWang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Copyright (c) Microsoft Corporation. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 443b333f4f65a438dc9eb4f090560d232afec4b7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Durable Task Protobuf Files | ||
|
|
||
| This directory contains the protocol buffer definitions used by the Durable Task Framework Java SDK. The files in this directory are automatically downloaded and updated during the build process from the [microsoft/durabletask-protobuf](https://github.com/microsoft/durabletask-protobuf) repository. | ||
|
|
||
| ## Directory Structure | ||
|
|
||
| - `protos/` - Contains the downloaded proto files | ||
| - `PROTO_SOURCE_COMMIT_HASH` - Contains the commit hash of the latest proto file version | ||
|
|
||
| ## Auto-Update Process | ||
|
|
||
| The proto files are automatically downloaded and updated when running Gradle builds. This is handled by the `downloadProtoFiles` task in the `client/build.gradle` file. The task: | ||
|
|
||
| 1. Downloads the latest version of `orchestrator_service.proto` | ||
| 2. Saves the current commit hash for tracking purposes | ||
| 3. Updates these files before proto compilation begins | ||
|
|
||
| ## Manual Update | ||
|
|
||
| If you need to manually update the proto files, you can run: | ||
|
|
||
| ```bash | ||
| ./gradlew downloadProtoFiles | ||
YunchuWang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| # Durable Task Protobuf Definitions | ||
YunchuWang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| This repo contains [protocol buffer](https://developers.google.com/protocol-buffers) (protobuf) definitions | ||
| used by the Durable Task framework sidecar architecture. It's recommended that Durable Task language SDKs reference | ||
| the protobuf contracts in this repo via [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules). | ||
|
|
||
| ## Contributing | ||
|
|
||
| This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
| Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us | ||
| the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. | ||
|
|
||
| When you submit a pull request, a CLA bot will automatically determine whether you need to provide | ||
| a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions | ||
| provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
|
||
| This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
| For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
| contact [[email protected]](mailto:[email protected]) with any additional questions or comments. | ||
|
|
||
| ## Trademarks | ||
|
|
||
| This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft | ||
| trademarks or logos is subject to and must follow | ||
| [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). | ||
| Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. | ||
| Any use of third-party trademarks or logos are subject to those third-party's policies. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # | ||
| # https://help.github.com/articles/dealing-with-line-endings/ | ||
| # | ||
| # These are explicitly windows files and should use crlf | ||
| *.bat text eol=crlf | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Ignore Gradle project-specific cache directory | ||
| .gradle | ||
|
|
||
| # Ignore Gradle build output directory | ||
| build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| plugins { | ||
| id 'com.google.protobuf' version '0.8.16' | ||
| id 'java-library' | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| version = '0.1.0' | ||
| archivesBaseName = 'durabletask-grpc' | ||
YunchuWang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| sourceCompatibility = 1.8 | ||
| targetCompatibility = 1.8 | ||
|
|
||
| def grpcVersion = '1.46.0' | ||
| def protobufVersion = '3.12.0' | ||
| def protocVersion = protobufVersion | ||
|
|
||
| dependencies { | ||
| implementation "io.grpc:grpc-protobuf:${grpcVersion}" | ||
| implementation "io.grpc:grpc-stub:${grpcVersion}" | ||
| compileOnly "org.apache.tomcat:annotations-api:6.0.53" | ||
|
|
||
| runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}" | ||
|
|
||
| testImplementation "io.grpc:grpc-testing:${grpcVersion}" | ||
| testImplementation "junit:junit:4.12" | ||
| testImplementation "org.mockito:mockito-core:3.4.0" | ||
| } | ||
|
|
||
| protobuf { | ||
| protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" } | ||
| plugins { | ||
| grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" } | ||
| } | ||
| generateProtoTasks { | ||
| all()*.plugins { grpc {} } | ||
| } | ||
| } | ||
|
|
||
| sourceSets { | ||
| main { | ||
| proto { | ||
| srcDir '../../protos' | ||
| } | ||
| java { | ||
| srcDirs 'build/generated/source/proto/main/grpc' | ||
| srcDirs 'build/generated/source/proto/main/java' | ||
| } | ||
| } | ||
| } | ||
Binary file added
BIN
+57.8 KB
internal/durabletask-protobuf/lib/java/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
internal/durabletask-protobuf/lib/java/gradle/wrapper/gradle-wrapper.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.