containers / qm

QM is a containerized environment for running Functional Safety qm (Quality Management) software
https://github.com/containers/qm
GNU General Public License v2.0
20 stars 20 forks source link

Reduce the image size of FFI-tools: https://gitlab.com/CentOS/automotive/container-images/ffi-tools/ #447

Open dougsland opened 1 month ago

dougsland commented 1 month ago

This is not related to QM but I believe we can help there, let's track here so as soon we have a free cycle from validators effort we can improve things in the ffi-tools image size too.

cc @dougsland @Yarboa @telemaco @michalskrivanek

Original thread: https://github.com/containers/qm/pull/444

Related-to: tests/ffi/qm-oom-score-adj/main.fmf

[michalskrivanek](https://github.com/michalskrivanek) reviewed [yesterday](https://github.com/containers/qm/pull/444#pullrequestreview-2081081305)
[tests/ffi/qm-oom-score-adj/test.sh](https://github.com/containers/qm/pull/444/files/398f5ef610ff15749efe1367f35510d8d1208d1d#diff-5f6a63c1d7170b9cb7f9a29c92a71c118b9f1f72cc1e74b29207b2993649f3de)
image_id=$(podman images | grep quay.io/centos-sig-automotive/ffi-tools | awk -F " " '{print $3}')
if [ ! -d "${QM_HOST_REGISTRY_DIR}" ]; then
    exec_cmd "mkdir -p ${QM_HOST_REGISTRY_DIR}"
    exec_cmd "podman push ${image_id} dir:${QM_HOST_REGISTRY_DIR}/tools-ffi:latest"
@[michalskrivanek](https://github.com/michalskrivanek) michalskrivanek yesterday
IIUC this is 1.5GB. taht's going to take a while for no good reason. Unless there is a plan to use the same container inside QM for other test of course

@[michalskrivanek](https://github.com/michalskrivanek) michalskrivanek yesterday
actually, this one (in quay.io) is actually 3.34 GB

Member
@[dougsland](https://github.com/dougsland) dougsland yesterday
@Yarboa don't we have the version with the --build-arg shortbuild=yes  available somewhere?

From:
https://gitlab.com/CentOS/automotive/container-images/ffi-tools/

Thin image:
In case of testing only, add the following --build-arg shortbuild=yes to build command
# podman build -f Containerfile --build-arg shortbuild=yes --cap-add=sys_admin -t localhost/ffi-tools:latest .
Author
@[telemaco](https://github.com/telemaco) telemaco yesterday
@dougsland @Yarboa Is there any problem to use an alpine:latest image instead the tool-ffi:latest?

Member
@[dougsland](https://github.com/dougsland) dougsland yesterday
@odra for the shortversion question.

Member
@[dougsland](https://github.com/dougsland) dougsland yesterday
@telemaco I am always in favor of eating our own food but I understand your concern. I was thinking here, should we change the logic: thin version as default and make the fat version as the optional?
@odra @Yarboa do you think we can make this happen?

Member
@[Yarboa](https://github.com/Yarboa) Yarboa yesterday • 
Actually, everything is ready for that
Opened an issue,
https://gitlab.com/CentOS/automotive/container-images/ffi-tools/-/issues/2

Will work on that
Anyway, once tests are running one after each other, unless qm reboot container persist for other tests of qm

@[michalskrivanek](https://github.com/michalskrivanek) michalskrivanek 11 hours ago
1.5GB is a lot better than 3.5 GB, but it still leaves a lot to be desired. I think generally the test duration would greatly benefit of some generic optimizations (limiting number of layers, cleanup of caches) - none of that is done ATM so now wonder these images are monstrous.
It takes MINUTES to copy such amount of data on weaker boards

Member
@[Yarboa](https://github.com/Yarboa) Yarboa 5 hours ago • 
@michalskrivanek you are correct,
related to (limiting number of layers, cleanup of caches)
this one was not defined yet,
Currently we are running c9s and other SoC which are more powerfull.

I advise to open a detailed ticket for that, with tests definitions
We could also maintain lighter image for testing