Skip to content

Commit b593f63

Browse files
fix ci slop
various slop before making the point of the situation slop slop Bump native state machine version, also update how code is organized there Various CI bumps/changes Fix caching of rust, make sure we send system out/system err correctly, disable macos x86 Increasing the timeout, let's give this a try Fix matrix in native.yaml Remove some slop from the interface rust <-> java Trivial optimizations on copies Shared core support using Panama (only Java 23+) This includes bumping kotlin to 2.3 and dokka to 2.2
1 parent a7cc8be commit b593f63

86 files changed

Lines changed: 6920 additions & 1059 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bump.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
name: Bump release version
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- name: Install dasel
1616
run: curl -sSLf "$(curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest | grep browser_download_url | grep linux_amd64 | grep -v .gz | cut -d\" -f 4)" -L -o dasel && chmod +x dasel && mv ./dasel /usr/local/bin/dasel
1717
- name: Bump version overwriting libs.versions.toml
1818
run: dasel -f gradle/libs.versions.toml put -t string -v "${{ github.event.inputs.version }}" ".versions.restate"
1919
- name: Create version bump PR
20-
uses: peter-evans/create-pull-request@v3
20+
uses: peter-evans/create-pull-request@v8
2121
with:
2222
title: "[Release] Bump to ${{ github.event.inputs.version }}"
2323
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dependency-submission.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout sources
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616
- name: Setup Java
17-
uses: actions/setup-java@v4
17+
uses: actions/setup-java@v5
1818
with:
1919
distribution: 'temurin'
20-
java-version: 17
20+
java-version: 25
21+
- name: Install Rust toolchain
22+
uses: actions-rust-lang/setup-rust-toolchain@v1
23+
with:
24+
cache-workspaces: sdk-core/src/main/rust
2125
- name: Generate and submit dependency graph
22-
uses: gradle/actions/dependency-submission@v4
26+
uses: gradle/actions/dependency-submission@v6

.github/workflows/docker.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,48 @@ jobs:
1616
sdk-test-docker:
1717
if: github.repository_owner == 'restatedev'
1818
runs-on: warp-ubuntu-latest-x64-4x
19-
name: "Create test-services Docker Image"
20-
19+
name: "Create test-services Docker Image (JRE ${{ matrix.jreVersion }})"
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
# 17 & 21 -> pure-Java state machine (17 also published as :main); 25 -> Panama/FFM state machine.
24+
jreVersion: [ 17, 21, 25 ]
25+
2126
steps:
22-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
2328
with:
2429
repository: restatedev/sdk-java
2530

2631
- name: Setup Java
27-
uses: actions/setup-java@v4
32+
uses: actions/setup-java@v5
2833
with:
2934
distribution: 'temurin'
30-
java-version: '21'
35+
java-version: '25'
3136

3237
- name: Setup Gradle
33-
uses: gradle/actions/setup-gradle@v4
38+
uses: gradle/actions/setup-gradle@v6
39+
40+
- name: Install Rust toolchain
41+
uses: actions-rust-lang/setup-rust-toolchain@v1
42+
with:
43+
cache-workspaces: sdk-core/src/main/rust
3444

3545
- name: Log into GitHub container registry
36-
uses: docker/login-action@v2
46+
uses: docker/login-action@v4
3747
with:
3848
registry: ${{ env.GHCR_REGISTRY }}
3949
username: ${{ env.GHCR_REGISTRY_USERNAME }}
4050
password: ${{ env.GHCR_REGISTRY_TOKEN }}
4151

42-
- name: Build restatedev/test-services-java image
43-
run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild
52+
- name: Build restatedev/test-services-java image (JRE ${{ matrix.jreVersion }})
53+
run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild -PtestServicesJre=${{ matrix.jreVersion }}
4454

45-
- name: Push restatedev/test-services-java:main image
55+
- name: Push restatedev/test-services-java image
4656
run: |
47-
docker tag restatedev/test-services-java ghcr.io/restatedev/test-services-java:main
48-
docker push ghcr.io/restatedev/test-services-java:main
57+
docker tag restatedev/test-services-java ghcr.io/restatedev/test-services-java:main-jre${{ matrix.jreVersion }}
58+
docker push ghcr.io/restatedev/test-services-java:main-jre${{ matrix.jreVersion }}
59+
# The minimum-Java (pure-Java state machine) image is also the default :main tag.
60+
if [ "${{ matrix.jreVersion }}" = "17" ]; then
61+
docker tag restatedev/test-services-java ghcr.io/restatedev/test-services-java:main
62+
docker push ghcr.io/restatedev/test-services-java:main
63+
fi

