# cloud-init packages for the "rocm-golden" guest flavour: the union of what
# the ionic and rocjitsu flavours need, for a guest that carries both an
# emulated ionic RDMA NIC and an emulated gfx1250.
#
# ROCm userspace and amdgpu-dkms are *not* here.  They come from third-party
# apt repositories, which cloud-init's package list cannot add, so they are
# installed by ansible/playbooks/vm-rocm-golden.yml instead.
#
# This file owns everything below that no role installs: ccache, the
# autotools, the extra -dev packages, nvme-cli and rsync. The roles install
# what they themselves need to build, and nothing for a consumer's
# convenience, so a bake that wants the published guest passes
# --packages <this file>. A bake with --packages none still works; its guest
# is short only these.
#
# Nothing here may be kernel-versioned: cloud-init runs before the mainline
# kernel is installed, and ${KERNEL_VERSION} would expand to the *host* kernel
# in any case.
build-essential
cmake
ninja-build
pkg-config
dkms

# ccache, for the kernel-module builds of a bake that is handed a cache.
#
# The plays that run those builds -- amdgpu, ionic-ernic twice, ernic_p4 and
# SDXI -- are about fourteen minutes of a bake, and they compile the same
# sources whenever no pin has moved. How much of that is compiling has not
# been measured. A bake given a cache directory (gen-vm --cache-dir, or
# <bake-cache-dir> in a fleet file) carries a ccache directory in before the
# first of them and out after the last; the bake_ccache role in
# ansible/playbooks/roles does it, and installs this package itself if a
# bake was given another manifest.
#
# Without a cache directory nothing calls it and this is an unused binary,
# which is what a bake by hand gets. The two workflows that bake this image,
# the playbook-test lane and the publish workflow, each pass one, so the
# published image's modules are built through it.
ccache
git
# No linux-headers-generic, for ionic.txt's reason: this flavour boots mainline
# 7.2.4 (kernel_ref in images.yml), not the 7.0 the release ships, so the
# -generic metapackage would put headers on disk that neither the ionic-ernic
# DKMS build nor amdgpu-dkms must build against.  The matching
# linux-headers-<ver>-generic comes with the mainline .debs, as does
# linux-modules-<ver>-generic, which carries ib_core, ib_uverbs, rdma_ucm and
# both halves of ionic.
#
# Dependencies of those .debs, pre-seeded so the kernel install is a local
# dpkg operation rather than a second round of archive resolution.
linux-base
kmod
initramfs-tools
wireless-regdb

# Needed before the provisioning boot can add a signed apt source.
ca-certificates
curl
gnupg

# rdma-core build dependencies (upstream v62 wants all of these).  The bake
# builds rocm-ernic's rdma-core from source into /usr/local, with the
# SRQ-capable ionic provider, and that build needs these and no rdma-core
# header: it was run on a guest with none anywhere.  libnl-3-dev and
# libnl-route-3-dev were also what libibverbs-dev used to bring in; they are
# named here so they stay now that it is gone, for that build and for
# anything a consumer links with -lnl-3.
libnl-3-dev
libnl-route-3-dev
libudev-dev
libsystemd-dev
python3-docutils

# The archive's rdma-core, as a RUNTIME only: the udev rules and systemd
# units of the rdma-core package, ibv_devinfo, and the libraries the archive's
# perftest, fio and libpcap are linked against.
#
# Its development packages -- libibverbs-dev, librdmacm-dev, libibumad-dev --
# are deliberately NOT here, and the bake purges them from a base that has
# them.  The headers and link libraries a build in this guest finds are the
# ones in /usr/local, of the rdma-core every tool on the image loads.  With
# the archive's beside them the compiler read one rdma-core's headers and the
# linker took the other's library.  Adding one of the three back restores
# that; qemu/checks/rocm-golden.sh fails an image that has any of them.
rdma-core
ibverbs-utils

# perftest with ROCm memory support is built in the guest, by the bake: the
# perftest_setup role, from a pinned commit, into /usr/local/bin (see the
# perftest entry below: the archive build carries no --use_rocm).  These are
# what that build needs on top of the rdma-core in /usr/local, whose
# libibverbs, librdmacm and libibumad it compiles and links against.
#
# autoconf and automake are here for the same build -- autogen.sh needs them
# and nothing else in this flavour pulls them in, so libtool alone would still
# leave the in-guest build one apt round-trip short.
autoconf
automake
libtool
libpci-dev

# ib_send_bw and friends, for jobs that move traffic over the ionic queue
# pairs rather than only assert the modules built.  Built without ROCm memory
# support: --use_rocm needs perftest compiled against a ROCm the archive build
# does not carry.  It stays beside the ROCm build the bake adds, as the stock
# tools in /usr/bin: /usr/local/bin precedes it on PATH, so a bare ib_send_bw
# is the ROCm build, and vm-quickstart.yml's RDMA test names
# /usr/bin/ib_send_bw to keep running this one.
perftest

# The GPU half's build and test dependencies, pre-installed because every
# consumer of an emulated gfx1250 guest wants them and they are free to carry.
libcli11-dev
libdrm-dev
libssl-dev
nvme-cli
pciutils
python3-dev
rsync

# fio with the libhipfile ioengine is built in the guest, by the bake: the
# fio_hipfile_setup role, from a pinned release, into /opt/fio-hipfile and on
# no PATH.  Nothing is listed here for it.  build-essential, git and
# pkg-config are above, and libaio-dev, libnuma-dev and zlib1g-dev are
# installed by the bake's rocjitsu_setup role (rocjitsu_setup_tools_packages),
# ahead of that build.  The archive's fio, which a bare "fio" runs and
# vm-quickstart.yml's NVMe test uses, is not named in this manifest either:
# sbates130272.batesste.fave_packages installs it, which vm-basic.yml runs,
# and the guest check fails an image without /usr/bin/fio.

pipx
python3-venv
