Skip to content

Commit

Permalink
chore: Upgraded graal version from 22.1.0 to 23
Browse files Browse the repository at this point in the history
  • Loading branch information
devatherock committed Sep 26, 2024
1 parent 6a490c1 commit e9e1f19
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 68 deletions.
8 changes: 3 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ parameters:

executors:
jdk-executor:
docker:
- image: devatherock/graalvm:ol8-java17-22.1.0-5
<<: *docker_auth
<<: *docker_executor_image
<<: *resource_class
<<: *work_directory
environment:
Expand Down Expand Up @@ -82,7 +80,7 @@ jobs:
- v1-dependencies-{{ checksum "build.gradle" }}
- v1-dependencies
- run: |
./gradlew check sonar -Dsonar.token=$SONAR_TOKEN -Dgraalvm=true
./gradlew check sonar -Dsonar.token=$SONAR_TOKEN
- store_artifacts:
path: build/reports
- store_test_results:
Expand All @@ -99,7 +97,7 @@ jobs:
- v1-dependencies-{{ checksum "build.gradle" }}
- v1-dependencies
- run: |
./gradlew build coveralls sonar -Dsonar.token=$SONAR_TOKEN -Dgraalvm=true
./gradlew build coveralls sonar -Dsonar.token=$SONAR_TOKEN
- persist_to_workspace:
root: ~/ldap-search-api
paths:
Expand Down
7 changes: 1 addition & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@

## [Unreleased]
### Changed
- fix(deps): update dependency net.bytebuddy:byte-buddy to v1.14.15
- fix(deps): update dependency org.objenesis:objenesis to v3.4
- fix(deps): update dependency net.bytebuddy:byte-buddy to v1.14.16
- fix(deps): update dependency net.bytebuddy:byte-buddy to v1.14.17
- chore(deps): update dependency gradle to v8.8
- fix(deps): update dependency com.unboundid:unboundid-ldapsdk to v7.0.1
- fix(deps): update dependency org.projectlombok:lombok to v1.18.34
- fix(deps): update dependency org.codehaus.groovy:groovy-json to v3.0.22
- chore(deps): update plugin org.sonarqube to v5.1.0.4882
- fix(deps): update dependency net.bytebuddy:byte-buddy to v1.14.18
- chore(deps): update dependency gradle to v8.9
- fix(deps): update dependency net.logstash.logback:logstash-logback-encoder to v8
- fix(deps): update dependency ch.qos.logback:logback-classic to v1.5.8
- chore(deps): update dependency gradle to v8.10.1
- fix(deps): update dependency net.bytebuddy:byte-buddy to v1.15.1
- Upgraded graal version from 22.1.0 to 23

## [2.1.0] - 2024-05-04
### Added
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM ghcr.io/graalvm/native-image:ol8-java17-22.1.0 as graalvm
FROM ghcr.io/graalvm/native-image-community:17-ol8 as graalvm

COPY . /home/app/micronaut-graal-app
WORKDIR /home/app/micronaut-graal-app