.github/workflows/integration.yaml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ jobs:
6262
sdk-test-suite:
6363
if: github.repository_owner == 'restatedev'
6464
runs-on: warp-ubuntu-latest-x64-4x
65-
name: "Features integration test"
65+
name: "Features integration test (JRE ${{ matrix.jreVersion }})"
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
# 17 & 21 exercise the pure-Java state machine; 25 activates the Panama/FFM state machine.
70+
# When an external serviceImage is supplied, the build is skipped and both entries run it.
71+
jreVersion: [ 17, 21, 25 ]
6672
permissions:
6773
contents: read
6874
issues: read
@@ -71,12 +77,12 @@ jobs:
7177
actions: read
7278

7379
steps:
74-
- uses: actions/checkout@v4
80+
- uses: actions/checkout@v6
7581
with:
7682
repository: restatedev/sdk-java
7783

7884
- name: Set up Docker containerd snapshotter
79-
uses: docker/setup-docker-action@v4
85+
uses: docker/setup-docker-action@v5
8086
with:
8187
version: "v28.5.2"
8288
set-host: true
@@ -93,13 +99,13 @@ jobs:
9399
# We must use download-artifact to get artifacts created during *this* workflow run, ie by workflow call
94100
- name: Download restate snapshot from in-progress workflow
95101
if: ${{ inputs.restateCommit != '' && github.event_name != 'workflow_dispatch' }}
96-
uses: actions/download-artifact@v4
102+
uses: actions/download-artifact@v8
97103
with:
98104
name: restate.tar
99105
# In the workflow dispatch case where the artifact was created in a previous run, we can download as normal
100106
- name: Download restate snapshot from completed workflow
101107
if: ${{ inputs.restateCommit != '' && github.event_name == 'workflow_dispatch' }}
102-
uses: dawidd6/action-download-artifact@v3
108+
uses: dawidd6/action-download-artifact@v21
103109
with:
104110
repo: restatedev/restate
105111
workflow: ci.yml
@@ -114,18 +120,24 @@ jobs:
114120
115121
- name: Setup Java
116122
if: ${{ inputs.serviceImage == '' }}
117-
uses: actions/setup-java@v4
123+
uses: actions/setup-java@v5
118124
with:
119125
distribution: 'temurin'
120-
java-version: '21'
126+
java-version: '25'
121127

122128
- name: Setup Gradle
123129
if: ${{ inputs.serviceImage == '' }}
124-
uses: gradle/actions/setup-gradle@v4
130+
uses: gradle/actions/setup-gradle@v6
131+
132+
- name: Install Rust toolchain
133+
if: ${{ inputs.serviceImage == '' }}
134+
uses: actions-rust-lang/setup-rust-toolchain@v1
135+
with:
136+
cache-workspaces: sdk-core/src/main/rust
125137

126138
- name: Build restatedev/test-services-java image
127139
if: ${{ inputs.serviceImage == '' }}
128-
run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild
140+
run: ./gradlew -Djib.console=plain :test-services:jibDockerBuild -PtestServicesJre=${{ matrix.jreVersion }}
129141

130142
# Pre-emptively pull the test-services image to avoid affecting execution time
131143
- name: Pull test services image
@@ -135,9 +147,9 @@ jobs:
135147

