Skip to content

Use pzstd to compress the Docker in SWI slim images#21852

Merged
yxieca merged 2 commits intosonic-net:masterfrom
lipxu:20250225_publicMaster_pzstd
Feb 26, 2025
Merged

Use pzstd to compress the Docker in SWI slim images#21852
yxieca merged 2 commits intosonic-net:masterfrom
lipxu:20250225_publicMaster_pzstd

Conversation

@lipxu
Copy link
Contributor

@lipxu lipxu commented Feb 25, 2025

Why I did it

Same with #21824

Enabled the docker inram feature for slim image.
It would extract the docker image to ram during the boot, so it would take extra times during boot.

Work item tracking
  • Microsoft ADO (number only):
    31323281

How I did it

Use pzstd which is more efficient tool to compress and decompress the docker file to reduce the boot time.
Currently, we do not modify the "FILESYSTEM_DOCKERFS=dockerfs.tar.gz" in onie-image.conf, so for slim image, we still use dockerfs.tar.gz as file name but actually with zstd compressed.
We tried to find out a way to adjust the file name in onie-image.conf, but it seems not easy to do that.
So we use the file cmd to determine the compressing type in union-mount.j2, then use the related cmd to extract the docker file.
Plan to support zstd for all types of images in the future to unify the docker file image .

How to verify it

Boot swi slim image and normal image, boot mellanox bin image, all boot successfully.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@lipxu lipxu requested a review from lguohan as a code owner February 25, 2025 15:42
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yxieca yxieca merged commit 5a32f61 into sonic-net:master Feb 26, 2025
21 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #21869

miatttao pushed a commit to miatttao/sonic-buildimage that referenced this pull request Mar 5, 2025
Why I did it
Enabled the docker inram feature for slim image.
It would extract the docker image to ram during the boot, so it would take extra times during boot.

Work item tracking
Microsoft ADO (number only):
31323281

How I did it
Use pzstd which is more efficient tool to compress and decompress the docker file to reduce the boot time.
Currently, we do not modify the "FILESYSTEM_DOCKERFS=dockerfs.tar.gz" in onie-image.conf, so for slim image, we still use dockerfs.tar.gz as file name but actually with zstd compressed.
We tried to find out a way to adjust the file name in onie-image.conf, but it seems not easy to do that.
So we use the file cmd to determine the compressing type in union-mount.j2, then use the related cmd to extract the docker file.
Plan to support zstd for all types of images in the future to unify the docker file image .

How to verify it
Boot swi slim image and normal image, boot mellanox bin image, all boot successfully.
@andywongarista
Copy link
Contributor

@lipxu @StormLiangMS shouldn't this also be cherry picked to 202411?

@lipxu
Copy link
Contributor Author

lipxu commented Mar 7, 2025

@lipxu @StormLiangMS shouldn't this also be cherry picked to 202411?

Thanks for reminder, @andywongarista , should be in 202411, let me add the label. And I think we should consider to support both zstd and gz for all images in the further.

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #22005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants