Skip to content

add additional tools#818

Open
bcressey wants to merge 3 commits intobottlerocket-os:developfrom
bcressey:add-packages
Open

add additional tools#818
bcressey wants to merge 3 commits intobottlerocket-os:developfrom
bcressey:add-packages

Conversation

@bcressey
Copy link
Contributor

@bcressey bcressey commented Feb 3, 2026

Issue number:
N/A

Description of changes:
I've carried these packages in my local tree for a while; they all seem like useful additions.

  1. erofs-utils - I'd like to switch over to the erofs snapshotter for containerd at some point, or make that a configurable option.
  2. cri-tools - crictl is useful to exercise containerd's CRI interface specifically. Can be updated when we add a new kubelet package.
  3. perf - perf is essential for profiling performance. Can be updated when we add a new kernel.

Testing done:

perf top works
   PerfTop:      24 irqs/sec  kernel:83.3%  exact:  0.0% lost: 0/0 drop: 0/0 [4000Hz cycles:P],  (all, 1 CPU)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    19.65%  [kernel]       [k] finish_task_switch.isra.0
    13.40%  [kernel]       [k] default_idle_call
    12.33%  [kernel]       [k] uart_write
     4.15%  [kernel]       [k] arch_local_irq_restore
     2.08%  [kernel]       [k] tick_nohz_idle_exit
     1.51%  [kernel]       [k] el0_svc
crictl can pull and inspect images
bash-5.2# crictl pull amazonlinux:2023
WARN[0000] Config "/etc/crictl.yaml" does not exist, trying next: "/aarch64-bottlerocket-linux-gnu/sys-root/usr/bin/crictl.yaml"
WARN[0000] Image connect using default endpoints: [unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
Image is up to date for sha256:e131830c9f16032602c25a25c31cc9e5b658ff910c44fc9b6010be94d08101c5

bash-5.2# crictl inspecti localhost/kubernetes/pause:0.1.0
WARN[0000] Config "/etc/crictl.yaml" does not exist, trying next: "/aarch64-bottlerocket-linux-gnu/sys-root/usr/bin/crictl.yaml"
WARN[0000] Image connect using default endpoints: [unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
{
...
  "status": {
    "id": "sha256:160fa372abdd58cb0ef24e8505a7982e2ff35d13f19eda2ffb383ad8f44e5773",
    "pinned": true,
    "repoDigests": [],
    "repoTags": [
      "localhost/kubernetes/pause:0.1.0"
    ],
    "size": "164632",
    "username": ""
  }
}
mkfs.erofs works when invoked by the containerd erofs snapshotter
bash-5.2# findmnt /var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/1/fs -o target,source,fstype
TARGET                                                                SOURCE                                                                         FSTYPE
/var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/1/fs /var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/1/layer.erofs erofs

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Contributor

@yeazelm yeazelm left a comment

Choose a reason for hiding this comment

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

LGTM!

%set_cross_go_flags
export GO_MAJOR="1.25"
go build -ldflags="${GOLDFLAGS}" -o crictl ./cmd/crictl
gofips build -ldflags="${GOLDFLAGS}" -o fips/crictl ./cmd/crictl
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we avoid the second compilation in prep of:

#813

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we avoid the second compilation in prep of:

Depends on who merges first 😀

Comment on lines +56 to +57
NO_LIBZSTD=1 \
NO_LZMA=1 \
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, why not enabling the compression support for perf but it was enabled forerofs-utils? Is it to match the EROFS compression enabled in the kernel?

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 curious, why not enabling the compression support for perf but it was enabled for erofs-utils? Is it to match the EROFS compression enabled in the kernel?

perf can use libzstd to compress traces, which sounds useful although I've never used it.

LZMA is for xz-compressed kernel modules, which we don't use.

Comment on lines +29 to +30
EXTRA_CFLAGS="%{_cross_cflags} -fno-lto" \
EXTRA_CXXFLAGS="%{_cross_cxxflags} -fno-lto" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, why not enabling lto for perf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Out of curiosity, why not enabling lto for perf?

The perf package started life as sub-packages of kernel-6.1 and kernel-6.12, though ultimately I needed the libelf dependency to get traces with symbol names, and that ended up being too much userspace to package in the kernel kit.

During that time, I kept running into LTO-related build issues. Sometimes they'd be fixed upstream but not backported, or affect one kernel but not the other. Disabling LTO made the pain go away.

With the move into the core kit, the package now tracks current kernel releases, so in theory there are no more LTO problems. But I haven't gone back to test that, and I have a lingering concern that the minor performance win might not be worth the upkeep effort.

path = "../packages.rs"

[[package.metadata.build-package.external-files]]
url = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.18.8.tar.xz"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: linux-6.18.9 exists seems it has 1 perf related commit callout.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
@bcressey
Copy link
Contributor Author

⬆️ force push to rebase for Go package changes

This provides the `crictl` command for testing CRI interactions.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Signed-off-by: Ben Cressey <bcressey@amazon.com>
@bcressey
Copy link
Contributor Author

⬆️ force push:

  • adjust packaging for cri-tools to eliminate fips/non-fips distinction
  • update perf to 6.18.10

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.

4 participants