Skip to content

compose: adjust image load options for containerd storage#132

Merged
mike-sul merged 3 commits intomainfrom
feat/image-load-progress-for-docker-v29
Apr 21, 2026
Merged

compose: adjust image load options for containerd storage#132
mike-sul merged 3 commits intomainfrom
feat/image-load-progress-for-docker-v29

Conversation

@mike-sul
Copy link
Copy Markdown
Collaborator

@mike-sul mike-sul commented Apr 16, 2026

Detect when the Docker daemon is backed by containerd snapshotter storage and apply compatible image load behavior and progress reporting.

This prevents load failures and avoids misleading progress reporting when running against containerd-backed Docker engines.

Detect when the Docker daemon is backed by containerd snapshotter storage
and apply compatible image load behavior.

When containerd storage is in use:
- disable ReadBlobsFromStore since loading layers from an external blob
  directory is not supported
- disable ProgressReporter because image load progress is not reported
- return early after ImageLoad, skipping progress stream decoding

This prevents load failures and avoids misleading progress reporting when
running against containerd-backed Docker engines.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
@mike-sul mike-sul force-pushed the feat/image-load-progress-for-docker-v29 branch from 5d75c20 to 89d7f34 Compare April 17, 2026 07:23
@mike-sul mike-sul marked this pull request as ready for review April 17, 2026 07:58
@mike-sul mike-sul requested a review from detsch April 17, 2026 07:59
@mike-sul
Copy link
Copy Markdown
Collaborator Author

@detsch This is adjustment required to make the image loading work completely correctly against the docker daemon that uses containerd storage.

@mike-sul mike-sul force-pushed the feat/image-load-progress-for-docker-v29 branch from 89d7f34 to c482308 Compare April 17, 2026 08:16
Add containerd-specific progress handling when loading images.

Since containerd-backed Docker engines do not emit standard layer progress
events, parse the ImageLoad response stream for "Loaded image:" messages
and translate them into image-level progress updates.

Changes include:
- add ImageLoadStateImageLoading state
- emit initial image loading progress before import starts
- emit image loading/loaded progress for containerd image imports
- detect and surface unpacking errors from the response stream
- update status printer to render image-level loading messages

This preserves user-visible progress feedback on containerd systems while
remaining compatible with standard Docker layer progress reporting.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
Refactor LoadImages by extracting Docker-specific progress stream
handling into reportProgressIfDocker().

This removes the large state machine from LoadImages, reducing
cyclomatic complexity and making the main flow easier to follow.

Changes include:
- delegate Docker progress parsing to reportProgressIfDocker()
- keep containerd progress handling in reportProgressIfContainerd()
- simplify runtime branching between Docker and containerd paths

No functional changes intended.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
@mike-sul mike-sul force-pushed the feat/image-load-progress-for-docker-v29 branch from c482308 to 68447a4 Compare April 17, 2026 08:36
@mike-sul
Copy link
Copy Markdown
Collaborator Author

@doanac FYI

@mike-sul mike-sul merged commit 0977b68 into main Apr 21, 2026
4 checks passed
@mike-sul mike-sul deleted the feat/image-load-progress-for-docker-v29 branch April 21, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants