ankaios icon indicating copy to clipboard operation
ankaios copied to clipboard

Re-use existing container bundles on device re-start

Open windsource opened this issue 9 months ago • 2 comments

Description

Currently as implemented in #5 existing containers in status "exited" will be deleted and re-created on device restart. Measurements have revealed that the creation of a container bundle takes about ~50% of the whole startup time. So starting an existing container bundle will save about 50% of the time compared to deleting and re-creating the bundle.

As startup time is crucial in automotive for certain applications, this issue should collect pros and cons to re-use existing container bundles in order speed-up startup.

Currently the procedure on agent start is something like

  1. Call podman ps -a to get all existing containers
  2. For each container matching the state
    1. If it is running keep it running
    2. If it is exited and shall be running call podman rm ... followed by podman run.

The proposed change is:

  1. Call podman ps -a to get all existing containers
  2. For each container matching the state
    1. If it is running keep it running
    2. If it is exited and shall be running call podman start ....

Pros:

  • Faster startup times
  • Less Flash wear out due to less write operations
  • Preparation for bundles residing on read-only partition (although for that a separate concept would be required)

Cons:

  • ...

Goals

Increase startup time for containers when container bundle already exists on disk.

Final result

Summary

To be filled when the final solution is sketched.

Tasks

  • [ ] Task 1
  • [ ] Task 2
  • [ ] ...

windsource avatar Apr 29 '24 12:04 windsource