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

cleanup nerdctl after nodeadm containerized build #1599

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

ndbaker1
Copy link
Member

@ndbaker1 ndbaker1 commented Jan 29, 2024

Issue #, if available:

Description of changes:

cleanup network and image resources used by nerdctl during the nodeadm build

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

capture the following in between steps of the build:

sudo nerdctl network list
sudo nerdctl image list
sudo ip link

after build:

2024-01-30T00:49:40Z:     amazon-ebs: NETWORK ID    NAME    FILE
2024-01-30T00:49:40Z:     amazon-ebs:               host
2024-01-30T00:49:40Z:     amazon-ebs:               none
2024-01-30T00:49:40Z:     amazon-ebs: REPOSITORY                                        TAG       IMAGE ID        CREATED          PLATFORM       SIZE         BLOB SIZE
2024-01-30T00:49:40Z:     amazon-ebs: public.ecr.aws/eks-distro-build-tooling/golang    1.21      3072b6e1ad77    2 minutes ago    linux/amd64    469.1 MiB    149.1 MiB
2024-01-30T00:49:40Z:     amazon-ebs: <none>                                            <none>    3072b6e1ad77    2 minutes ago    linux/amd64    469.1 MiB    149.1 MiB
2024-01-30T00:49:40Z:     amazon-ebs: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
2024-01-30T00:49:40Z:     amazon-ebs:     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2024-01-30T00:49:40Z:     amazon-ebs: 2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP mode DEFAULT group default qlen 1000
2024-01-30T00:49:40Z:     amazon-ebs:     link/ether 02:ea:1d:25:8f:eb brd ff:ff:ff:ff:ff:ff
2024-01-30T00:49:40Z:     amazon-ebs:     altname enp0s5
2024-01-30T00:49:40Z:     amazon-ebs:     altname eni-004bc029d3253c703
2024-01-30T00:49:40Z:     amazon-ebs:     altname device-number-0

after cleanup: (the additions in the PR)

2024-01-30T00:49:41Z:     amazon-ebs: NETWORK ID    NAME    FILE
2024-01-30T00:49:41Z:     amazon-ebs:               host
2024-01-30T00:49:41Z:     amazon-ebs:               none
2024-01-30T00:49:41Z:     amazon-ebs: REPOSITORY    TAG    IMAGE ID    CREATED    PLATFORM    SIZE    BLOB SIZE
2024-01-30T00:49:41Z:     amazon-ebs: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
2024-01-30T00:49:41Z:     amazon-ebs:     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2024-01-30T00:49:41Z:     amazon-ebs: 2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP mode DEFAULT group default qlen 1000
2024-01-30T00:49:41Z:     amazon-ebs:     link/ether 02:ea:1d:25:8f:eb brd ff:ff:ff:ff:ff:ff
2024-01-30T00:49:41Z:     amazon-ebs:     altname enp0s5
2024-01-30T00:49:41Z:     amazon-ebs:     altname eni-004bc029d3253c703
2024-01-30T00:49:41Z:     amazon-ebs:     altname device-number-0

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

@@ -13,6 +13,10 @@ sudo nerdctl run \
public.ecr.aws/eks-distro-build-tooling/golang:1.21 \
make build

# cleanup images and networks used for nerdctl
Copy link
Member

Choose a reason for hiding this comment

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

do we need to add corresponding test/verification after AMI build?

Copy link
Member Author

@ndbaker1 ndbaker1 Jan 29, 2024

Choose a reason for hiding this comment

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

can definitely do this, let me see if i can setup a comprehensive validation

Copy link
Member Author

Choose a reason for hiding this comment

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

what test would be most effective? not 100% sure about network guarantees, like checking interface names/count. the existence of nerdctl0 is crude but works i guess. any thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I think at build AMI level, check the existence of nerdctl0 would be a good start point

@ndbaker1
Copy link
Member Author

ndbaker1 commented Jan 30, 2024

having issues with sudo nerdctl images --quiet --filter=dangling=true, it works locally but in ami build says

FATA[0000] invalid filter "dangling=true"

key-value not being parsed correctly?

@ndbaker1 ndbaker1 force-pushed the nerdctl-cleanup branch 2 times, most recently from 595e1df to bbb7256 Compare January 30, 2024 00:58
@ndbaker1
Copy link
Member Author

resorted to a more direct method of parsing nerdctl images, but assuming it's due to the version of nerdctl included with al2023

@Issacwww Issacwww merged commit 8e9cddf into awslabs:al2023 Jan 30, 2024
8 checks passed
@ndbaker1 ndbaker1 deleted the nerdctl-cleanup branch January 30, 2024 06:23
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