Skip to content

feat(gateway): native image #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1eefad0
refactor(#20): logback refactor profiles
simonhir Jul 26, 2024
020c544
feat: renovate add labels
simonhir Jul 26, 2024
fa0313e
typo: README.md fix typos
simonhir Jul 26, 2024
6c0bf5d
refactor(#20): logback refactor profiles update README.md
simonhir Jul 26, 2024
d0cf228
typo: README.md fix typos
simonhir Jul 26, 2024
fc29085
:recycle: #18: refactor hazelcast profiles
simonhir Jul 26, 2024
41d5d57
:recycle: #18: refactor hazelcast profiles
simonhir Jul 26, 2024
db02bec
:art: reformat WebSessionConfiguration
simonhir Jul 26, 2024
fb5c864
:recycle: (#22) reformat spring banner
simonhir Jul 26, 2024
975bd24
:sparkles: init native image support
simonhir Jul 26, 2024
8ba88a9
:construction: #29 add custom native metadata as workaround
simonhir Jul 26, 2024
e41792a
:wrench: #29 use env var for spring profile used for native build
simonhir Jul 26, 2024
9b35e51
Merge branch 'refs/heads/main' into feature/native-image
simonhir Jul 31, 2024
8ad94f7
Merge branch 'refs/heads/main' into feature/native-image
simonhir Jul 31, 2024
74974d5
Merge branch 'main' into feature/native-image
simonhir May 13, 2025
1790561
revert(gateway): modify logback-spring
simonhir May 13, 2025
b9a2da2
conf(gateway): update hazelcast aot hints
simonhir May 13, 2025
bedb411
conf(gateway): define native sso config
simonhir May 13, 2025
02912a1
feat(ci/gateway): init native build
simonhir May 13, 2025
5809846
feat(ci/gateway): init native build
simonhir May 13, 2025
445d79b
refact(ci/gateway): native build and mvn profiles
simonhir May 13, 2025
c36bfac
feat(ci/gateway): native build publish
simonhir May 13, 2025
c9ac730
feat(ci/gateway): native build add health-checker and use jammy-base
simonhir May 14, 2025
6f1629c
feat(ci/gateway): native build add qemu
simonhir May 14, 2025
9b35f0d
feat(gateway): native build verbose logging
simonhir May 14, 2025
769cbeb
fix(ci/gateway): add native profile
simonhir May 14, 2025
049aa76
Merge branch 'main' into feature/native-image
simonhir May 16, 2025
9dab460
fix(ci/native): use hazelcast-k8s profile
simonhir May 16, 2025
c168613
fix(gateway): update hazelcast reflection
simonhir May 16, 2025
b4c7c27
fix(gateway): update hazelcast reflection
simonhir May 16, 2025
b87347c
Merge branch 'refs/heads/main' into feature/native-image
simonhir May 16, 2025
2ba8423
fix(gateway): update hazelcast reflection
simonhir May 16, 2025
9dc6116
fix(gateway): update hazelcast reflection
simonhir May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/maven-build-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build refarch-gateway native

on:
pull_request:
push:
branches:
- main

jobs:
build-maven:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: "21"
distribution: "temurin"
cache: "maven"
cache-dependency-path: "./refarch-gateway/pom.xml"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/refarch-gateway-native
tags: |
type=raw,value=dev-k8s
- name: Build with Maven
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}/refarch-gateway-native
IMAGE_RAW_TAGS: ${{ steps.meta.outputs.tags }}
NATIVE_SPRING_PROFILES: hazelcast-k8s
REGISTRY_USER: ${{ github.repository_owner }}
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export IMAGE_TAGS="${IMAGE_RAW_TAGS//$'\n'/,}"
mvn -f ./refarch-gateway/pom.xml -Pci,native,build-native-image,publish-image spring-boot:build-image
95 changes: 95 additions & 0 deletions refarch-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

<!-- Release -->
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
<image.name>itatm/${project.artifactId}</image.name>

<!-- Utility -->
<apache-commons-lang.version>3.17.0</apache-commons-lang.version>
Expand Down Expand Up @@ -361,4 +362,98 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>lhm</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<docker>
<builderRegistry>
<username>${env.DOCKERHUB_USERNAME}</username>
<password>${env.DOCKERHUB_PASSWORD}</password>
<url>https://index.docker.io/v1/</url>
</builderRegistry>
</docker>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>ci</id>
<properties>
<image.name>${env.IMAGE_NAME}</image.name>
</properties>
</profile>
<profile>
<id>build-native-image</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Needed for image build behind proxy -->
<configuration>
<image>
<name>${image.name}:${project.version}</name>
<tags>${env.IMAGE_TAGS}</tags>
<env>
<HTTP_PROXY>${env.HTTP_PROXY}</HTTP_PROXY>
<HTTPS_PROXY>${env.HTTPS_PROXY}</HTTPS_PROXY>
<NO_PROXY>${env.NO_PROXY}</NO_PROXY>
<BP_HEALTH_CHECKER_ENABLED>true</BP_HEALTH_CHECKER_ENABLED>
</env>
<verboseLogging>true</verboseLogging>
<builder>paketobuildpacks/builder-jammy-base</builder>
<buildpacks>
<buildpack>urn:cnb:builder:paketo-buildpacks/java</buildpack>
<buildpack>urn:cnb:builder:paketo-buildpacks/native-image</buildpack>
<buildpack>docker.io/paketobuildpacks/health-checker</buildpack>
</buildpacks>
</image>
</configuration>
<executions>
<execution>
<id>process-aot</id>
<configuration>
<profiles>native,${env.NATIVE_SPRING_PROFILES}</profiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publish-image</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<publish>true</publish>
</image>
<docker>
<publishRegistry>
<username>${env.REGISTRY_USER}</username>
<password>${env.REGISTRY_TOKEN}</password>
</publishRegistry>
</docker>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[
{
"condition": {
"typeReachable": "com.hazelcast.instance.BuildInfoProvider"
},
"name": "com.hazelcast.instance.GeneratedBuildProperties",
"fields": [
{
"name": "ARTIFACT_ID"
}
]
},
{
"name": "com.hazelcast.internal.cluster.Versions",
"allPublicFields": true
},
{
"condition": {
"typeReachable": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField"
},
"name": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueConsumerIndexField",
"fields": [
{
"name": "consumerIndex"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField"
},
"name": "com.hazelcast.shaded.org.jctools.queues.MpmcArrayQueueProducerIndexField",
"fields": [
{
"name": "producerIndex"
}
]
},
{
"condition": {
"typeReachable": "com.hazelcast.internal.partition.impl.MigrationStats"
},
"name": "com.hazelcast.internal.partition.impl.MigrationStats",
"allPublicMethods": true
},
{
"condition": {
"typeReachable": "com.hazelcast.internal.networking.nio.NioOutboundPipeline"
},
"name": "com.hazelcast.internal.networking.nio.NioOutboundPipeline",
"methods": [
{
"name": "idleTimeMillis"
}
]
}
]
17 changes: 17 additions & 0 deletions refarch-gateway/src/main/resources/application-native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spring:
security:
oauth2:
resourceserver:
jwt:
issuer-uri: "https://sso.muenchen.de/auth/realms/muenchen.de"
client:
provider:
sso:
issuer-uri: ${spring.security.oauth2.resourceserver.jwt.issuer-uri}
registration:
sso:
provider: sso
client-id:
client-secret:
# needed for userInfo endpoint
scope: profile, openid
Loading