RUN native-image -cp build/libs/*-all.jar
ARG QUICK_BUILD
RUN native-image --verbose ${QUICK_BUILD} -cp build/libs/*-all.jar



FROM gcr.io/distroless/base-debian11:latest

LABEL maintainer="devatherock@gmail.com"
LABEL io.github.devatherock.version="2.0.0"
LABEL io.github.devatherock.version="2.2.0"

EXPOSE 8080

Expand Down
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ docker_tag=latest
clean:
rm -rf build
check:
./gradlew check -Dgraalvm=true $(additional_gradle_args)
./gradlew check $(additional_gradle_args)
integration-test:
DOCKER_TAG=$(docker_tag) docker-compose up &
DOCKER_TAG=$(docker_tag) docker compose up --wait
./gradlew integrationTest --tests '*ControllerIntegrationSpec*'
docker-compose down
remote-integration-test:
DOCKER_TAG=$(docker_tag) docker-compose -f docker-compose-remote.yml up &
DOCKER_TAG=$(docker_tag) docker compose -f docker-compose-remote.yml up --wait
./gradlew integrationTest --tests '*RemoteUrlsIntegrationSpec*'
docker-compose down
build-all:
./gradlew build -Dgraalvm=true
./gradlew build
fast-build:
./gradlew build -x test
docker-build:
docker build -t devatherock/ldap-search-api:$(docker_tag) .
docker build --progress=plain --build-arg QUICK_BUILD=-Ob -t devatherock/ldap-search-api:$(docker_tag) .
9 changes: 1 addition & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ java {
targetCompatibility = JavaVersion.toVersion("1.8")
}

test {
doFirst {
if (Boolean.getBoolean('graalvm')) {
jvmArgs("-agentlib:native-image-agent=access-filter-file=$projectDir/src/main/resources/graal/access-filter.json,config-output-dir=$projectDir/build/graal")
}
}
}

// Generates resource-config.json file for graalvm
build.dependsOn(generateResourcesConfigFile)

Expand All @@ -85,6 +77,7 @@ run {
ext.jacoco = [
exclusions: [
'io/github/devatherock/ldapsearch/Application.class',
'io/github/devatherock/ldapsearch/config/GraalConfig.class',
],
coverageThresholds: [
'io.github.devatherock.logback.LogbackConfigInitializer': [
Expand Down
18 changes: 17 additions & 1 deletion docker-compose-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,20 @@ services:
LDAP_USERNAME: $JUMPCLOUD_USERNAME
LDAP_PASSWORD: $JUMPCLOUD_PASSWORD
LDAP_BASE_DN: $JUMPCLOUD_BASE_DN
LOGBACK_CONFIGURATION_FILE: 'https://raw.githubusercontent.com/devatherock/artifactory-badge/master/src/main/resources/logback.xml'
LOGBACK_CONFIGURATION_FILE: 'https://raw.githubusercontent.com/devatherock/artifactory-badge/master/src/main/resources/logback.xml'

health:
image: alpine:3.20.3
network_mode: "host"
depends_on:
- ldap-search-api
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8080/health"]
interval: 2s
timeout: 60s
retries: 30
command: |
sh -c '
wget -q -O - http://localhost:8080/health
sleep 120
'
25 changes: 20 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@ services:
ldap-search-api:
image: devatherock/ldap-search-api:${DOCKER_TAG:-latest}
network_mode: "host"
volumes:
- ./src/integrationTest/resources/application-docker.yml:/config/application.yml
environment:
LDAP_HOST: ldap://localhost:33389
LDAP_USERNAME: cn=Directory Manager
LDAP_PASSWORD: testpwd
JACKSON_SERIALIZATION_INDENT_OUTPUT: 'true'
LOGBACK_CONFIGURATION_FILE: logback-json.xml
LOGBACK_CONFIGURATION_FILE: logback-json.xml
MICRONAUT_CONFIG_FILES: '/config/application.yml'

health:
image: alpine:3.20.3
network_mode: "host"
depends_on:
- ldap-search-api
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8080/health"]
interval: 2s
timeout: 60s
retries: 30
command: |
sh -c '
wget -q -O - http://localhost:8080/health
sleep 120
'
7 changes: 7 additions & 0 deletions src/integrationTest/resources/application-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ldap:
host: ldap://localhost:33389
username: cn=Directory Manager
password: testpwd
jackson:
serialization:
INDENT_OUTPUT: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.github.devatherock.ldapsearch.config;

import javax.net.ssl.SSLSocketFactory;

import com.sun.jndi.ldap.LdapCtxFactory;
import io.micronaut.core.annotation.ReflectionConfig;
import io.micronaut.core.annotation.ReflectionConfig.ReflectiveMethodConfig;
import io.micronaut.core.annotation.TypeHint.AccessType;
import net.logstash.logback.encoder.LogstashEncoder;

@ReflectionConfig(type = LogstashEncoder.class, accessType = AccessType.ALL_PUBLIC_METHODS, methods = {
@ReflectiveMethodConfig(name = "<init>")
})
@ReflectionConfig(type = LdapCtxFactory.class, accessType = AccessType.ALL_DECLARED_CONSTRUCTORS)
@ReflectionConfig(type = SSLSocketFactory.class, accessType = AccessType.ALL_DECLARED_METHODS)
public class GraalConfig {
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import io.micronaut.context.annotation.ConfigurationProperties;
import io.micronaut.context.annotation.Context;
import io.micronaut.core.annotation.Introspected;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -72,6 +73,7 @@ public class LdapProperties {
*/
@Getter
@Setter
@Introspected
@ConfigurationProperties("connection-pool")
public static class LdapConnectionPoolProperties {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
Args = -H:ResourceConfigurationFiles=build/graal/resource-config.json,build/native/generated/generateResourcesConfigFile/resource-config.json \
-H:ReflectionConfigurationFiles=build/graal/reflect-config.json,build/resources/main/graal/reflect-config.json \
-H:JNIConfigurationFiles=build/graal/jni-config.json \
-H:DynamicProxyConfigurationFiles=build/graal/proxy-config.json \
-H:PredefinedClassesConfigurationFiles=build/graal/predefined-classes-config.json \
Args = -H:ResourceConfigurationFiles=build/native/generated/generateResourcesConfigFile/resource-config.json \
-H:Name=micronautgraalapp \
--no-fallback \
--report-unsupported-elements-at-runtime \
Expand All @@ -12,5 +8,6 @@ Args = -H:ResourceConfigurationFiles=build/graal/resource-config.json,build/nati
-H:+ReportExceptionStackTraces \
-H:+StaticExecutableWithDynamicLibC \
-J-Xmx3072m \
-H:NumberOfThreads=2 \
-J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED \
-H:Class=io.github.devatherock.ldapsearch.Application
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ micronaut:
mapping: /swagger/**
swagger-ui:
paths: classpath:META-INF/swagger/views/swagger-ui
mapping: /swagger-ui/**
mapping: /swagger-ui/**
28 changes: 0 additions & 28 deletions src/main/resources/graal/access-filter.json

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/graal/reflect-config.json

This file was deleted.

0 comments on commit e9e1f19

Please sign in to comment.