Skip to content

Conversation

@yeazelm
Copy link
Contributor

@yeazelm yeazelm commented Sep 25, 2025

Issue number:

Closes # #670

Description of changes:
Adds hwloc as package to the core kit. Also vend a devel package in case variants want to bind against hwloc as a build dependency rather than use the binaries.

Testing done:
Built images with the binaries included.

hwloc-ls is usable from sheltie:

bash-5.1# hwloc-ls
Machine (15GB total)
  Package L#0
    NUMANode L#0 (P#0 15GB)
    L3 L#0 (8192KB)
      L2 L#0 (512KB) + L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0
        PU L#0 (P#0)
        PU L#1 (P#2)
      L2 L#1 (512KB) + L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1
        PU L#2 (P#1)
        PU L#3 (P#3)
  Block(Disk) "nvme0n1"
  Block(Disk) "nvme2n1"
  Block(Disk) "nvme1n1"
  Net "eth1"
  Net "eth0"

Built an image and confirmed hwloc-ls will work from a container.
Specfile:

apiVersion: v1
kind: Pod
metadata:
  name: hwloc-pod
spec:
  containers:
  - name: hwloc
    image: ubuntu:24.04 # Has glibc 2.38 or later
    command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep infinity']
    volumeMounts:
    - name: hwloc-binary
      mountPath: /usr/local/bin/hwloc-ls
      readOnly: true
  volumes:
  - name: hwloc-binary
    hostPath:
      path: /bin/hwloc-ls
      type: File

Output:

 $ kubectl exec -it hwloc-pod -- bash
root@hwloc-pod:/# hwloc-ls
Machine (15GB total)
  Package L#0
    NUMANode L#0 (P#0 15GB)
    L3 L#0 (8192KB)
      L2 L#0 (512KB) + L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0
        PU L#0 (P#0)
        PU L#1 (P#2)
      L2 L#1 (512KB) + L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1
        PU L#2 (P#1)
        PU L#3 (P#3)
  Block(Disk) "nvme0n1"
  Block(Disk) "nvme2n1"
  Block(Disk) "nvme1n1"

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.

@yeazelm yeazelm requested a review from mgsharm September 25, 2025 17:19
@yeazelm
Copy link
Contributor Author

yeazelm commented Oct 3, 2025

^ Updated to no longer include hwloc in release and updated from the rest of the comments from the PR.

@yeazelm yeazelm changed the title Add hwloc to images Add hwloc to core kit Oct 7, 2025
Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

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

If we don't have use cases in mind for the tools, I'd prefer to invert the packaging and have libhwloc, libhwloc-devel, and libhwloc-tools - so that the tools are optional when the shared library is needed.

Compare to libcrypto-tools and libcryptsetup-tools.

hwloc is needed both as a binary dependency like hwloc-ls but also can
be used as a build dependency so this package vends a devel both a
tools package and a development package.

Signed-off-by: Matthew Yeazel <yeazelm@amazon.com>
@yeazelm
Copy link
Contributor Author

yeazelm commented Oct 28, 2025

I rebased the changes and pushed an updated version that provides the shared object and three packages:
hwloc - primary package vends hwloc.so*
hwloc-tools - provides the binaries
hwloc-devel - provides build dependencies

@mgsharm mgsharm self-requested a review October 29, 2025 22:48
@bcressey bcressey merged commit 0ddbd7a into bottlerocket-os:develop Nov 12, 2025
2 checks passed
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.

6 participants