Enhance Containerfile to include koku-ui-sources package and build process#5124
Enhance Containerfile to include koku-ui-sources package and build process#5124rawagner merged 1 commit intoproject-koku:mainfrom
Conversation
…ocess Signed-off-by: Jonathan Kilzi <jkilzi@redhat.com>
There was a problem hiding this comment.
Code Review
This pull request integrates the koku-ui-sources sub-application into the koku-ui-onprem build process by adding the necessary copy and build steps to the Containerfile. Review feedback suggests optimizing the Docker build order to enhance layer caching efficiency and renaming the output directory for the sources application to costManagementSources to ensure consistency with existing sub-applications.
| RUN npm run build:onprem --workspace=@koku-ui/koku-ui-ros | ||
|
|
||
| COPY apps/koku-ui-sources ./apps/koku-ui-sources/ | ||
| RUN npm run build:onprem --workspace=@koku-ui/koku-ui-sources |
There was a problem hiding this comment.
The build order in this Containerfile is suboptimal for Docker layer caching and appears inconsistent with the build:onprem script in the root package.json. Currently, the main onprem application is built first (lines 17-18), which means any change to the onprem source code will invalidate the cache for all subsequent sub-app builds (hccm, ros, and sources). Following the order defined in package.json (ros -> hccm -> sources -> onprem) by moving the onprem build to the end of the builder stage would significantly improve build efficiency for the most frequent code changes.
| COPY --from=builder /app/apps/koku-ui-onprem/dist ./onprem | ||
| COPY --from=builder /app/apps/koku-ui-hccm/dist ./costManagement | ||
| COPY --from=builder /app/apps/koku-ui-ros/dist ./costManagementRos | ||
| COPY --from=builder /app/apps/koku-ui-sources/dist ./sources |
There was a problem hiding this comment.
To maintain consistency with the other sub-applications in the final image (costManagement and costManagementRos), consider naming the destination directory costManagementSources instead of sources. This aligns with the naming convention used for other Cost Management components.
COPY --from=builder /app/apps/koku-ui-sources/dist ./costManagementSources
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5124 +/- ##
=======================================
Coverage 80.08% 80.08%
=======================================
Files 578 578
Lines 12401 12401
Branches 2969 2965 -4
=======================================
Hits 9931 9931
Misses 2298 2298
Partials 172 172 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jonathan Kilzi jkilzi@redhat.com