Commit dc386ae
committed
perf(gnocchi): slim runtime image by ~50%
Cuts the Gnocchi container from ~4.8 GB uncompressed (1.6 GiB on GHCR)
to roughly 2.5 GB by removing files and packages the service never
uses at runtime.
Changes
- Strip unused Ceph libs from the dependency stage before they get
copied into the runtime: librbd, librgw, libcephfs, libcephsqlite.
Per upstream gnocchi setup.cfg the [ceph] extra has no python deps
and only requires librados via python3-rados, so RBD, CephFS, and
the RADOS gateway are dead weight (~1.3 GB).
- Drop server packages that snuck into the runtime image: postgresql
(server daemon — psycopg2 only needs libpq5, kept), memcached
(server daemon — tooz uses pymemcache, kept), and the full ceph
metapackage (replaced by librados from the dependency stage plus
python3-rados, both kept). The PostgreSQL, memcached, and Ceph
client paths are fully preserved.
- Fix the no-op `apt-get purge -y --auto-remove` by passing an
explicit BUILD_DEPS list (apache2-dev, build-essential, *-dev
headers, pkg-config, python3-dev). These were previously installed
to compile mod_wsgi and then never removed.
- Drop runtime-irrelevant packages: git, wget, docutils-common,
gettext, libjs-sphinxdoc, libjs-underscore.
- Add `--no-cache-dir` to pip installs and clean /root/.cache,
/tmp, and /var/tmp at the end of each stage.
Not changed
- ceph-libs base image (shared by other services, separate fix).
- /usr/local/lib/ceph/ plugin tree is kept so librados can load
erasure-code and compressor plugins for EC/compressed pools.
- scripts/gnocchi-cve-patching.sh runs identically.
- Trivy scanning workflow is untouched.1 parent 01bb7b7 commit dc386ae
1 file changed
Lines changed: 20 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
32 | 41 | | |
33 | 42 | | |
34 | 43 | | |
| |||
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
| 57 | + | |
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
51 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | | - | |
58 | 71 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 72 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 73 | | |
89 | 74 | | |
90 | | - | |
| 75 | + | |
| 76 | + | |
91 | 77 | | |
92 | 78 | | |
93 | | - | |
| 79 | + | |
94 | 80 | | |
95 | | - | |
| 81 | + | |
96 | 82 | | |
97 | 83 | | |
98 | 84 | | |
| |||
0 commit comments