MonkeyCanCode opened a new pull request, #1010:
URL: https://github.com/apache/polaris/pull/1010

   This PR fixed inconsistent image build issue after a successful build is 
made already. It contains two changes:
   1. add `clean` to the build command
   2. disable gradle build cache when building image
   
   Here are the test:
   
   # Happy path (first time building)
   ```
   ➜  polaris git:(main) docker images
   REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
   ➜  polaris git:(main) ./gradlew :polaris-quarkus-server:assemble 
:polaris-quarkus-admin:assemble \
       -Dquarkus.container-image.build=true \
       -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \
   ...
   BUILD SUCCESSFUL in 38s
   115 actionable tasks: 98 executed, 17 up-to-date
   ➜  polaris git:(main) docker images
   REPOSITORY                  TAG                         IMAGE ID       
CREATED          SIZE
   apache/polaris-admin-tool   1.0.0-incubating-SNAPSHOT   4162495a3d93   29 
seconds ago   535MB
   apache/polaris-admin-tool   latest                      4162495a3d93   29 
seconds ago   535MB
   apache/polaris              1.0.0-incubating-SNAPSHOT   1d48a4908017   29 
seconds ago   633MB
   apache/polaris              latest                      1d48a4908017   29 
seconds ago   633MB
   ```
   
   # Un-happy paths
   ## users removed the images then reran the same command to get images back
   ```
   ➜  polaris git:(main) ./gradlew :polaris-quarkus-server:assemble 
:polaris-quarkus-admin:assemble \
       -Dquarkus.container-image.build=true \
       -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4
   ...
   BUILD SUCCESSFUL in 2s
   96 actionable tasks: 96 up-to-date
   ➜  polaris git:(main) docker images
   REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
   ```
   
   ## users removed the images then reran the same command to get images back 
with clean option
   ```
   ➜  polaris git:(main) ./gradlew clean :polaris-quarkus-server:assemble 
:polaris-quarkus-admin:assemble \
       -Dquarkus.container-image.build=true \
       -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4
   ...
   BUILD SUCCESSFUL in 13s
   115 actionable tasks: 72 executed, 26 from cache, 17 up-to-date
   ➜  polaris git:(main) docker images
   REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
   ➜  polaris git:(main)
   ```
   
   ## users removed the images then reran the same command to get images back 
with no-cache option
   ```
   ➜  polaris git:(main) ./gradlew :polaris-quarkus-server:assemble 
:polaris-quarkus-admin:assemble \
       -Dquarkus.container-image.build=true \
       -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \
       --no-build-cache
   ...
   BUILD SUCCESSFUL in 2s
   96 actionable tasks: 96 up-to-date
   ➜  polaris git:(main) docker images
   REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
   ```
   
   # With the purposed change:
   ```
   ➜  polaris git:(main) ./gradlew clean :polaris-quarkus-server:assemble 
:polaris-quarkus-admin:assemble \
       -Dquarkus.container-image.build=true \
       -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \
       --no-build-cache
   ...
   BUILD SUCCESSFUL in 32s
   115 actionable tasks: 98 executed, 17 up-to-date
   ➜  polaris git:(main) docker images
   REPOSITORY                  TAG                         IMAGE ID       
CREATED          SIZE
   apache/polaris-admin-tool   1.0.0-incubating-SNAPSHOT   e771063a0c2b   10 
seconds ago   535MB
   apache/polaris-admin-tool   latest                      e771063a0c2b   10 
seconds ago   535MB
   apache/polaris              1.0.0-incubating-SNAPSHOT   78de7f511dcd   16 
seconds ago   633MB
   apache/polaris              latest                      78de7f511dcd   16 
seconds ago   633MB
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to