Skip to content

Commit

Permalink
Try again with AOT to see if it speeds things up
Browse files Browse the repository at this point in the history
  • Loading branch information
timyates committed Sep 17, 2024
1 parent 5785bec commit 51094e5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-build-native-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
- name: Build a native docker image
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
with:
arguments: dockerBuildNative
arguments: optimizedDockerBuildNative
2 changes: 1 addition & 1 deletion .github/workflows/gradle-deploy-native-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: |-
gcloud --quiet auth configure-docker
- name: Build a native docker image
run: ./gradlew dockerBuildNative
run: ./gradlew optimizedDockerBuildNative
env:
VITE_APP_API_URL: https://checkins-develop-native-832140020593.us-central1.run.app
- name: Push the Docker image to Google Container Registry
Expand Down
23 changes: 23 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'maven-publish'
id("com.gradleup.shadow") version "8.3.1"
id("io.micronaut.application") version "4.4.0"
id("io.micronaut.aot") version "4.4.0"
id "jacoco"
id("org.openrewrite.rewrite") version "latest.release"
}
Expand All @@ -26,6 +27,20 @@ micronaut {
incremental(true)
annotations("com.objectcomputing.checkins.*")
}
aot {
// Please review carefully the optimizations enabled below
// Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
optimizeServiceLoading = false
convertYamlToJava = false
precomputeOperations = true
cacheEnvironment = true
optimizeClassLoading = true
deduceEnvironment = true
optimizeNetty = true
replaceLogbackXml = true
configurationProperties.put("micronaut.security.jwks.enabled","false")
configurationProperties.put("micronaut.security.openid-configuration.enabled","false")
}
}

dockerBuildNative {
Expand All @@ -36,6 +51,14 @@ dockerBuildNative {
images = ["checkins:latest"] + imageNameFromGithub
}

optimizedDockerBuildNative {
def imageNameFromGithub = []
if (System.getenv('PROJECT_ID') != null && System.getenv('SERVICE_NAME') && System.getenv('GITHUB_SHA')) {
imageNameFromGithub = ["gcr.io/${System.getenv('PROJECT_ID')}/${System.getenv('SERVICE_NAME')}:${System.getenv("GITHUB_SHA")}".toString()]
}
images = ["checkins:latest"] + imageNameFromGithub
}

graalvmNative {
toolchainDetection = false
binaries {
Expand Down

0 comments on commit 51094e5

Please sign in to comment.