Skip to content

Commit e675b35

Browse files
authored
Adding large payload support for the standalone SDK (#280)
1 parent b546be9 commit e675b35

24 files changed

Lines changed: 5477 additions & 2 deletions

.github/workflows/build-validation.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,43 @@ jobs:
9494
# Give additional time for gRPC service to fully initialize after port is open
9595
sleep 5
9696
97+
- name: Initialize Azurite (Azure Blob Storage Emulator)
98+
run: docker run --name azurite -p 10000:10000 -d mcr.microsoft.com/azure-storage/azurite azurite-blob --blobHost 0.0.0.0
99+
100+
- name: Wait for Azurite to be ready
101+
run: |
102+
echo "Waiting for Azurite to be ready on port 10000..."
103+
MAX_WAIT_SECONDS=60
104+
attempt=0
105+
while ! (echo > /dev/tcp/localhost/10000) 2>/dev/null; do
106+
attempt=$((attempt + 1))
107+
if [ $attempt -ge $MAX_WAIT_SECONDS ]; then
108+
echo "ERROR: Azurite not ready after $MAX_WAIT_SECONDS seconds"
109+
echo "Docker container status:"
110+
docker ps -a
111+
echo "Container logs:"
112+
docker logs azurite 2>&1 | tail -50
113+
exit 1
114+
fi
115+
echo "Attempt $attempt/$MAX_WAIT_SECONDS - waiting for Azurite..."
116+
sleep 1
117+
done
118+
echo "Azurite is ready on port 10000"
119+
97120
- name: Integration Tests with Gradle
98121
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
99122
continue-on-error: true
100123

101124
- name: Kill Durable Task Emulator
125+
if: always()
102126
run: docker kill durabletask-emulator
127+
128+
- name: Kill Azurite
129+
if: always()
130+
run: docker kill azurite
103131

104132
- name: Upload Durable Task Emulator Logs
133+
if: always()
105134
uses: actions/upload-artifact@v4
106135
with:
107136
name: Durable Task Emulator Logs

azure-blob-payloads/build.gradle

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
id 'signing'
5+
id 'com.github.spotbugs' version '6.4.8'
6+
}
7+
8+
group 'com.microsoft'
9+
version = '1.8.0'
10+
archivesBaseName = 'durabletask-azure-blob-payloads'
11+
12+
def grpcVersion = '1.78.0'
13+
def azureCoreVersion = '1.57.1'
14+
def azureStorageBlobVersion = '12.29.1'
15+
16+
// Java 11 is used to compile and run all tests. Set the JDK_11 env var to your
17+
// local JDK 11 home directory, e.g. C:/Program Files/Java/openjdk-11.0.12_7/
18+
// If unset, falls back to the current JDK running Gradle.
19+
def rawJdkPath = System.env.JDK_11 ?: System.getProperty("java.home")
20+
def PATH_TO_TEST_JAVA_RUNTIME = rawJdkPath
21+
if (rawJdkPath != null) {
22+
def f = new File(rawJdkPath)
23+
if (f.isFile()) {
24+
PATH_TO_TEST_JAVA_RUNTIME = f.parentFile.parentFile.absolutePath
25+
}
26+
}
27+
def isWindows = System.getProperty("os.name").toLowerCase().contains("win")
28+
def exeSuffix = isWindows ? ".exe" : ""
29+
30+
dependencies {
31+
api project(':client')
32+
33+
// Azure Storage Blobs
34+
implementation "com.azure:azure-storage-blob:${azureStorageBlobVersion}"
35+
36+
// TokenCredential abstraction (from azure-core) — 'api' because
37+
// LargePayloadStorageOptions exposes TokenCredential in its public API.
38+
api "com.azure:azure-core:${azureCoreVersion}"
39+
40+
// gRPC interceptor API
41+
implementation "io.grpc:grpc-api:${grpcVersion}"
42+
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
43+
implementation "io.grpc:grpc-stub:${grpcVersion}"
44+
45+
// NOTE: azure-identity is NOT included here. Users who need
46+
// DefaultAzureCredential should add it to their own project.
47+
48+
testImplementation 'org.mockito:mockito-core:5.21.0'
49+
testImplementation 'org.mockito:mockito-junit-jupiter:5.21.0'
50+
testImplementation project(':azuremanaged')
51+
}
52+
53+
compileJava {
54+
sourceCompatibility = JavaVersion.VERSION_1_8
55+
targetCompatibility = JavaVersion.VERSION_1_8
56+
}
57+
compileTestJava {
58+
sourceCompatibility = JavaVersion.VERSION_11
59+
targetCompatibility = JavaVersion.VERSION_11
60+
options.fork = true
61+
options.forkOptions.executable = "${PATH_TO_TEST_JAVA_RUNTIME}/bin/javac${exeSuffix}"
62+
}
63+
64+
tasks.withType(Test) {
65+
executable = new File("${PATH_TO_TEST_JAVA_RUNTIME}", "bin/java${exeSuffix}")
66+
}
67+
68+
test {
69+
useJUnitPlatform {
70+
// Skip tests tagged as "integration" since those require
71+
// external dependencies (DTS emulator + Azurite).
72+
excludeTags "integration"
73+
}
74+
}
75+
76+
// Integration tests require DTS emulator (default localhost:4001) and Azurite on localhost:10000.
77+
task integrationTest(type: Test) {
78+
useJUnitPlatform {
79+
includeTags 'integration'
80+
}
81+
dependsOn build
82+
shouldRunAfter test
83+
testLogging.showStandardStreams = true
84+
ignoreFailures = false
85+
}
86+
87+
spotbugs {
88+
toolVersion = '4.9.8'
89+
effort = com.github.spotbugs.snom.Effort.valueOf('MAX')
90+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH')
91+
ignoreFailures = true
92+
excludeFilter = file('spotbugs-exclude.xml')
93+
}
94+
95+
spotbugsMain {
96+
reports {
97+
html {
98+
required = true
99+
stylesheet = 'fancy-hist.xsl'
100+
}
101+
xml {
102+
required = true
103+
}
104+
}
105+
}
106+
107+
spotbugsTest {
108+
reports {
109+
html {
110+
required = true
111+
stylesheet = 'fancy-hist.xsl'
112+
}
113+
xml {
114+
required = true
115+
}
116+
}
117+
}
118+
119+
publishing {
120+
repositories {
121+
maven {
122+
url "file://$project.rootDir/repo"
123+
}
124+
}
125+
publications {
126+
mavenJava(MavenPublication) {
127+
from components.java
128+
artifactId = archivesBaseName
129+
pom {
130+
name = 'Durable Task Azure Blob Payloads for Java'
131+
description = 'This package provides externalized payload storage using Azure Blob Storage for the Durable Task Java SDK.'
132+
url = "https://github.com/microsoft/durabletask-java/tree/main/azure-blob-payloads"
133+
licenses {
134+
license {
135+
name = "MIT License"
136+
url = "https://opensource.org/licenses/MIT"
137+
distribution = "repo"
138+
}
139+
}
140+
developers {
141+
developer {
142+
id = "Microsoft"
143+
name = "Microsoft Corporation"
144+
}
145+
}
146+
scm {
147+
connection = "scm:git:https://github.com/microsoft/durabletask-java"
148+
developerConnection = "scm:git:git@github.com:microsoft/durabletask-java"
149+
url = "https://github.com/microsoft/durabletask-java/tree/main/azure-blob-payloads"
150+
}
151+
withXml {
152+
project.configurations.compileOnly.allDependencies.each { dependency ->
153+
asNode().dependencies[0].appendNode("dependency").with {
154+
it.appendNode("groupId", dependency.group)
155+
it.appendNode("artifactId", dependency.name)
156+
it.appendNode("version", dependency.version)
157+
it.appendNode("scope", "provided")
158+
}
159+
}
160+
}
161+
}
162+
}
163+
}
164+
}
165+
166+
signing {
167+
required = !project.hasProperty("skipSigning")
168+
sign publishing.publications.mavenJava
169+
}
170+
171+
java {
172+
withSourcesJar()
173+
withJavadocJar()
174+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
<!-- Exclude test classes -->
4+
<Match>
5+
<Class name="~.*Test"/>
6+
</Match>
7+
8+
<!-- Exclude common false positives -->
9+
<Match>
10+
<BugPattern name="DM_CONVERT_CASE"/>
11+
</Match>
12+
13+
<!-- Exclude serialization related warnings -->
14+
<Match>
15+
<BugPattern name="SE_NO_SERIALVERSIONID"/>
16+
</Match>
17+
</FindBugsFilter>

0 commit comments

Comments
 (0)