Skip to content
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

fix: native image configs for google-http-java-client #1893

Merged
merged 15 commits into from
Nov 9, 2023
Merged
Changes from 8 commits
Commits
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
10 changes: 10 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -79,6 +79,16 @@ graalvm17)
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test
RETURN_CODE=$?
;;
graalvmA)
# Run Unit and Integration Tests with Native Image
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Pnative-deps test -pl '!google-http-client-appengine'
RETURN_CODE=$?
;;
graalvmB)
# Run Unit and Integration Tests with Native Image
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test -pl '!google-http-client-appengine'
RETURN_CODE=$?
;;
samples)
SAMPLES_DIR=samples
# only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise.
33 changes: 33 additions & 0 deletions .kokoro/presubmit/graalvm-native-a.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.2"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvmA"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
33 changes: 33 additions & 0 deletions .kokoro/presubmit/graalvm-native-b.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.2"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvmB"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[
{
"name": "org.apache.commons.logging.impl.LogFactoryImpl",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.apache.commons.logging.impl.Log4JLogger",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "org.apache.commons.logging.impl.Jdk14Logger",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "org.apache.commons.logging.impl.SimpleLog",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "org.apache.commons.logging.impl.Jdk13LumberjackLogger",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "org.apache.commons.logging.LogFactory",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"name": "com.google.api.client.json.GenericJson",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "com.google.api.client.util.ArrayMap",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[
{
"name": "com.google.api.client.json.GenericJson",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "java.util.HashMap",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "java.util.LinkedList",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "java.lang.Object",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
},
{
"name": "com.google.api.client.util.ArrayMap",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Args=--initialize-at-build-time=com.google.api.client.json.jackson2.JacksonFactoryTest \
--initialize-at-build-time=com.google.api.client.json.jackson2.JacksonGeneratorTest \
--initialize-at-build-time=com.fasterxml.jackson.core.io.SerializedString \
--initialize-at-build-time=com.fasterxml.jackson.core.io.CharTypes \
--initialize-at-build-time=com.fasterxml.jackson.core.JsonFactory \
--initialize-at-build-time=com.fasterxml.jackson.core.io.JsonStringEncoder
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"name": "com.google.api.client.protobuf.SimpleProto$TestMessage",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
}
]
12 changes: 12 additions & 0 deletions google-http-client-test/pom.xml
Original file line number Diff line number Diff line change
@@ -71,4 +71,16 @@
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>native-deps</id>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Loading