-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.gradle
More file actions
228 lines (212 loc) · 9.45 KB
/
build.gradle
File metadata and controls
228 lines (212 loc) · 9.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
plugins {
id 'io.seqera.wave.java-library-conventions'
id 'io.seqera.wave.groovy-application-conventions'
id "io.micronaut.minimal.application" version "4.1.1"
id "com.google.cloud.tools.jib" version "3.4.5"
id 'jacoco'
}
String gitVersion() {
def p = new ProcessBuilder() .command('sh','-c','git rev-parse --short HEAD') .start()
def r = p.waitFor()
return r==0 ? p.text.trim() : '(unknown)'
}
group "io.seqera"
version "${rootProject.file('VERSION').text.trim()}"
ext.commitId = gitVersion()
repositories {
mavenCentral()
maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/releases' }
maven { url = 'https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots' }
}
dependencies {
annotationProcessor 'io.micronaut.validation:micronaut-validation-processor'
annotationProcessor 'io.micronaut:micronaut-http-validation'
compileOnly 'io.micronaut.data:micronaut-data-processor'
compileOnly 'io.micronaut:micronaut-inject-groovy'
compileOnly 'io.micronaut:micronaut-http-validation'
implementation 'jakarta.persistence:jakarta.persistence-api:3.0.0'
implementation 'io.seqera:lib-cache-tiered-redis:1.1.0'
implementation 'io.seqera:lib-lang:1.1.0'
implementation 'io.seqera:lib-serde:1.2.0'
implementation 'io.seqera:lib-serde-moshi:1.1.0'
implementation 'io.seqera:lib-mail:1.3.1'
implementation 'io.seqera:lib-pool:1.0.0'
implementation 'io.seqera:lib-retry:2.0.0'
implementation 'io.seqera:lib-random:1.0.0'
implementation 'io.seqera:lib-util-time:1.0.0'
implementation 'io.seqera:lib-activator:1.0.0'
implementation project(':wave-api')
implementation project(':wave-utils')
implementation 'io.seqera:lib-pairing:1.0.0'
implementation 'io.seqera:lib-data-store-state-redis:1.0.0'
implementation 'io.seqera:lib-data-store-future-redis:1.0.0'
implementation 'io.seqera:lib-crypto:1.0.0'
implementation 'io.seqera:jedis-lock:1.0.0'
implementation 'io.seqera:lib-data-queue-redis:1.1.2'
implementation 'io.seqera:lib-data-stream-redis:1.2.0'
implementation 'io.seqera:lib-data-range-redis:1.0.0'
implementation 'io.seqera:lib-jedis-pool:1.0.0'
implementation 'io.micronaut:micronaut-http-client'
implementation 'io.micronaut:micronaut-jackson-databind'
implementation 'io.micronaut.groovy:micronaut-runtime-groovy'
implementation 'io.micronaut.reactor:micronaut-reactor'
implementation 'io.micronaut.reactor:micronaut-reactor-http-client'
implementation 'jakarta.annotation:jakarta.annotation-api'
implementation 'io.micronaut.validation:micronaut-validation'
implementation 'io.micronaut.security:micronaut-security'
implementation 'io.micronaut:micronaut-websocket'
implementation 'org.apache.groovy:groovy-json'
implementation 'org.apache.groovy:groovy-nio'
implementation 'com.google.guava:guava:33.3.1-jre'
implementation 'dev.failsafe:failsafe:3.1.0'
implementation 'io.micronaut.reactor:micronaut-reactor'
implementation 'io.micronaut.reactor:micronaut-reactor-http-client'
implementation 'org.apache.commons:commons-compress:1.27.1'
implementation 'org.apache.commons:commons-lang3:3.18.0'
implementation 'io.kubernetes:client-java:24.0.0'
implementation 'io.kubernetes:client-java-api-fluent:24.0.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
// Moshi dependencies now provided by lib-serde-moshi
implementation 'redis.clients:jedis:5.1.3'
implementation 'io.github.resilience4j:resilience4j-ratelimiter:0.17.0'
implementation 'io.micronaut:micronaut-retry'
// caching deps
implementation 'io.micronaut.cache:micronaut-cache-core'
implementation 'io.micronaut.cache:micronaut-cache-caffeine'
implementation 'io.micronaut.aws:micronaut-aws-parameter-store'
implementation 'software.amazon.awssdk:ecr'
implementation 'software.amazon.awssdk:ecrpublic'
implementation 'software.amazon.awssdk:ses'
implementation 'org.yaml:snakeyaml:2.2'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
implementation 'org.luaj:luaj-jse:3.0.1'
// add postgresql dependencies
implementation 'io.micronaut.data:micronaut-data-jdbc'
implementation 'io.micronaut.sql:micronaut-jdbc-hikari' // HikariCP for connection pooling
implementation 'org.postgresql:postgresql:42.7.7' // PostgreSQL Driver
//object storage dependency
implementation 'io.micronaut.objectstorage:micronaut-object-storage-aws'
implementation 'software.amazon.awssdk:sts'
runtimeOnly 'io.netty:netty-tcnative-boringssl-static:2.0.0.Final'
runtimeOnly 'javax.xml.bind:jaxb-api:2.3.1'
testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.testcontainers:postgresql'
testRuntimeOnly 'com.h2database:h2'
testImplementation testFixtures('io.seqera:lib-fixtures-redis:1.1.0')
// rate limit
implementation 'com.coveo:spillway:3.0.0'
// logging
implementation 'ch.qos.logback:logback-classic:1.5.20'
implementation 'ch.qos.logback:logback-core:1.5.20'
// monitoring
implementation 'io.micronaut.micrometer:micronaut-micrometer-core'
implementation 'io.micronaut.micrometer:micronaut-micrometer-registry-prometheus'
// Also required to enable endpoint
implementation 'io.micronaut:micronaut-management'
//views
implementation 'io.micronaut.views:micronaut-views-handlebars'
// bump version to prevent security issue
runtimeOnly 'org.apache.commons:commons-lang3:3.18.0'
runtimeOnly "io.netty:netty-bom:4.2.5.Final"
}
application {
mainClass.set("io.seqera.wave.Application")
}
micronaut {
runtime("netty")
testRuntime("spock2")
processing {
incremental(true)
annotations("io.seqera.*")
}
}
//
// Build container image with JIB
// https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin
//
jib {
from {
image = 'cr.seqera.io/public/nf-jdk:corretto-25-al2023-jemalloc'
platforms {
platform { architecture = 'amd64'; os = 'linux' }
platform { architecture = 'arm64'; os = 'linux' }
}
}
to {
image = findProperty("jibRepo") ?: "195996028523.dkr.ecr.eu-west-1.amazonaws.com/wave/app:$version"
}
container {
creationTime = "${OffsetDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}"
filesModificationTime = "${OffsetDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}"
ports = ['9090']
entrypoint = '/bin/sh'
args = ['/launch.sh'] // copied from `src/main/jib` directory
}
extraDirectories {
paths {
path { from = file('src/main/jib'); }
path { from = file('.'); includes = ['config.yml'] }
}
permissions = ['/launch.sh': '755']
}
allowInsecureRegistries= findProperty("jibRepo")?.toString()?.indexOf('localhost') != -1
}
run{
def envs = findProperty('micronautEnvs')
def args = ["-Dmicronaut.environments=$envs","-Djdk.tracePinnedThreads=short", "--add-opens","java.base/java.lang=ALL-UNNAMED"]
if( environment['JVM_OPTS'] ) args.add(environment['JVM_OPTS'])
jvmArgs args
systemProperties 'DOCKER_USER': project.findProperty('DOCKER_USER') ?: environment['DOCKER_USER'],
'DOCKER_PAT': project.findProperty('DOCKER_PAT') ?: environment['DOCKER_PAT'],
'QUAY_USER': project.findProperty('QUAY_USER') ?: environment['QUAY_USER'],
'QUAY_PAT': project.findProperty('QUAY_PAT') ?: environment['QUAY_PAT']
}
test {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
}
environment 'DOCKER_USER', project.findProperty('DOCKER_USER') ?: environment['DOCKER_USER']
environment 'DOCKER_PAT', project.findProperty('DOCKER_PAT') ?: environment['DOCKER_PAT']
environment 'QUAY_USER', project.findProperty('QUAY_USER') ?: environment['QUAY_USER']
environment 'QUAY_PAT', project.findProperty('QUAY_PAT') ?: environment['QUAY_PAT']
systemProperty 'logback.configurationFile', 'src/test/resources/logback-test.xml'
}
/** Update version number for backend app and modules */
task buildInfo { doLast {
def info = """\
name=${project.name}
group=${project.group}
version=${version}
commitId=${project.property('commitId')}
""".stripIndent().toString()
def f = file("${buildDir}/resources/main/META-INF/build-info.properties")
f.parentFile.mkdirs()
f.text = info
} }
buildInfo.dependsOn processResources
compileGroovy.dependsOn buildInfo
jacoco {
toolVersion '0.8.12'
}
/**
* Code coverage with JaCoCo.
* See: https://www.jacoco.org/; https://docs.gradle.org/current/userguide/jacoco_plugin.html
*/
// Code coverage report is always generated after tests run
test { finalizedBy jacocoTestReport }
jacocoTestReport {
// Tests are required to run before generating the code coverage report
dependsOn test
// Remove closure classes from the report, as they are already covered by the enclosing class coverage stats adding only noise.
// See: https://stackoverflow.com/questions/39453696
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect { dir ->
fileTree(dir: dir, excludes: ['**/*$*_closure*'])
}))
}
}