Skip to content

Commit 51094e5

Browse files
committed
Try again with AOT to see if it speeds things up
1 parent 5785bec commit 51094e5

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.github/workflows/gradle-build-native-feature.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
- name: Build a native docker image
4242
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
4343
with:
44-
arguments: dockerBuildNative
44+
arguments: optimizedDockerBuildNative

.github/workflows/gradle-deploy-native-develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
run: |-
5757
gcloud --quiet auth configure-docker
5858
- name: Build a native docker image
59-
run: ./gradlew dockerBuildNative
59+
run: ./gradlew optimizedDockerBuildNative
6060
env:
6161
VITE_APP_API_URL: https://checkins-develop-native-832140020593.us-central1.run.app
6262
- name: Push the Docker image to Google Container Registry

server/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'maven-publish'
55
id("com.gradleup.shadow") version "8.3.1"
66
id("io.micronaut.application") version "4.4.0"
7+
id("io.micronaut.aot") version "4.4.0"
78
id "jacoco"
89
id("org.openrewrite.rewrite") version "latest.release"
910
}
@@ -26,6 +27,20 @@ micronaut {
2627
incremental(true)
2728
annotations("com.objectcomputing.checkins.*")
2829
}
30+
aot {
31+
// Please review carefully the optimizations enabled below
32+
// Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
33+
optimizeServiceLoading = false
34+
convertYamlToJava = false
35+
precomputeOperations = true
36+
cacheEnvironment = true
37+
optimizeClassLoading = true
38+
deduceEnvironment = true
39+
optimizeNetty = true
40+
replaceLogbackXml = true
41+
configurationProperties.put("micronaut.security.jwks.enabled","false")
42+
configurationProperties.put("micronaut.security.openid-configuration.enabled","false")
43+
}
2944
}
3045

3146
dockerBuildNative {
@@ -36,6 +51,14 @@ dockerBuildNative {
3651
images = ["checkins:latest"] + imageNameFromGithub
3752
}
3853

54+
optimizedDockerBuildNative {
55+
def imageNameFromGithub = []
56+
if (System.getenv('PROJECT_ID') != null && System.getenv('SERVICE_NAME') && System.getenv('GITHUB_SHA')) {
57+
imageNameFromGithub = ["gcr.io/${System.getenv('PROJECT_ID')}/${System.getenv('SERVICE_NAME')}:${System.getenv("GITHUB_SHA")}".toString()]
58+
}
59+
images = ["checkins:latest"] + imageNameFromGithub
60+
}
61+
3962
graalvmNative {
4063
toolchainDetection = false
4164
binaries {

0 commit comments

Comments
 (0)