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

Updates to support Platform Spec 0.4-0.12 #59

Merged
merged 10 commits into from
Jun 5, 2024

Conversation

BarDweller
Copy link
Collaborator

This PR represents a significant upgrade to the java buildpack client, which previously claimed support only for version 0.4 of the platform spec. This meant only builders that claimed compatibility with version 0.4 of the spec would run as expected. The spec has continued to evolve, most notably adding build image extension (0.10) and run image extension (0.12), and there are public builders (Paketo UBI Builder) using that spec, that will be unable to execute as intended with a 0.4 platform implementation.

An attempt has been made in this PR to tidy up the old code, splitting large executions across multiple classes, this included the configuration interface, which has been broken down into smaller composable units. As such this PR represents a breaking change to the api. We haven't released 1.0 yet, so this should be ok, and migration is relatively simple.

New to this version:

  • multi-phase lifecycle execution. Creator is only used if platform.trustBuilder is true AND the build image has no extensions. Otherwise we use multi phase execution. (Creator is used by pack if the builder is considered 'trusted')
  • ephemeral builder image. Mostly an internal impl detail, the ephemeral builder is created from the specified builder image, and adds the mountpoints with the appropriate permissions to support runtime. (This greatly simplifies the permissions for mounted volumes)
  • lifecycle override. Lifecycle image can be specified, if supplied, lifecycle from the image will be used in place of the one contained in the build image. (via ephemeral builder, and useful for testing new lifecycles, or potentially for a smidge of extra security when running unknown builders)
  • Additional buildpacks/extensions. Experimental, not exposed via API, additional buildpacks/extensions can be added via oci images (not directories at the mo). Requires further code to generate a composite order.toml to combine the builder image content with the supplied content.
  • multi platform level support. Previously we only implemented a single spec level of platform api, now we implement all versions from 0.4->0.12 (although >0.10 is pretty experimental at this stage).. this means we can support running with a wider range of builder images. This support affects many aspects of the build, from which order phases execute in, to how to obtain run image info from a builder image, and which flags to pass to which phases.
  • platform level override support. By default the library will select the highest platform level from the intersection of the implemented levels, the levels supported by the builder, and the levels supported by any specified lifecycle image. The level can also be forced to a particular level through config.
  • daemon/not-daemon mode. In daemon mode the docker socket is made available directly to the build phases so they can use images and create the output image directly in the daemon (this was the only mode supported before). In non daemon mode, the daemon is not mounted into the containers, reducing their security exposure significantly.

No support is currently planned for oci image layout (platform 0.12) or cache images.. which are implementation options for various revisions of the platform spec. Both are incompatible with extensions, and a primary goal for this updates was to ensure this library could build with builder images making use of extensions.

@BarDweller
Copy link
Collaborator Author

Heads up that the integration tests fail, because they are using jbang to run against the artifact in maven central not the artifact built by this build, so they still point at the old version, and thus cannot work.. Safe to ignore for this commit, but will need updating once the artifact is built & published to maven central

@BarDweller
Copy link
Collaborator Author

BarDweller commented Feb 27, 2024

Slowly working through testing with Podman ..

Rootless podman:

  • Issues with pull image not finding, or failing to pull images that podman pull succeeds with. Needs investigation.
  • Possible bug if build/run images are not pre-pulled before the library is invoked (tbc, tentative code fix local atm)
  • Podman socket api CopyArchiveToContainer command fails to operate identically to docker. With docker I can mount a volume at /mount and unpack a tar at / containing paths of /mount/dirname/filename. With podman I have to unpack the tar at /mount with paths of dirname/filename. I need to try to isolate this and raise an issue against podman api. I can work round this within the code for now.
  • Issues with deleting the ephemeral build image due to it being in use with a container.. need to see if that's forceable, or figure out which container is holding it in-use.

Rootful podman:

  • TBD

@cmoulliard
Copy link
Member

Github flows are failing. Can you fix them ? @BarDweller

@BarDweller
Copy link
Collaborator Author