136148
- name: Run test tool
137149
continue-on-error: ${{ inputs.continueOnError == 'true' }}
138-
uses: restatedev/e2e/sdk-tests@v1.0
150+
uses: restatedev/e2e/sdk-tests@v2.1
139151
with:
140152
envVars: ${{ inputs.envVars }}
141-
testArtifactOutput: ${{ inputs.testArtifactOutput != '' && inputs.testArtifactOutput || 'sdk-java-integration-test-report' }}
153+
testArtifactOutput: ${{ inputs.testArtifactOutput != '' && format('{0}-jre{1}', inputs.testArtifactOutput, matrix.jreVersion) || format('sdk-java-integration-test-report-jre{0}', matrix.jreVersion) }}
142154
restateContainerImage: ${{ inputs.restateCommit != '' && 'localhost/restatedev/restate-commit-download:latest' || (inputs.restateImage != '' && inputs.restateImage || 'ghcr.io/restatedev/restate:main') }}
143155
serviceContainerImage: ${{ inputs.serviceImage != '' && inputs.serviceImage || 'restatedev/test-services-java' }}

.github/workflows/native.yaml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Native build
2+
3+
# Cross-compiles the Rust shared-core wrapper (sdk-core/src/main/rust) for every supported
4+
# platform, smoke-tests the produced library, and uploads it as an artifact. The release pipeline
5+
# downloads these artifacts and overlays them into the single (uber) sdk-core jar.
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- 'sdk-core/src/main/rust/**'
11+
- '.github/workflows/native.yaml'
12+
workflow_dispatch:
13+
workflow_call:
14+
15+
jobs:
16+
build:
17+
name: "Build native (${{ matrix.target }})"
18+
runs-on: ${{ matrix.runner }}
19+
timeout-minutes: 30
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- target: x86_64-unknown-linux-gnu
25+
runner: ubuntu-latest
26+
cross: false
27+
rustflags: ""
28+
- target: aarch64-unknown-linux-gnu
29+
runner: ubuntu-latest
30+
cross: true
31+
rustflags: ""
32+
# musl is statically linked by default, which can't produce a cdylib (.so); disabling
33+
# crt-static makes the target dynamically linkable so the shared library can be built.
34+
- target: x86_64-unknown-linux-musl
35+
runner: ubuntu-latest
36+
cross: true
37+
rustflags: "-C target-feature=-crt-static"
38+
- target: aarch64-unknown-linux-musl
39+
runner: ubuntu-latest
40+
cross: true
41+
rustflags: "-C target-feature=-crt-static"
42+
# macOS runners are expensive; comment out the darwin targets to disable them.
43+
# x86_64 darwin disabled for now — re-enable if Intel Mac support is needed.
44+
# - target: x86_64-apple-darwin
45+
# runner: macos-13
46+
# cross: false
47+
# rustflags: ""
48+
- target: aarch64-apple-darwin
49+
runner: macos-14
50+
cross: false
51+
rustflags: ""
52+
steps:
53+
- uses: actions/checkout@v6
54+
55+
- name: Install Rust toolchain
56+
uses: actions-rust-lang/setup-rust-toolchain@v1
57+
with:
58+
target: ${{ matrix.target }}
59+
cache-workspaces: sdk-core/src/main/rust
60+
# Segment the cache per target. Otherwise all Linux targets share one cache, and the
61+
# native x86_64 job (host glibc 2.39) populates target/release/build with host-compiled
62+
# build-script/proc-macro binaries that the `cross` jobs then restore and try to run
63+
# inside the older cross container (glibc ~2.31) -> "GLIBC_2.39 not found", build fails.
64+
cache-key: ${{ matrix.target }}
65+
66+
- name: Install cross
67+
if: ${{ matrix.cross }}
68+
run: cargo install cross --git https://github.com/cross-rs/cross --locked
69+
70+
- name: Build cdylib
71+
working-directory: sdk-core/src/main/rust
72+
env:
73+
# `cross` forwards RUSTFLAGS into the build container.
74+
RUSTFLAGS: ${{ matrix.rustflags }}
75+
run: |
76+
if [ "${{ matrix.cross }}" = "true" ]; then
77+
cross build --release --target ${{ matrix.target }}
78+
else
79+
cargo build --release --target ${{ matrix.target }}
80+
fi
81+
82+
- name: Locate library
83+
id: lib
84+
working-directory: sdk-core/src/main/rust
85+
run: |
86+
dir="target/${{ matrix.target }}/release"
87+
file=$(ls "$dir"/librestate_sdk_core.so "$dir"/librestate_sdk_core.dylib 2>/dev/null | head -1)
88+
if [ -z "$file" ]; then echo "no library produced for ${{ matrix.target }}"; exit 1; fi
89+
echo "path=sdk-core/src/main/rust/$file" >> "$GITHUB_OUTPUT"
90+
echo "file=$file" >> "$GITHUB_OUTPUT"
91+
92+
- name: Smoke test (exported C symbols present)
93+
working-directory: sdk-core/src/main/rust
94+
run: |
95+
f="${{ steps.lib.outputs.file }}"
96+
# Linux uses `nm -D` (no symbol prefix); macOS uses `nm -gU` (leading underscore).
97+
if [ "$RUNNER_OS" = "macOS" ]; then list="nm -gU"; pre="_"; else list="nm -D"; pre=""; fi
98+
for sym in init vm_new vm_free free_buffer vm_sys_call vm_take_notification; do
99+
$list "$f" 2>/dev/null | grep -qE "[ ]${pre}${sym}$" || { echo "missing exported symbol: $sym"; exit 1; }
100+
done
101+
echo "All expected symbols present in $f"
102+
103+
- name: Upload native library
104+
uses: actions/upload-artifact@v7
105+
with:
106+
name: native-${{ matrix.target }}
107+
path: ${{ steps.lib.outputs.path }}
108+
if-no-files-found: error

.github/workflows/publish-test-results.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish test results
22

33
on:
44
workflow_run:
5-
workflows: [ "CI" ]
5+
workflows: [ "Tests" ]
66
types:
77
- completed
88

.github/workflows/release-docs.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,28 @@ jobs:
2424
runs-on: warp-ubuntu-latest-x64-4x
2525
timeout-minutes: 10
2626
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-java@v4
27+
- uses: actions/checkout@v6
28+
- uses: actions/setup-java@v5
2929
with:
3030
distribution: 'temurin'
31-
java-version: '21'
31+
java-version: '25'
3232
- name: Setup Gradle
33-
uses: gradle/actions/setup-gradle@v4
33+
uses: gradle/actions/setup-gradle@v6
34+
- name: Install Rust toolchain
35+
uses: actions-rust-lang/setup-rust-toolchain@v1
36+
with:
37+
cache-workspaces: sdk-core/src/main/rust
3438

3539
- name: Build Javadocs
3640
run: gradle :sdk-aggregated-javadocs:javadoc
3741
- name: Build Kotlin docs
38-
run: gradle :dokkaHtmlMultiModule
42+
run: gradle :dokkaGenerate
3943

4044
- name: Move stuff around
41-
run: mkdir _site && mv ./sdk-aggregated-javadocs/build/docs/javadoc _site/javadocs && mv ./build/dokka/htmlMultiModule _site/ktdocs
45+
run: mkdir _site && mv ./sdk-aggregated-javadocs/build/docs/javadoc _site/javadocs && mv ./build/dokka/html _site/ktdocs
4246

4347
- name: Upload artifact
44-
uses: actions/upload-pages-artifact@v3
48+
uses: actions/upload-pages-artifact@v5
4549

4650
# Deployment job
4751
deploy:
@@ -53,4 +57,4 @@ jobs:
5357
steps:
5458
- name: Deploy to GitHub Pages
5559
id: deployment
56-
uses: actions/deploy-pages@v4
60+
uses: actions/deploy-pages@v5

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ jobs:
1010
runs-on: ubuntu-latest
1111
timeout-minutes: 20
1212
steps:
13-
- uses: actions/checkout@v4
14-
- name: Set up JDK ${{ matrix.java }}
15-
uses: actions/setup-java@v3
13+
- uses: actions/checkout@v6
14+
- name: Set up JDK 25
15+
uses: actions/setup-java@v5
1616
with:
17-
java-version: 17
18-
distribution: 'adopt'
17+
java-version: '25'
18+
distribution: 'temurin'
1919

2020
- name: Setup Gradle
21-
uses: gradle/actions/setup-gradle@v4
21+
uses: gradle/actions/setup-gradle@v6
22+
23+
- name: Install Rust toolchain
24+
uses: actions-rust-lang/setup-rust-toolchain@v1
25+
with:
26+
cache-workspaces: sdk-core/src/main/rust
2227

2328
# Retrieve the version of the SDK
2429
- name: Install dasel

0 commit comments

Comments
 (0)