From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6D6351FF140 for ; Fri, 27 Mar 2026 11:06:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A93372C56; Fri, 27 Mar 2026 11:07:01 +0100 (CET) Date: Fri, 27 Mar 2026 11:06:58 +0100 From: Gabriel Goller To: Thomas Lamprecht Subject: Re: [PATCH manager/network/proxmox{-ve-rs,-perl-rs} v7 00/21] Generate frr config using jinja templates and rust types Message-ID: <7m5jfbpevrt4bwxw67v2wgjmqblxzoigk77uv43qwm7lvmahvz@aeblgd3r56xl> Mail-Followup-To: Thomas Lamprecht , pve-devel@lists.proxmox.com References: <20260323134934.243110-1-g.goller@proxmox.com> <7564a8cf-58d3-41ff-926d-0485e9e6e02a@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7564a8cf-58d3-41ff-926d-0485e9e6e02a@proxmox.com> User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774605968244 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: J6W7ACSO4SQISQUXJW7U6UYCLS4RYZO5 X-Message-ID-Hash: J6W7ACSO4SQISQUXJW7U6UYCLS4RYZO5 X-MailFrom: g.goller@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 27.03.2026 02:11, Thomas Lamprecht wrote: > Am 23.03.26 um 14:49 schrieb Gabriel Goller: > > Previously we generated the frr config using one big perl hash, where every > > controller-plugin and zone-plugin would push their stuff. This is not pretty > > and also tricky to unite with our new rust-based fabrics. Furthermore the only > > way to edit or override the frr config is currently the frr.conf.local file, > > which is merged with the perl-hash in a very janky manner, which has sprouted > > numerous forum threads. The main problem with the frr.conf.local is the limited > > control which the user has as to where the override or additional config gets > > placed. There are also a few config overrides or additions to frr.conf.local > > that are currently impossible or generate invalid frr config. > > > > To improve this we now ship templates, which we use to generate the frr config. > > This is the way it is done in e.g. sonic and vyos. These jinja2 templates are > > then populated using rust-structs. We changed the perl code to generate > > bgp/evpn and isis config that can be deserialized by the rust types and then > > rendered into a frr configuration using the templates. > > > > # Versioning > > > > The templates are in the proxmox-frr-templates debian package which, when > > installed, copies the template into `/usr/share/proxmox-frr/templates`, where > > they are read from using `include_str!`. This means the proxmox-frr-templates > > package is only used for development and to version the templates. The user > > only gets them in the binary of proxmox-frr (which, by extension, is in the > > perl-rs shared library). > > > > # frr.conf.local > > > > The frr.conf.local merging code has been adjusted so that the frr.conf.local > > still works as before. > > > > This series requires: > > https://lore.proxmox.com/pve-devel/20260323092140.42275-1-g.goller@proxmox.com/ > > > > Changelog: > > > > v7 (thanks @Wolfgang, @Stefan): > > * ve-rs: remove `phf` dependency, use proxmox-sorted-macro and const array > > with binary_search lookup > > * ve-rs: add proxmox-frr unit-tests using vtysh dry-run to test them directly > > against the frr config parser (only if the vtysh binary exists) > > * ve-rs: use new from_str implementation of api_string_type! macro (requires: > > https://lore.proxmox.com/pve-devel/20260323092140.42275-1-g.goller@proxmox.com/) > > Reads like a mature and well structured series, nice work! > Some comments to specific patches, but most of it relatively benign (or at > least easy to fix). With those addressed, if applicable, this would be IMO > ready to be applied. > > Please pick up Wolfgang R-b for a next submission, at least if you do not make > bigger structural code changes. OTOH, I'd be open to squash in a few fixes and > take this in after you checked the replies, just tell me what you favor; I'm > also more then content with a v8 submission. I'll send a v8 soon.