Skip to content

Commit

Permalink
Merge pull request #5005 from corda/alex/DA5-15-recurring-merge-2
Browse files Browse the repository at this point in the history
# Changes
- Merge `release/os/5.1`
- Bump API version to 25
  • Loading branch information
ac101m authored Nov 7, 2023
2 parents 29f30b5 + 18a440f commit 47e942b
Show file tree
Hide file tree
Showing 374 changed files with 10,508 additions and 2,524 deletions.
25 changes: 15 additions & 10 deletions .ci/PublishHelmChart/Jenkinsfile_PublishHelmChart
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
#! groovy
@Library('[email protected]') _

import com.r3.build.agents.KubernetesAgent
import com.r3.build.enums.BuildEnvironment
import com.r3.build.enums.KubernetesCluster
import com.r3.build.utils.PublishingUtils

int cpus = 1
BuildEnvironment buildEnvironment = BuildEnvironment.AMD64_LINUX_JAVA17
/**
* Jenkins Kubernetes agent
*/
KubernetesAgent k8s = new KubernetesAgent(
BuildEnvironment.AMD64_LINUX_JAVA17,
KubernetesCluster.JenkinsAgents,
1
)

PublishingUtils publishingUtils = new PublishingUtils(this)

pipeline {
agent {
kubernetes {
cloud "eks-e2e"
yaml kubernetesBuildAgentYaml('build', buildEnvironment, cpus)
cloud k8s.buildCluster.cloudName
yaml k8s.JSON
yamlMergeStrategy merge() // important to keep tolerations from the inherited template
idleMinutes 15
podRetention always()
label ([
"gradle-build",
"${cpus}cpus",
"${buildEnvironment.jenkinsLabel}"
].join('-'))
nodeSelector k8s.nodeSelector
label k8s.jenkinsLabel
showRawYaml false
defaultContainer 'build'
defaultContainer k8s.defaultContainer.name
}
}

Expand Down
2 changes: 1 addition & 1 deletion .ci/e2eTests/JenkinsfileCombinedWorker
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pipeline {
REST_TLS_PATH = "${env.WORKSPACE}/applications/workers/release/combined-worker/tls/rest/rest_worker.pfx"
VM_PARAMETERS = "-Dco.paralleluniverse.fibers.verifyInstrumentation=true"
LOG4J_PARAMETERS = "-Dlog4j.configurationFile=log4j2-console.xml"
PROGRAM_PARAMETERS = "--instance-id=0 -mbus.busType=DATABASE -spassphrase=password -ssalt=salt -ddatabase.user=u${postgresDb} -ddatabase.pass=password -ddatabase.jdbc.url=jdbc:postgresql://${postgresHost}:${postgresPort}/${postgresDb} -ddatabase.jdbc.directory=${JDBC_PATH} -rtls.keystore.path=${REST_TLS_PATH} -rtls.keystore.password=mySecretPassword --serviceEndpoint=endpoints.crypto=localhost:7004 --serviceEndpoint=endpoints.verification=localhost:7004 --serviceEndpoint=endpoints.uniqueness=localhost:7004 --serviceEndpoint=endpoints.persistence=localhost:7004"
PROGRAM_PARAMETERS = "--instance-id=0 -mbus.busType=DATABASE -spassphrase=password -ssalt=salt -ddatabase.user=u${postgresDb} -ddatabase.pass=password -ddatabase.jdbc.url=jdbc:postgresql://${postgresHost}:${postgresPort}/${postgresDb} -ddatabase.jdbc.directory=${JDBC_PATH} -rtls.keystore.path=${REST_TLS_PATH} -rtls.keystore.password=mySecretPassword --serviceEndpoint=endpoints.crypto=localhost:7004 --serviceEndpoint=endpoints.verification=localhost:7004 --serviceEndpoint=endpoints.uniqueness=localhost:7004 --serviceEndpoint=endpoints.persistence=localhost:7004 --serviceEndpoint=endpoints.tokenSelection=localhost:7004"
WORKING_DIRECTORY = "${env.WORKSPACE}"
}
steps {
Expand Down
10 changes: 0 additions & 10 deletions .ci/e2eTests/JenkinsfileMultiClusterTest

This file was deleted.

49 changes: 49 additions & 0 deletions .ci/e2eTests/corda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ bootstrap:
valueFrom:
secretKeyRef:
key: "postgres-password"
stateManager:
flow:
username:
value: "state-manager-user"
password:
valueFrom:
secretKeyRef:
key: "password"
flowMapper:
username:
value: "state-manager-user"
password:
valueFrom:
secretKeyRef:
key: "password"
tokenSelection:
username:
value: "state-manager-user"
password:
valueFrom:
secretKeyRef:
key: "password"
kafka:
sasl:
username:
Expand Down Expand Up @@ -73,6 +95,15 @@ workers:
secretKeyRef:
name: "kafka-credentials"
key: "flow"
stateManager:
db:
name: state-manager
username:
value: "state-manager-user"
password:
valueFrom:
secretKeyRef:
key: "password"
flowMapper:
kafka:
sasl:
Expand All @@ -83,6 +114,15 @@ workers:
secretKeyRef:
name: "kafka-credentials"
key: "flowMapper"
stateManager:
db:
name: state-manager
username:
value: "state-manager-user"
password:
valueFrom:
secretKeyRef:
key: "password"
verification:
kafka:
sasl:
Expand Down Expand Up @@ -143,6 +183,15 @@ workers:
secretKeyRef:
name: "kafka-credentials"
key: "tokenSelection"
stateManager:
db:
name: state-manager
username:
value: "state-manager-user"
password:
valueFrom:
secretKeyRef:
key: "password"
rest:
kafka:
sasl:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
steps:
- uses: morrisoncole/[email protected]
with:
title-regex: '^((CORDA|EG|ENT|INFRA|CORE|DOC|ES)-\d+)(.*)'
title-regex: '^((CORDA|EG|ENT|INFRA|CORE|DOC|ES|DA5)-\d+)(.*)'
on-failed-regex-comment: "PR title failed to match regex -> `%regex%`"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
19 changes: 19 additions & 0 deletions .github/workflows/remove-stale-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Remove stale branches'
on:
schedule:
- cron: '0 0 * * 1-5'

jobs:
remove-stale-branches:
name: Remove stale branches
runs-on: ubuntu-latest
steps:
- uses: fpicalausa/[email protected]
with:
dry-run: true
days-before-branch-stale: 30
days-before-branch-delete: 14
stale-branch-message: "@{author} The branch [{branchName}]({branchUrl}) hasn't been updated in the last 30 days and is marked as stale. It will be removed in 14 days.\r\nIf you want to keep this branch around, delete this comment or add new commits to this branch."
exempt-protected-branches: true
exempt-branches-regex: "^(release\\/|feature\\/|poc\\/).*"
operations-per-run: 30
2 changes: 1 addition & 1 deletion .run/Combined Worker Local.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="Combined Worker Local" type="JarApplication">
<option name="JAR_PATH" value="$PROJECT_DIR$/applications/workers/release/combined-worker/build/bin/corda-combined-worker-5.1.0.0-SNAPSHOT.jar" />
<option name="VM_PARAMETERS" value="-Dco.paralleluniverse.fibers.verifyInstrumentation=true" />
<option name="PROGRAM_PARAMETERS" value="--instance-id=0 -mbus.busType=DATABASE -spassphrase=password -ssalt=salt -spassphrase=password -ssalt=salt -ddatabase.user=user -ddatabase.pass=password -ddatabase.jdbc.url=jdbc:postgresql://localhost:5432/cordacluster -ddatabase.jdbc.directory=$ProjectFileDir$/applications/workers/release/combined-worker/drivers -rtls.crt.path=$ProjectFileDir$/applications/workers/release/combined-worker/tls/rest/server.crt -rtls.key.path=$ProjectFileDir$/applications/workers/release/combined-worker/tls/rest/server.key -rtls.ca.crt.path=$ProjectFileDir$/applications/workers/release/combined-worker/tls/rest/ca-chain-bundle.crt --serviceEndpoint=endpoints.crypto=localhost:7004 --serviceEndpoint=endpoints.verification=localhost:7004 --serviceEndpoint=endpoints.uniqueness=localhost:7004 --serviceEndpoint=endpoints.persistence=localhost:7004" />
<option name="PROGRAM_PARAMETERS" value="--instance-id=0 -mbus.busType=DATABASE -spassphrase=password -ssalt=salt -spassphrase=password -ssalt=salt -ddatabase.user=user -ddatabase.pass=password -ddatabase.jdbc.url=jdbc:postgresql://localhost:5432/cordacluster -ddatabase.jdbc.directory=$ProjectFileDir$/applications/workers/release/combined-worker/drivers -rtls.crt.path=$ProjectFileDir$/applications/workers/release/combined-worker/tls/rest/server.crt -rtls.key.path=$ProjectFileDir$/applications/workers/release/combined-worker/tls/rest/server.key -rtls.ca.crt.path=$ProjectFileDir$/applications/workers/release/combined-worker/tls/rest/ca-chain-bundle.crt --serviceEndpoint=endpoints.crypto=localhost:7004 --serviceEndpoint=endpoints.verification=localhost:7004 --serviceEndpoint=endpoints.uniqueness=localhost:7004 --serviceEndpoint=endpoints.persistence=localhost:7004 --serviceEndpoint=endpoints.tokenSelection=localhost:7004" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
<option name="ALTERNATIVE_JRE_PATH" />
<method v="2">
Expand Down
1 change: 0 additions & 1 deletion applications/workers/release/db-worker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies {
// Processor list must be kept in sync with workersForProcessor in net.corda.cli.plugins.topicconfig.Create
implementation project(':processors:db-processor')
implementation project(':processors:scheduler-processor')
implementation project(':processors:token-cache-processor')
implementation 'org.jetbrains.kotlin:kotlin-osgi-bundle'
implementation "info.picocli:picocli:$picocliVersion"
implementation 'net.corda:corda-base'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import net.corda.osgi.api.Application
import net.corda.osgi.api.Shutdown
import net.corda.processors.db.DBProcessor
import net.corda.processors.scheduler.SchedulerProcessor
import net.corda.processors.token.cache.TokenCacheProcessor
import net.corda.schema.configuration.BootConfig.BOOT_DB
import net.corda.tracing.configureTracing
import net.corda.tracing.shutdownTracing
Expand All @@ -36,8 +35,6 @@ import picocli.CommandLine.Option
class DBWorker @Activate constructor(
@Reference(service = DBProcessor::class)
private val processor: DBProcessor,
@Reference(service = TokenCacheProcessor::class)
private val tokenCacheProcessor: TokenCacheProcessor,
@Reference(service = SchedulerProcessor::class)
private val schedulerProcessor: SchedulerProcessor,
@Reference(service = Shutdown::class)
Expand Down Expand Up @@ -69,7 +66,6 @@ class DBWorker @Activate constructor(

JavaSerialisationFilter.install()


val params = getParams(args, DBWorkerParams())

if (printHelpOrVersion(params.defaultParams, DBWorker::class.java, shutDownService)) return
Expand All @@ -86,15 +82,13 @@ class DBWorker @Activate constructor(
)
webServer.start(params.defaultParams.workerServerPort)
processor.start(config)
tokenCacheProcessor.start(config)
schedulerProcessor.start(config)
}

override fun shutdown() {
logger.info("DB worker stopping.")
processor.stop()
webServer.stop()
tokenCacheProcessor.stop()
schedulerProcessor.stop()
shutdownTracing()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class ConfigTests {
val dbWorker = DBWorker(
dbProcessor,
mock(),
mock(),
DummyShutdown(),
DummyLifecycleRegistry(),
DummyWebServer(),
Expand Down Expand Up @@ -99,7 +98,6 @@ class ConfigTests {
val dbWorker = DBWorker(
dbProcessor,
mock(),
mock(),
DummyShutdown(),
DummyLifecycleRegistry(),
DummyWebServer(),
Expand Down Expand Up @@ -133,7 +131,6 @@ class ConfigTests {
val dbWorker = DBWorker(
dbProcessor,
mock(),
mock(),
DummyShutdown(),
DummyLifecycleRegistry(),
DummyWebServer(),
Expand Down Expand Up @@ -166,7 +163,6 @@ class ConfigTests {
val dbWorker = DBWorker(
dbProcessor,
mock(),
mock(),
DummyShutdown(),
DummyLifecycleRegistry(),
DummyWebServer(),
Expand All @@ -193,7 +189,6 @@ class ConfigTests {
val dbWorker = DBWorker(
dbProcessor,
mock(),
mock(),
DummyShutdown(),
DummyLifecycleRegistry(),
DummyWebServer(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
implementation project(':libs:platform-info')
implementation project(':libs:tracing')
implementation project(':libs:web:web')
implementation project(':processors:token-cache-processor')
implementation 'org.jetbrains.kotlin:kotlin-osgi-bundle'
implementation "info.picocli:picocli:$picocliVersion"
implementation 'net.corda:corda-base'
Expand All @@ -36,6 +37,7 @@ dependencies {
runtimeOnly "org.osgi:org.osgi.util.function:$osgiUtilFunctionVersion"
runtimeOnly "org.osgi:org.osgi.util.promise:$osgiUtilPromiseVersion"

runtimeOnly project(':libs:messaging:kafka-message-bus-impl')
runtimeOnly project(':libs:tracing-impl')

testImplementation 'org.osgi:osgi.core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import net.corda.applications.workers.workercommon.DefaultWorkerParams
import net.corda.applications.workers.workercommon.Health
import net.corda.applications.workers.workercommon.JavaSerialisationFilter
import net.corda.applications.workers.workercommon.Metrics
import net.corda.applications.workers.workercommon.WorkerHelpers
import net.corda.applications.workers.workercommon.WorkerHelpers.Companion.getParams
import net.corda.applications.workers.workercommon.WorkerHelpers.Companion.loggerStartupInfo
import net.corda.applications.workers.workercommon.WorkerHelpers.Companion.printHelpOrVersion
Expand All @@ -14,6 +15,7 @@ import net.corda.libs.platform.PlatformInfoProvider
import net.corda.lifecycle.registry.LifecycleRegistry
import net.corda.osgi.api.Application
import net.corda.osgi.api.Shutdown
import net.corda.processors.token.cache.TokenCacheProcessor
import net.corda.schema.configuration.BootConfig
import net.corda.tracing.configureTracing
import net.corda.tracing.shutdownTracing
Expand Down Expand Up @@ -42,6 +44,8 @@ class TokenSelectionWorker @Activate constructor(
private val configurationValidatorFactory: ConfigurationValidatorFactory,
@Reference(service = SecretsServiceFactoryResolver::class)
val secretsServiceFactoryResolver: SecretsServiceFactoryResolver,
@Reference(service = TokenCacheProcessor::class)
private val tokenCacheProcessor: TokenCacheProcessor,
) : Application {

private companion object {
Expand All @@ -64,14 +68,21 @@ class TokenSelectionWorker @Activate constructor(

configureTracing("Token selection Worker", params.defaultParams.zipkinTraceUrl, params.defaultParams.traceSamplesPerSecond)

webServer.start(params.defaultParams.workerServerPort)
val config = WorkerHelpers.getBootstrapConfig(
secretsServiceFactoryResolver,
params.defaultParams,
configurationValidatorFactory.createConfigValidator(),
listOf(WorkerHelpers.createConfigFromParams(BootConfig.BOOT_DB, params.databaseParams))
)

// This is a placeholder worker the processor is still todo
webServer.start(params.defaultParams.workerServerPort)
tokenCacheProcessor.start(config)
}

override fun shutdown() {
logger.info("Token selection worker stopping.")
webServer.stop()
tokenCacheProcessor.stop()
shutdownTracing()
}
}
Expand Down
Loading

0 comments on commit 47e942b

Please sign in to comment.