Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using discard_unpacked_layers with CRI to reduce the size on disk of the cached images #5077

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

djsly
Copy link
Contributor

@djsly djsly commented Oct 11, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:
Reducing the Packed Image layers (content) under /var/lib/containerd folder, this data is not used normally for creating container, it's used for republishing. CRICTL allows for this storage to be dleeted post unpacking, using the CRI flag
Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none


disable_containerd_discard_unpacked_layers() {
Copy link
Collaborator

@cameronmeissner cameronmeissner Oct 11, 2024

Choose a reason for hiding this comment

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

will this preserve our ability to do retagging for china cloud at runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm reenabling it at the end. I will need to test. This is on my bucket list. to see what will happen. I guess we dont have an e2e for that right ?

@djsly djsly force-pushed the djsly/reducevhdsize/remove-packed-image-layers branch from 85351c4 to 684823e Compare October 20, 2024 01:30
@@ -80,5 +80,5 @@ EVENT_JSON=$( jq -n \
--arg EventTid "0" \
'{Timestamp: $Timestamp, OperationId: $OperationId, Version: $Version, TaskName: $TaskName, EventLevel: $EventLevel, Message: $Message, EventPid: $EventPid, EventTid: $EventTid}'
)

mkdir -p ${EVENTS_LOGGING_DIR}
Copy link
Collaborator

@cameronmeissner cameronmeissner Oct 21, 2024

Choose a reason for hiding this comment

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

we shouldn't need to do this, WALinuxAgent will do this as a part of executing the extension

@@ -5,7 +5,12 @@ retrycmd_get_tarball() {
tar_retries=$1; wait_sleep=$2; tarball=$3; url=$4
echo "${tar_retries} retries"
for i in $(seq 1 $tar_retries); do
tar -tzf $tarball && break || \
if [ -f $tarball ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this an unrelated change?

@@ -69,5 +69,5 @@ func ListImages(sku, version string) (*List, error) {
}

func isID(imageName string) bool {
return strings.Contains(imageName, "sha256")
return (strings.Contains(imageName, "sha256") && !strings.HasPrefix(imageName, "sha256:"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return (strings.Contains(imageName, "sha256") && !strings.HasPrefix(imageName, "sha256:"))
return strings.Contains(imageName, "sha256") && !strings.HasPrefix(imageName, "sha256:")

@ganeshkumarashok
Copy link
Contributor

There are merge conflicts because of the other CSE changes - we need to rebase again

tar -tzf $tarball
if [ $? -eq 0 ]; then
break
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change necessary?

else
# this is only called during cse. VHDs should have crictl binaries pre-cached so no need to download.
# if the vhd does not have crictl pre-baked, return early
CRICTL_TGZ_TEMP="crictl-v${CRICTL_VERSION}-linux-${CPU_ARCH}.tar.gz"
CRICTL_TGZ_TEMP="crictl-v${crictlVersion}-linux-${CPU_ARCH}.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

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

is crictlVersion being set properly? I don't see it being passed to installCrictl during CSE but maybe I'm missing that

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.

3 participants