Github flows are failing. Can you fix them ? @BarDweller

Heads up that the integration tests fail, because they are using jbang to run against the artifact in maven central not the artifact built by this build, so they still point at the old version, and thus cannot work.. Safe to ignore for this commit, but will need updating once the artifact is built & published to maven central

@cmoulliard
Copy link
Member

So I can then review it ? @BarDweller

README.md Show resolved Hide resolved
@BarDweller
Copy link
Collaborator Author

Added 0a7fbbd which is a fairly decent update to allow this to work with podman rootless.

This PR is now ready for review.

Copy link
Member

@cmoulliard cmoulliard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update the github flow to test the quarkus example using our ubi builder image ?

samples/hello-spring/pack.java Outdated Show resolved Hide resolved
Copy link
Member

@cmoulliard cmoulliard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update the github flow to test the quarkus example using our ubi builder image ?

Copy link
Member

@cmoulliard cmoulliard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a great PR :-) Well done !

README.md Show resolved Hide resolved
README.md Outdated

## FAQ:

**Will this work with Podman?:**

Not yet. Once the regular `pack` cli works with Podman, I'll revisit this and ensure it works too.
Yes, tested with podman on fedora, rootless and rootful.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we here define the podman version ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, although it may work with earlier revisions, it should at least work with the level I've tested and onwards

Comment on lines 73 to 77
int uid = (Integer)Files.getAttribute(Paths.get("/proc/self"), "unix:uid");
File podmanUserSock = new File("/var/run/user/"+uid+"/podman/podman.sock");
if(podmanUserSock.exists()){
return "unix:///var/run/user/1000/podman/podman.sock";
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I miss something as it seems that you return unix:///var/run/user/1000/podman/podman.sock even if a different uid has been passed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, this was a dev time hack that accidently made it into the commit at some point.. I'll fix this.

@cmoulliard
Copy link
Member

cmoulliard commented May 27, 2024

I compiled the PR locally and got this error using JDK 21.x

[INFO]
[INFO] Snowdrop :: Java Buildpack Client :: Project ....... SUCCESS [  0.276 s]
[INFO] Snowdrop :: Java Buildpack Client :: Client ........ FAILURE [  3.234 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.555 s
[INFO] Finished at: 2024-05-27T13:11:56+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project buildpack-client: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

The project is using a old java JDK

    <java.source>1.8</java.source>
    <java.target>1.8</java.target>

We should certainly bump it. WDYT ?
@BarDweller

@cmoulliard
Copy link
Member

cmoulliard commented May 27, 2024

The main README explaining how to use ./pack.java for a sample

...
./pack.java

The samples use jbang too, but allow the version of the library to be set via an env var for use in our tests! [samples](./samples).

should also explain what to do when the image has been built

When the image has been built, run locally `podman run -i --rm -p 8080:8080 snowdrop/hello-quarkus:latest`

@BarDweller

@cmoulliard
Copy link
Member

Why don't we mention end of the building process of a sample that an image has been built ?

./pack.java
...
2024-05-27T13:55:54+02:00 Reading buildpack directory item: web-application-type.toml
2024-05-27T13:55:54+02:00 Reusing tarball for layer "paketo-buildpacks/spring-boot:spring-cloud-bindings" with SHA: sha256:226bdd0803ccc2fdbfd32b27e9c850e95090f0cfd539fcf259b9dc8eaa55bb9e
2024-05-27T13:55:54+02:00 Adding cache layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings'
2024-05-27T13:55:54+02:00 Layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings' SHA: sha256:226bdd0803ccc2fdbfd32b27e9c850e95090f0cfd539fcf259b9dc8eaa55bb9e
2024-05-27T13:55:54+02:00 Found SBOM of type cache for at /layers/sbom/cache
2024-05-27T13:55:54+02:00 Reusing tarball for layer "buildpacksio/lifecycle:cache.sbom" with SHA: sha256:ba3d34b908554bea571a01346c79e1c942fab1c40d5069c5ab2742bbd7332880
2024-05-27T13:55:54+02:00 Adding cache layer 'buildpacksio/lifecycle:cache.sbom'
2024-05-27T13:55:54+02:00 Layer 'buildpacksio/lifecycle:cache.sbom' SHA: sha256:ba3d34b908554bea571a01346c79e1c942fab1c40d5069c5ab2742bbd7332880
2024-05-27T13:55:54+02:00 Timer: Cache ran for 1.873783544s and ended at 2024-05-27T11:55:54Z
[main] INFO dev.snowdrop.buildpack.lifecycle.phases.Exporter - Buildpack export container complete, with exit code 0
[main] INFO dev.snowdrop.buildpack.lifecycle.LifecyclePhaseFactory - - tidying up the build volumes
[main] INFO dev.snowdrop.buildpack.lifecycle.LifecyclePhaseFactory - - build volumes tidied up

@BarDweller

@cmoulliard
Copy link
Member

The process to build the sample samples/hello-spring seems to work as exit process left without error and we can launch the image built but we cannot access the spring boot application

podman run -p 8080:8080 snowdrop/hello-spring:latest 
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
    Calculating JVM memory based on 1606640K available memory
    For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
    Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx1221350K -XX:MaxMetaspaceSize=78089K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 1606640K, Thread Count: 50, Loaded Class Count: 11373, Headroom: 0%)
    Enabling Java Native Memory Tracking
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -XX:+ExitOnOutOfMemoryError -Djava.security.properties=/layers/paketo-community_ubi-java-buildpack/java-security-properties/java-security.properties -XX:ActiveProcessorCount=6 -XX:MaxDirectMemorySize=10M -Xmx1221350K -XX:MaxMetaspaceSize=78089K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.6.1)

2024-05-27 12:00:33.731  INFO 1 --- [           main] d.snowdrop.hellospring.DemoApplication   : Starting DemoApplication v0.0.3-SNAPSHOT using Java 17.0.11 on f29b53a91395 with PID 1 (/workspace/BOOT-INF/classes started by cnb in /workspace)
2024-05-27 12:00:33.743  INFO 1 --- [           main] d.snowdrop.hellospring.DemoApplication   : No active profile set, falling back to default profiles: default
2024-05-27 12:00:36.915  INFO 1 --- [           main] d.snowdrop.hellospring.DemoApplication   : Started DemoApplication in 5.086 seconds (JVM running for 7.029)

Native Memory Tracking:

Total: reserved=1790302718, committed=140655102
       malloc: 33327614 #83096
       mmap:   reserved=1756975104, committed=107327488

-                 Java Heap (reserved=1251999744, committed=35651584)
                            (mmap: reserved=1251999744, committed=35651584) 
 
-                     Class (reserved=67501386, committed=2227530)
                            (classes #4093)
                            (  instance classes #3770, array classes #323)
                            (malloc=392522 #8050) (peak=392866 #8053) 
                            (mmap: reserved=67108864, committed=1835008) 
                            (  Metadata:   )
                            (    reserved=67108864, committed=11730944)
                            (    used=11582800)
                            (    waste=148144 =1.26%)
                            (  Class space:)
                            (    reserved=67108864, committed=1835008)
                            (    used=1722936)
                            (    waste=112072 =6.11%)
 
-                    Thread (reserved=20032144, committed=993936)
                            (thread #19)
                            (stack: reserved=19972096, committed=933888)
                            (malloc=35400 #142) (peak=47432 #158) 
                            (arena=24648 #43) (peak=252544 #41)
 
-                      Code (reserved=254051016, committed=9999048)
                            (malloc=418504 #2977) (at peak) 
                            (mmap: reserved=253632512, committed=9580544) 
 
-                        GC (reserved=93456297, committed=48318377)
                            (malloc=13125545 #1729) (peak=13125585 #1730) 
                            (mmap: reserved=80330752, committed=35192832) 
 
-                  Compiler (reserved=1825676, committed=1825676)
                            (malloc=9812 #193) (peak=39124 #194) 
                            (arena=1815864 #16) (peak=21649792 #19)
 
-                  Internal (reserved=241043, committed=241043)
                            (malloc=204179 #3521) (peak=205413 #3528) 
                            (mmap: reserved=36864, committed=36864) 
 
-                    Symbol (reserved=3454000, committed=3454000)
                            (malloc=3085360 #64410) (at peak) 
                            (arena=368640 #1) (at peak)
 
-    Native Memory Tracking (reserved=1347744, committed=1347744)
                            (malloc=18208 #304) (peak=18792 #311) 
                            (tracking overhead=1329536)
 
-        Shared class space (reserved=16777216, committed=12357632)
                            (mmap: reserved=16777216, committed=12357632) 
 
-               Arena Chunk (reserved=12337480, committed=12337480)
                            (malloc=12337480 #497) (peak=22063224 #560) 
 
-                   Tracing (reserved=345, committed=345)
                            (malloc=345 #9) (at peak) 
 
-                 Arguments (reserved=171, committed=171)
                            (malloc=171 #5) (at peak) 
 
-                    Module (reserved=49760, committed=49760)
                            (malloc=49760 #649) (at peak) 
 
-                 Safepoint (reserved=8192, committed=8192)
                            (mmap: reserved=8192, committed=8192) 
 
-           Synchronization (reserved=43176, committed=43176)
                            (malloc=43176 #543) (peak=43280 #544) 
 
-            Serviceability (reserved=672, committed=672)
                            (malloc=672 #6) (at peak) 
 
-                 Metaspace (reserved=67171792, committed=11793872)
                            (malloc=62928 #33) (at peak) 
                            (mmap: reserved=67108864, committed=11730944) 
 
-      String Deduplication (reserved=704, committed=704)
                            (malloc=704 #8) (at peak) 
 
-           Object Monitors (reserved=4160, committed=4160)
                            (malloc=4160 #20) (at peak) 

in a separate terminal
curl -v http://localhost:8080/hello
*   Trying [::1]:8080...
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1:8080...
* connect to 127.0.0.1 port 8080 failed: Connection refused
* Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server
* Closing connection
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server

@BarDweller

@BarDweller
Copy link
Collaborator Author

The project is using a old java JDK

    <java.source>1.8</java.source>
    <java.target>1.8</java.target>

We should certainly bump it. WDYT ? @BarDweller

iirc, 1.8 was being used to ensure the created library would be consumable by projects running on java 8 jvms.. I'd need to dig to look into why, but that isn't something that will be addressed in this PR.

@BarDweller
Copy link
Collaborator Author

The process to build the sample samples/hello-spring seems to work as exit process left without error and we can launch the image built but we cannot access the spring boot application

podman run -p 8080:8080 snowdrop/hello-spring:latest 
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
    Calculating JVM memory based on 1606640K available memory
    For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
    Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx1221350K -XX:MaxMetaspaceSize=78089K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 1606640K, Thread Count: 50, Loaded Class Count: 11373, Headroom: 0%)
    Enabling Java Native Memory Tracking
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -XX:+ExitOnOutOfMemoryError -Djava.security.properties=/layers/paketo-community_ubi-java-buildpack/java-security-properties/java-security.properties -XX:ActiveProcessorCount=6 -XX:MaxDirectMemorySize=10M -Xmx1221350K -XX:MaxMetaspaceSize=78089K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.6.1)

2024-05-27 12:00:33.731  INFO 1 --- [           main] d.snowdrop.hellospring.DemoApplication   : Starting DemoApplication v0.0.3-SNAPSHOT using Java 17.0.11 on f29b53a91395 with PID 1 (/workspace/BOOT-INF/classes started by cnb in /workspace)
2024-05-27 12:00:33.743  INFO 1 --- [           main] d.snowdrop.hellospring.DemoApplication   : No active profile set, falling back to default profiles: default
2024-05-27 12:00:36.915  INFO 1 --- [           main] d.snowdrop.hellospring.DemoApplication   : Started DemoApplication in 5.086 seconds (JVM running for 7.029)

Native Memory Tracking:

Total: reserved=1790302718, committed=140655102
       malloc: 33327614 #83096
       mmap:   reserved=1756975104, committed=107327488

-                 Java Heap (reserved=1251999744, committed=35651584)
                            (mmap: reserved=1251999744, committed=35651584) 
 
-                     Class (reserved=67501386, committed=2227530)
                            (classes #4093)
                            (  instance classes #3770, array classes #323)
                            (malloc=392522 #8050) (peak=392866 #8053) 
                            (mmap: reserved=67108864, committed=1835008) 
                            (  Metadata:   )
                            (    reserved=67108864, committed=11730944)
                            (    used=11582800)
                            (    waste=148144 =1.26%)
                            (  Class space:)
                            (    reserved=67108864, committed=1835008)
                            (    used=1722936)
                            (    waste=112072 =6.11%)
 
-                    Thread (reserved=20032144, committed=993936)
                            (thread #19)
                            (stack: reserved=19972096, committed=933888)
                            (malloc=35400 #142) (peak=47432 #158) 
                            (arena=24648 #43) (peak=252544 #41)
 
-                      Code (reserved=254051016, committed=9999048)
                            (malloc=418504 #2977) (at peak) 
                            (mmap: reserved=253632512, committed=9580544) 
 
-                        GC (reserved=93456297, committed=48318377)
                            (malloc=13125545 #1729) (peak=13125585 #1730) 
                            (mmap: reserved=80330752, committed=35192832) 
 
-                  Compiler (reserved=1825676, committed=1825676)
                            (malloc=9812 #193) (peak=39124 #194) 
                            (arena=1815864 #16) (peak=21649792 #19)
 
-                  Internal (reserved=241043, committed=241043)
                            (malloc=204179 #3521) (peak=205413 #3528) 
                            (mmap: reserved=36864, committed=36864) 
 
-                    Symbol (reserved=3454000, committed=3454000)
                            (malloc=3085360 #64410) (at peak) 
                            (arena=368640 #1) (at peak)
 
-    Native Memory Tracking (reserved=1347744, committed=1347744)
                            (malloc=18208 #304) (peak=18792 #311) 
                            (tracking overhead=1329536)
 
-        Shared class space (reserved=16777216, committed=12357632)
                            (mmap: reserved=16777216, committed=12357632) 
 
-               Arena Chunk (reserved=12337480, committed=12337480)
                            (malloc=12337480 #497) (peak=22063224 #560) 
 
-                   Tracing (reserved=345, committed=345)
                            (malloc=345 #9) (at peak) 
 
-                 Arguments (reserved=171, committed=171)
                            (malloc=171 #5) (at peak) 
 
-                    Module (reserved=49760, committed=49760)
                            (malloc=49760 #649) (at peak) 
 
-                 Safepoint (reserved=8192, committed=8192)
                            (mmap: reserved=8192, committed=8192) 
 
-           Synchronization (reserved=43176, committed=43176)
                            (malloc=43176 #543) (peak=43280 #544) 
 
-            Serviceability (reserved=672, committed=672)
                            (malloc=672 #6) (at peak) 
 
-                 Metaspace (reserved=67171792, committed=11793872)
                            (malloc=62928 #33) (at peak) 
                            (mmap: reserved=67108864, committed=11730944) 
 
-      String Deduplication (reserved=704, committed=704)
                            (malloc=704 #8) (at peak) 
 
-           Object Monitors (reserved=4160, committed=4160)
                            (malloc=4160 #20) (at peak) 

in a separate terminal
curl -v http://localhost:8080/hello
*   Trying [::1]:8080...
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1:8080...
* connect to 127.0.0.1 port 8080 failed: Connection refused
* Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server
* Closing connection
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server

@BarDweller

There is no application to access.. the spring boot code contains no resources for you to access, and never has. It has only ever been there to test that the library can build the application successfully.

@BarDweller
Copy link
Collaborator Author

The main README explaining how to use ./pack.java for a sample

...
./pack.java

The samples use jbang too, but allow the version of the library to be set via an env var for use in our tests! [samples](./samples).

should also explain what to do when the image has been built

When the image has been built, run locally `podman run -i --rm -p 8080:8080 snowdrop/hello-quarkus:latest`

@BarDweller

The readme is talking about how to run the sample of code provided, and links to the samples by way for further examples of using jbang.. in the case of the supplied code fragment.. we cannot tell someone how to run an image built from code we do not know, and the intent & meaning for this part of the README has not been changed by this PR. If you think this needs addressing, please raise an Issue.

@BarDweller
Copy link
Collaborator Author

Why don't we mention end of the building process of a sample that an image has been built ?

./pack.java
...
2024-05-27T13:55:54+02:00 Reading buildpack directory item: web-application-type.toml
2024-05-27T13:55:54+02:00 Reusing tarball for layer "paketo-buildpacks/spring-boot:spring-cloud-bindings" with SHA: sha256:226bdd0803ccc2fdbfd32b27e9c850e95090f0cfd539fcf259b9dc8eaa55bb9e
2024-05-27T13:55:54+02:00 Adding cache layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings'
2024-05-27T13:55:54+02:00 Layer 'paketo-buildpacks/spring-boot:spring-cloud-bindings' SHA: sha256:226bdd0803ccc2fdbfd32b27e9c850e95090f0cfd539fcf259b9dc8eaa55bb9e
2024-05-27T13:55:54+02:00 Found SBOM of type cache for at /layers/sbom/cache
2024-05-27T13:55:54+02:00 Reusing tarball for layer "buildpacksio/lifecycle:cache.sbom" with SHA: sha256:ba3d34b908554bea571a01346c79e1c942fab1c40d5069c5ab2742bbd7332880
2024-05-27T13:55:54+02:00 Adding cache layer 'buildpacksio/lifecycle:cache.sbom'
2024-05-27T13:55:54+02:00 Layer 'buildpacksio/lifecycle:cache.sbom' SHA: sha256:ba3d34b908554bea571a01346c79e1c942fab1c40d5069c5ab2742bbd7332880
2024-05-27T13:55:54+02:00 Timer: Cache ran for 1.873783544s and ended at 2024-05-27T11:55:54Z
[main] INFO dev.snowdrop.buildpack.lifecycle.phases.Exporter - Buildpack export container complete, with exit code 0
[main] INFO dev.snowdrop.buildpack.lifecycle.LifecyclePhaseFactory - - tidying up the build volumes
[main] INFO dev.snowdrop.buildpack.lifecycle.LifecyclePhaseFactory - - build volumes tidied up

@BarDweller

Because we never have tested this, and this PR doesn't alter that.

The library returns an exit code, and really, the pack.java is just there to check it all works.

The library should not be mentioning anything, you are viewing the trace logs & info logs output by the lib, which confirm it did its job correctly.. the exit code tells the caller if it worked, and its up to the caller to decide what to do with that status.. in this case, the caller is pack.java, which takes that exit code and makes it its own, which should cause the integration test to fail if the library invocation failed. If you want to raise an Issue to make the sample pack.java also output human friendly messages, go ahead..

@cmoulliard
Copy link
Member

There is no application to access.. the spring boot code contains no resources for you to access, and never has. It has only ever been there to test that the library can build the application successfully.

Ok. So we will in a separate PR improve the Spring Boot example or add a README to mention what is the purpose of this sample then

@cmoulliard
Copy link
Member

If you want to raise an Issue to make the sample pack.java also output human friendly messages, go ahead..

Will do that :-)

@BarDweller
Copy link
Collaborator Author

Tests are green, review comments have been met, and @cmoulliard has indicated via zulip that this is good to merge..

@BarDweller BarDweller merged commit e109913 into snowdrop:main Jun 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants