Skip to content

Commit

Permalink
feat(weaver): upgrade to corda 4.12 and jvm 17
Browse files Browse the repository at this point in the history
* upgrade gradle to 7.6.1
* upgrade to kotlin 1.9
* upgrade corda dependencies to 4.12 and java to 17
* update java to 17 for corda workflows
* generate corda 4.12 testnet artifacts
* use bootstrap-states.csv to init corda SimpleStates
* added FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED to free space on data-sharing-docker-local job

Signed-off-by: Sandeep Nishad <[email protected]>
  • Loading branch information
sandeepnRES committed Aug 14, 2024
1 parent 9fef336 commit 6d2d8db
Show file tree
Hide file tree
Showing 201 changed files with 2,879 additions and 1,632 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test_weaver-asset-exchange-corda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

# CORDA NETWORK
Expand Down Expand Up @@ -144,10 +144,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Build Java Protos
Expand Down Expand Up @@ -248,10 +248,10 @@ jobs:
- './weaver/**'
- '.github/workflows/test_weaver-asset-exchange-corda.yaml'
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

# CORDA NETWORK
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/test_weaver-asset-transfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -85,9 +85,7 @@ jobs:
working-directory: weaver/tests/network-setups/corda

- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start &> corda-net.out &
run: make start &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -695,10 +693,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -789,9 +787,7 @@ jobs:

# CORDA NETWORK
- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start-local &> corda-net.out &
run: make start-local &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_weaver-corda-interop-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Build Protos (Local)
Expand Down
40 changes: 18 additions & 22 deletions .github/workflows/test_weaver-data-sharing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -85,9 +85,7 @@ jobs:
working-directory: weaver/tests/network-setups/corda

- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start &> corda-net.out &
run: make start &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -244,11 +242,11 @@ jobs:
# CORDA2-CORDA
NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
# CORDA - FABRIC1
Expand Down Expand Up @@ -409,7 +407,9 @@ jobs:
data-sharing-docker-local:
needs: check_code_changed
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true'
# if: ${{ false }}
env:
FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false

# The type of runner that the job will run on
runs-on: ubuntu-22.04

Expand All @@ -426,10 +426,10 @@ jobs:
- './weaver/**'
- '.github/workflows/test_weaver-data-sharing.yaml'
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -505,9 +505,7 @@ jobs:
working-directory: weaver/core/identity-management/iin-agent

- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start-local &> corda-net.out &
run: make start-local &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -669,11 +667,11 @@ jobs:
# CORDA2-CORDA
NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
# CORDA - FABRIC1
Expand Down Expand Up @@ -851,10 +849,10 @@ jobs:
- './weaver/**'
- '.github/workflows/test_weaver-data-sharing.yaml'
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Set up Go
Expand Down Expand Up @@ -945,9 +943,7 @@ jobs:

# CORDA NETWORK
- name: Start Corda Network
run: |
sed -i "/docker logs corda_partya_1 -f/"' s/^/#/' "scripts/start-nodes.sh"
make start-local &> corda-net.out &
run: make start-local &> corda-net.out &
working-directory: weaver/tests/network-setups/corda

# FABRIC NETWORK
Expand Down Expand Up @@ -1097,11 +1093,11 @@ jobs:
# CORDA2-CORDA
NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=20" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS"
cat tmp.out
# CORDA - FABRIC1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_weaver-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Build Protos (Local)
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test_weaver-fabric-fabric-satp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
uses: actions/[email protected]
with:
java-version: '8'
distribution: 'adopt'

- name: Set up Go
uses: actions/[email protected]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/weaver_deploy_corda-pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Generate github.properties
Expand Down Expand Up @@ -60,10 +60,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Generate github.properties
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '8'
java-version: '17'
distribution: 'adopt'

- name: Generate github.properties
Expand Down
42 changes: 27 additions & 15 deletions weaver/common/protos-java-kt/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import static org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
import static org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9

buildscript {
ext.coroutines_version = "1.3.7"
ext.protobuf_version = "3.11.1"
ext.grpc_version = "1.29.0" // CURRENT_GRPC_VERSION
ext.grpc_kotlin_version = "0.1.4" // CURRENT_GRPC_KOTLIN_VERSION
ext.kotlin_version = "1.4.32"
ext.coroutines_version = "1.8.1"
ext.protobuf_version = "3.25.3"
ext.grpc_version = "1.65.0" // CURRENT_GRPC_VERSION
ext.grpc_kotlin_version = "1.4.1" // CURRENT_GRPC_KOTLIN_VERSION
ext.kotlin_version = "1.9.23"

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand All @@ -15,29 +18,37 @@ buildscript {
plugins {
id "maven-publish"
id 'java'
id 'com.google.protobuf' version '0.8.12'
id 'com.google.protobuf' version '0.9.4'
id 'idea'
}

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://repo1.maven.org/maven2' }
maven { url 'https://download.corda.net/maven/corda-dependencies/' }
maven { url 'https://jitpack.io' }
}

apply plugin: 'kotlin'

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
languageVersion = "1.3"
apiVersion = "1.3"
jvmTarget = "1.8"
compilerOptions {
languageVersion = KOTLIN_1_9
apiVersion = KOTLIN_1_9
jvmTarget = JVM_17
javaParameters = true // Useful for reflection.
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

compileJava {
options.compilerArgs << '-parameters'
}

jar {
// This makes the JAR's SHA-256 hash repeatable.
preserveFileTimestamps = false
Expand All @@ -55,17 +66,18 @@ sourceSets {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "io.grpc:grpc-kotlin-stub:$grpc_kotlin_version"
compile "com.google.protobuf:protobuf-java:$protobuf_version"
implementation "com.google.protobuf:protobuf-java:$protobuf_version"
implementation "com.google.protobuf:protobuf-java-util:$protobuf_version"
implementation "io.grpc:grpc-netty-shaded:$grpc_version"
implementation "io.grpc:grpc-protobuf:$grpc_version"
implementation "io.grpc:grpc-stub:$grpc_version"
implementation 'javax.annotation:javax.annotation-api:1.3.2'
compileOnly 'org.apache.tomcat:annotations-api:6.0.53' // necessary for Java 9+

}

Expand All @@ -78,7 +90,7 @@ protobuf {
}
// Specify protoc to generate using our grpc kotlin plugin
grpckt {
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpc_kotlin_version"
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpc_kotlin_version:jdk8@jar"
}
}
generateProtoTasks {
Expand Down
Binary file modified weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6d2d8db

Please sign in to comment.