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

when pull container image within qm, always got a "no space left on device" error #439

Closed pengshanyu closed 2 months ago

pengshanyu commented 2 months ago

Test version: qm-101:0.6.4-1.20240517025031934468.main.3.g2e577bd.el9.noarch ( qm was installed from the "copr:copr.fedorainfracloud.org:rhcontainerbot:qm" repository)

Test steps:

  1. Download c9s cloud image and run VM locally. Refer to the steps in: https://github.com/containers/qm/tree/main/tests/e2e#run-tmt-tests-framework-locally
  2. run the ffi test plan to install and start qm
  3. do podman exec -it qm bash to get inside of qm
  4. do podman run --replace --name ffi-qm quay.io/centos-sig-automotive/ffi-tools:latest within qm

Test result: WARN[0000] Failed to decode the keys ["storage.options.overlay.use_composefs"] from "/usr/share/containers/storage.conf" Getting image source signatures Copying blob 1898396b8f9a skipped: already exists Copying blob a24bf8134cb4 [==========>---------------------------] 886.4MiB / 3.0GiB Error: writing blob: storing blob to file "/var/tmp/storage3081603575/1": write /var/tmp/storage3081603575/1: no space left on device

Yarboa commented 2 months ago

@dougsland

I suspect there is a mess with this https://github.com/containers/qm/blob/main/setup#L19 It has been removed from setup, all should be done through qm rpm, the logic moved to tools/qm-storage-settings, I assume it is not called through the rpm install

but I see this https://github.com/containers/qm/blob/main/setup#L15, is it calling the the qm-storage-settings?

https://github.com/containers/qm/blob/main/rpm/qm.spec#L97 should be called here, or in setup, isnt it?

dougsland commented 2 months ago

Few thoughts to move the missing bits from qm-settings-storage to sample-image (never tested): clone the sample-images repo

git clone --recursive https://gitlab.com/CentOS/automotive/sample-images.git

add /var/lib/shared to additional store

diff --git a/include/defaults.ipp.yml b/include/defaults.ipp.yml
index 2823983..18da528 100644
--- a/include/defaults.ipp.yml
+++ b/include/defaults.ipp.yml
@@ -190,7 +190,7 @@ mpp-vars:
   default_container_entrypoint: []
   default_use_containers_extra_store: false
   default_use_qm_containers_extra_store: false
-  default_containers_extra_store: /usr/share/containers/storage
+  default_containers_extra_store: /usr/share/containers/storage, /var/lib/shared
   default_qm_containers_extra_store: /usr/share/containers/storage
   default_containers_transient_store: true
   default_containers_read_only: true

Also add this logic (below) to container.conf that we ship as the sample-images copy to /etc during install:

 if test -f "${ROOTFS}/etc/containers/containers.conf"; then
        mkdir -p "${ROOTFS}/var/${TMP_QM_IMG_DIR}"
        cat >> "${ROOTFS}/etc/containers/containers.conf" <<EOF
[engine]
env = ["TMPDIR=/var/${TMP_QM_IMG_DIR}"]
EOF
    fi

From sample-images (automotive-image-builder/include/qm.ipp.yml):

       - from: input://tree/usr/share/qm/containers.conf
              to: tree:///etc/containers/containers.conf

cc @Yarboa