postgis / docker-postgis

Docker image for PostGIS
https://hub.docker.com/r/postgis/postgis/
MIT License
1.35k stars 461 forks source link

add Dive CI Integration for checking WastedBytes #340

Open ImreSamu opened 1 year ago

ImreSamu commented 1 year ago

See https://github.com/wagoodman/dive#ci-integration Reason: https://github.com/postgis/docker-postgis/issues/339#issuecomment-1416830159 ( Alpine WastedBytes = 263 MB ! )

PiyushRaj927 commented 11 months ago

Hey @ImreSamu, I'm developing an open-source action that utilizes Dive for image analysis and size tracking in pull requests. I'd like to work on this issue to gain insight into the essential features I should include in my action. Could you please let me know your requirements so I can consider them while building it? Thanks!

Currently, my implementation comments the analysis details on the PR using workflow_run event. Here's the format of the comment:

:bar_chart: bitnami Image Analysis (Commit: [commit] )

Summary

Inefficient Files:

Count Wasted Space File Path
2 14 MB /opt/bitnami/postgresql/share/contrib/postgis-3.3/spatial_ref_sys.sql
2 9.3 MB /opt/bitnami/postgresql/lib/postgis-3.so
2 8.7 MB /usr/lib/x86_64-linux-gnu/perl/5.32.1/CORE/charclass_invlists.h
3 7.4 MB /usr/lib/x86_64-linux-gnu/libperl.so.5.32.1
2 6.7 MB /usr/lib/git-core/git
3 6.7 MB /usr/bin/git
2 5.5 MB /usr/lib/x86_64-linux-gnu/perl/5.32.1/auto/Encode/JP/JP.so
2 5.0 MB /opt/bitnami/postgresql/lib/postgis_raster-3.so
2 4.8 MB /usr/lib/x86_64-linux-gnu/perl/5.32.1/auto/Encode/KR/KR.so
2 4.2 MB /usr/lib/x86_64-linux-gnu/perl/5.32.1/auto/Encode/CN/CN.so
ImreSamu commented 11 months ago

I'm developing an open-source action that utilizes Dive .... ... Could you please let me know your requirements so I can consider them while building it? Thanks! ... Currently, my implementation comments the analysis details on the PR ...

Hi @PiyushRaj927,

Thank you for your interest. At the moment, my ideas for the ideal solution are still somewhat vague, but I'd like to highlight three main points:

1.) It's important to note that currently we are creating 17 different Docker images, which is expected to increase by an additional 5 new bookworm images in the near future. Consequently, providing an individual comment for each of these 17+5 image analyses would be excessive.

Thus, it would be desirable to have a single consolidated analysis (comment) for the 17 images and, if possible, to arrange them into groups since we are working with three basic templates (Alpine, Debian, Master) and, therefore, the causes of some type errors are to be found here.

see the current jobs matrix : https://github.com/postgis/docker-postgis/blob/master/.github/workflows/main.yml

2.) The 17 images are automatically regenerated every Monday morning, and due to upstream changes, problems (e.g., size increase due to an LLVM update) might only be detected at this point. In such cases, it would be good to receive a "warning".

3.) It would be useful to distinguish between two causes of size increase:

a.) Size increase attributable to external system updates and upstream image issues (In our case, this could be detected by finding file names causing the size increase that contain ~ 'llvm|ssl|crypt' ) --> A "Warning" message would be ideal in this case.

b.) If the size increase is due to non-compliance with Docker image best practices, which typically includes everything not covered in the previous (3a) point --> In this case, the check should stop and signal the problem with an appropriate message.


It's important to note that these thoughts are my personal ideas, which may later be refined, modified, or changed. Moreover, these haven't been discussed yet with the other contributors at the repository level.