Skip to content

Init pm - #2088

Open
AntonFomichev-Flant wants to merge 59 commits into
mainfrom
feat/pm
Open

Init pm#2088
AntonFomichev-Flant wants to merge 59 commits into
mainfrom
feat/pm

Conversation

@AntonFomichev-Flant

@AntonFomichev-Flant AntonFomichev-Flant commented Mar 10, 2026

Copy link
Copy Markdown

Description

Migrate DVP runtime images to base/distroless + Flant package manager (pm)

Why do we need it, and what problem does it solve?

Previously, every runtime dependency was compiled from source inside dedicated images/packages/* build recipes — a slow, fragile approach that required maintaining custom werf stages for each library. Any version bump meant touching multiple places across the repository.

The Flant package manager (pm) solves this by treating dependencies as OCI artifacts: pm install resolves the full dependency graph, verifies content digests, and places binaries and libraries in a single deterministic operation. No more hand-crafted build stages per library, no more ABI surprises between build and runtime.

Migrated

The following packages — previously built from source as individual images/packages/* werf stages — are now delivered via pm install:

  • acl, bzip2, cyrus-sasl2, dmidecode, dtc, e2fsprogs, file, gcc, glib2
  • glibc, gnutls, keyutils, krb5, libaio, libattr, libaudit, libbrotli, libbsd
  • libburn, libcap, libcap-ng, libcapstone, libcurl, libffi, libfuse2, libfuse3, libgcrypt
  • libgmp, libgpg-error, libgsasl, libidn, libidn2, libisoburn, libisofs, libjansson4, libjson-c5
  • libjson-glib, libmd, libmnl, libnbd, libnftnl, libnl3, libntlm, libpixman, libpng
  • libpsl, libqpl, libseccomp, libslirp, libssh, libssh2, libtasn1, libtirpc, libtpms
  • libunistring, liburing, libuserspace-rcu, libvirt, libxcrypt, libxkbcommon, libxml2, linux-pam, lvm2
  • lz4, lzo, multipath-tools, nbdkit, ncurses, nettle, nftables, nghttp2, nghttp3
  • ngtcp2, numactl, openldap, openssl, p11-kit, pcre2, rdma-core, readline, selinux
  • snappy, swtpm, systemd, ubdsrv, util-linux, xz, zlib, zstd

Switching to base/distroless as the final base image aligns the runtime environment with the build environment, eliminating the class of issues where a binary compiled on ALT would behave differently at runtime.

What is the expected result?

The following final-stage images are now based on base/distroless with runtime dependencies managed via pm install:

  • virt-launcher
  • virt-handler
  • dvcr
  • dvcr-importer
  • dvcr-uploader
  • pvc-importer

Additionally, the build stages for virt-artifact and pvc-artifact have been migrated from builder/golang-alt-1.25 to builder/golang-1.25, aligning the glibc version across build and runtime environments.

Image sizes reduced by ~91 MB per image (e.g. virt-launcher: 279 MB → 187 MB).

images/packages/ legacy build recipes and version pins in base-images-pins.yml are transitional — see TODO below.

TODO (follow-up)

  1. images/packages/ migration — legacy per-library build recipes are still present and should be removed once pm fully covers all runtime dependencies.

  2. Builder stages migration — the following build-stage images still use builder/golang-alt-1.25 and are candidates for migration:

    • dvcr-artifact — uses CGO, needs builder/golang-1.25 (gcc + go + pm)
    • bounder, hooks, kube-api-rewriter, pre-delete-hook, virtualization-artifact, virtualization-dra, vm-route-forge — pure Go, no CGO; should be migrated to builder/golang-1.25
    • edk2 remains on ALT intentionally — requires a full native toolchain (clang with BPF target, acpica, nasm) not yet available in container-factory
  3. Remove version pinsbase-images-pins.yml currently pins base/distroless and builder/distroless to specific container-factory digests. In the ideal world there should be no manual pins: the module should track container-factory releases automatically. The pins are a transitional measure.

  4. Go 1.26 upgradebuilder/golang-1.26 is already available in container-factory. Once build stages are fully migrated off ALT, upgrading to 1.26 is a straightforward one-line change per image.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: images
type: feature
summary: "Migrate runtime images to base/distroless + pm install, replacing per-library build recipes and reducing image sizes by ~91 MB."

@AntonFomichev-Flant AntonFomichev-Flant added this to the v1.8.0 milestone Mar 10, 2026
@AntonFomichev-Flant
AntonFomichev-Flant force-pushed the feat/pm branch 14 times, most recently from 1e15bda to 854cedb Compare March 11, 2026 12:46
@AntonFomichev-Flant
AntonFomichev-Flant force-pushed the feat/pm branch 4 times, most recently from 8f84fca to ced3603 Compare March 12, 2026 06:08
@AntonFomichev-Flant
AntonFomichev-Flant marked this pull request as ready for review March 13, 2026 09:13
@flant-pinegal
flant-pinegal force-pushed the feat/pm branch 3 times, most recently from 8b0cfb8 to 606dcd4 Compare March 26, 2026 08:11
@flant-pinegal flant-pinegal added the e2e/run Run e2e test on cluster of PR author label Mar 26, 2026
@flant-pinegal flant-pinegal self-assigned this Mar 26, 2026
ArtemFedorov-Flant and others added 11 commits July 10, 2026 18:02
…arrives in base-images

Signed-off-by: Artem Fedorov <artem.fedorov@flant.com>
…pf_bridge.o compilation

Signed-off-by: Artem Fedorov <artem.fedorov@flant.com>
Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
update CODEOWNERS

Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
…golang-1.25

Signed-off-by: Artem Fedorov <artem.fedorov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Co-authored-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Signed-off-by: deckhouse-BOaTswain <89150800+deckhouse-boatswain@users.noreply.github.com>
Co-authored-by: nevermarine <nevermarine@users.noreply.github.com>
Description
Prepares the deckhouse/virtualization module to move from GitHub to GitLab by porting the CI. All development pipelines that ran on GitHub Actions now run on GitLab CI with the same behavior: build and deploy (dev/prod, all editions), lint, tests, secret/CVE/Svace scanning, changelog and backport automation, MR auto-assign, and manual release-channel dispatch.

The root .gitlab-ci.yml is a thin entrypoint; the pipeline lives in .gitlab/ci/**.

Not migrated in this iteration
e2e workflows — out of scope.
Reactive slash-commands / webhook listener — GitLab can't start pipelines from MR comments or label changes natively. Manual and scheduled jobs cover the same surface; a webhook listener is a possible follow-up.
Correctness fixes (from review)
Editions could be built/tagged wrong on release and manual pipelines. Some jobs picked up stray pipeline variables that overrode their own settings (a release tag built the CE prod image as EE; a manual precache pushed the wrong tag). The affected build/scan jobs are now isolated to their own config.
mrs:summary could never run — it expected Node.js on the shell runner, which has none; it now runs in the node container like the other JS job.
Malformed Loop release notification — the message is assembled safely, so a tag or channel value with quotes/newlines can't break or inject into it.
Generated-files check ran too much — the heavy vm-route-forge (bpf2go, docker) check now runs only on vm-route-forge changes, not on every change.

---------

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@ArtemFedorov-Flant
ArtemFedorov-Flant marked this pull request as ready for review July 13, 2026 15:45
universal-itengineer and others added 13 commits July 13, 2026 20:26
…ion=false (#2645)

Description
On a VM with enableParavirtualization=false, disks attached via VirtualMachineBlockDeviceAttachment were switched to the SATA bus, even though hot-plugged disks must stay on SCSI. This broke such attachments. The bus of a runtime hot-plugged disk is now preserved regardless of the paravirtualization mode.

---------

Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
…tection (#2659)

Description
ProtectionService.RemoveProtection re-reads a fresh copy of the object and
removes only our finalizer under an optimistic lock, retrying on conflict,
instead of resending the whole (possibly stale) finalizers list.

Why do we need it, and what problem does it solve?
On a terminating PVC the built-in pvc-protection controller strips
kubernetes.io/pvc-protection. Patching from a stale copy resent it, and the
API server rejected the update: no new finalizers can be added if the object is being deleted. The VM deletion handler surfaced this as failed to release PVC protection, never removed the VM cleanup finalizer, and VM deletion hung.

What is the expected result?
Deleting a VM whose block-device PVC is terminating completes cleanly; the
errors above no longer appear in the vm-controller log.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
- fixed CVEs from #2609

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
…#2638)

Description
The virtualization-dra USB DaemonSet pods never start — they stay in CrashLoopBackOff on every node, so USB device passthrough is unavailable. The main container is privileged and runs with a read-only root filesystem while also bind-mounting the host /sys. Under containerd this combination makes the runtime fail to set up the /sys/fs/cgroup mount on the read-only rootfs, and the container never starts.

A privileged container already gets a read-write /sys from the runtime, so the explicit /sys mount is redundant. It is removed together with its volume and the now-dead /sys entry in the SecurityPolicy host-path allow-list.

-------------

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Valeriy Khorunzhin <valeriy.khorunzhin@flant.com>
fix(dra): load compressed usbip kernel modules (xz, gzip)

Pre-installed usbip modules may ship compressed as .ko.xz or .ko.gz
depending on the host distribution, not only .ko or .ko.zst. Resolve all
kernel-supported compression suffixes (zstd, xz, gzip) in the module path
fallback and decompress accordingly before finit_module.

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Virtual machines with local (RWO) disks could get stuck unable to migrate whenever they had a pending restart. The "restart required to apply configuration" state can appear on its own after a module upgrade, without any user change; while it was set, volume migration of the VM's local disks was skipped entirely. Migrations initiated by evacuation (node drain), firmware updates and other workload updates then hung indefinitely — target disks were never prepared and the migration stayed Pending.

---------

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Co-authored-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
…overy (#2664)

* chore(vmclass): discovered features should be frozen after first discovery

- Use first time discovered feature set to filter availableNodes on later reconciles.
- Add errors in case no availableNodes are present in the cluster.

---------

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: deckhouse-BOaTswain <89150800+deckhouse-boatswain@users.noreply.github.com>
Co-authored-by: nevermarine <nevermarine@users.noreply.github.com>
Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
Signed-off-by: Artem Fedorov <artem.fedorov@flant.com>
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.