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

quarkus lambda function.zip does not contain UPX compressed bootstrap file using gradle #27208

Closed
gbloggs opened this issue Aug 9, 2022 · 2 comments · Fixed by #27220
Closed
Assignees
Labels
area/amazon-lambda kind/bug Something isn't working
Milestone

Comments

@gbloggs
Copy link

gbloggs commented Aug 9, 2022

Describe the bug

when running:

./gradlew build -Dquarkus.package.type=native -Dquarkus.native.compression.level=7 -D quarkus.native.native-image-xmx=10g -x check

My expectation is that the generated function.zip file would contain the UPX packed runner but the uncompressed runner is included in the zip

Expected behavior

The function.zip should contain the UPX compressed runner

Actual behavior

the function.zip file contains the uncompressed original runner

How to Reproduce?

using gradlew 7.5.1. against quarkus 2.11.2.FINAL with UPX installed on linux (either 3.95 or 3.96) build any native binary using the gradle commandline:

./gradlew build -Dquarkus.package.type=native -Dquarkus.native.compression.level=7 -D quarkus.native.native-image-xmx=10g -x check

build.gradle contains:
id 'io.quarkus' version '2.11.2.Final'

...
implementation(enforcedPlatform('io.quarkus:quarkus-bom:2.11.2.Final'))

Output of uname -a or ver

Linux DEVICE-D113HSFM 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux (but also other native ubuntu)

Output of java -version

openjdk 17.0.4 2022-07-19 OpenJDK Runtime Environment GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06) OpenJDK 64-Bit Server VM GraalVM CE 22.2.0 (build 17.0.4+8-jvmci-22.2-b06, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.11.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------ Gradle 7.5.1 ------------------------------------------------------------ Build time: 2022-08-05 21:17:56 UTC Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918 Kotlin: 1.6.21 Groovy: 3.0.10 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.4 (GraalVM Community 17.0.4+8-jvmci-22.2-b06) OS: Linux 5.10.102.1-microsoft-standard-WSL2 amd64

Additional information

This did used to work, but upgrading to the latest versions of everything we can find does not appear to fix anything. We are seeing the original runner added to the function.zip and whilst the UPX process is running, and the runner is the UPX compressed runner on the disk when the build completes it is not in the function.zip

WARNING: Unknown module: org.graalvm.nativeimage.llvm specified to --add-exports
WARNING: Unknown module: org.graalvm.nativeimage.llvm specified to --add-exports
WARNING: Unknown module: org.graalvm.nativeimage.llvm specified to --add-exports
========================================================================================================================
GraalVM Native Image: Generating 'yada-yada-unspecified-runner' (executable)...
========================================================================================================================
[1/7] Initializing...                                                                                   (16.1s @ 0.31GB)
 Version info: 'GraalVM 22.2.0 Java 17 CE'                                                                              
 Java version info: '17.0.4+8-jvmci-22.2-b06'                                                                           
 C compiler: gcc (linux, x86_64, 9.4.0)                                                                                 
 Garbage collector: Serial GC
 4 user-specific feature(s)
 - io.quarkus.runner.Feature
 - io.quarkus.runtime.graal.DisableLoggingFeature
 - io.quarkus.runtime.graal.ResourcesFeature
 - org.graalvm.home.HomeFinderFeature: Finds GraalVM paths and its version number
[2/7] Performing analysis...  [*********]                                                               (95.9s @ 1.76GB)
  28,192 (96.03%) of 29,356 classes reachable                                                                           
  41,800 (75.88%) of 55,084 fields reachable                                                                            
 154,280 (73.55%) of 209,765 methods reachable                                                                          
   4,306 classes, 14,569 fields, and 75,832 methods registered for reflection
      65 classes,    75 fields, and    56 methods registered for JNI access
       4 native libraries: dl, pthread, rt, z
[3/7] Building universe...                                                                               (4.9s @ 2.85GB)
[4/7] Parsing methods...      [****]                                                                    (16.1s @ 2.21GB)
[5/7] Inlining methods...     [****]                                                                     (5.0s @ 3.45GB)
[6/7] Compiling methods...    [*********]                                                               (88.3s @ 2.22GB)
[7/7] Creating image...                                                                                 (20.2s @ 3.92GB)
  49.91MB (35.55%) for code area:   126,542 compilation units                                                           
  90.18MB (64.22%) for image heap:  619,857 objects and 7,109 resources                                                 
 332.48KB ( 0.23%) for other data                                                                                       
 140.41MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
  11.56MB software.amazon.awssdk.services.ssm.model           33.85MB byte[] for embedded resources
   4.87MB software.amazon.awssdk.services.dynamodb.model       9.98MB byte[] for code metadata
   3.34MB software.amazon.awssdk.services.eventbridge.model    6.99MB byte[] for java.lang.String
   1.86MB com.oracle.svm.core.code                             6.96MB java.lang.Class
   1.63MB sun.security.ssl                                     6.08MB byte[] for reflection metadata
   1.30MB com.oracle.svm.core.reflect                          4.46MB java.lang.String
   1.03MB java.util                                            3.66MB byte[] for general heap data
 977.70KB software.amazon.awssdk.services.sqs.model            3.62MB c.oracle.svm.core.reflect.SubstrateMethodAccessor
 856.77KB software.amazon.awssdk.services.dynamodb             2.37MB com.oracle.svm.core.hub.DynamicHubCompanion
 736.04KB com.sun.crypto.provider                              1.79MB java.lang.Object[]
  20.77MB for 499 more packages                                9.95MB for 11431 more object types
------------------------------------------------------------------------------------------------------------------------
                        15.8s (6.1% of total time) in 59 GCs | Peak RSS: 5.84GB | CPU load: 5.39                        
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:                                                                                                     
yada-yada--update-unspecified-native-image-source-jar/yada-yada--update-unspecified-runner (executable)
 yada-yada-unspecified-native-image-source-jar/yada-yada--unspecified-runner.build_artifacts.txt (txt)
========================================================================================================================
Finished generating 'yada-yada-unspecified-runner' in 4m 15s.
                       Ultimate Packer for eXecutables                       
                          Copyright (C) 1996 - 2018                          
UPX 3.95        Markus Oberhumer, Laszlo Molnar & John Reiser   Aug 26th 2018

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
 147102264 ->  34487024   23.44%   linux/amd64   yada-yada-unspecified-runner

Packed 1 file.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

The stack trace above is from my WSL build but the Ubuntu/Jenkins builds show the same outputs with UPX 3.96

The function.zip contains a bootsrap file of 147102264 bytes not the expected 34487024 bytes

@gbloggs gbloggs added the kind/bug Something isn't working label Aug 9, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 9, 2022

/cc @evanchooly, @geoand, @glefloch, @matejvasek, @patriot1burke, @quarkusio/devtools

@geoand
Copy link
Contributor

geoand commented Aug 10, 2022

#27220 takes care of it

geoand added a commit that referenced this issue Aug 10, 2022
Ensure that compressed binary used in Amazon Lambda function if present
@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Aug 10, 2022
@gsmet gsmet modified the milestones: 2.12.0.CR1, 2.11.3.Final Aug 23, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/amazon-lambda kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants