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 DB6FC1FF16F for ; Tue, 24 Jun 2025 14:50:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 86DF637165; Tue, 24 Jun 2025 14:51:28 +0200 (CEST) Date: Tue, 24 Jun 2025 14:51:25 +0200 From: Wolfgang Bumiller To: Filip Schauer Message-ID: References: <20250611144903.200940-1-f.schauer@proxmox.com> <20250611144903.200940-3-f.schauer@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250611144903.200940-3-f.schauer@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.079 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lib.rs, oci.rs, genpackage.pl] Subject: Re: [pve-devel] [PATCH proxmox-perl-rs v2 02/11] add Perl mapping for OCI container image parser/extractor X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: pve-devel@lists.proxmox.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" I recently started reorganizing this repository so that bindings are in the `bindings` submodule and require documentation. See any of the `update module to new code convention` commits. Essentially, the generated docs for the bindings submodule should be the "perl documentation", and anything else should be rust specific documentation. On Wed, Jun 11, 2025 at 04:48:54PM +0200, Filip Schauer wrote: > Signed-off-by: Filip Schauer > --- > pve-rs/Cargo.toml | 2 ++ > pve-rs/Makefile | 1 + > pve-rs/debian/control | 2 ++ > pve-rs/src/lib.rs | 1 + > pve-rs/src/oci.rs | 20 ++++++++++++++++++++ > 5 files changed, 26 insertions(+) > create mode 100644 pve-rs/src/oci.rs > > diff --git a/pve-rs/Cargo.toml b/pve-rs/Cargo.toml > index c7f11a3..00624c3 100644 > --- a/pve-rs/Cargo.toml > +++ b/pve-rs/Cargo.toml > @@ -20,6 +20,7 @@ hex = "0.4" > http = "1" > libc = "0.2" > nix = "0.29" > +oci-spec = "0.8.1" > openssl = "0.10.40" > serde = "1.0" > serde_bytes = "0.11" > @@ -37,6 +38,7 @@ proxmox-http = { version = "1", features = ["client-sync", "client-trait"] } > proxmox-http-error = "1" > proxmox-log = "1" > proxmox-notify = { version = "1", features = ["pve-context"] } > +proxmox-oci = "0.1.0" > proxmox-openid = "1" > proxmox-resource-scheduling = "1" > proxmox-shared-cache = "1" > diff --git a/pve-rs/Makefile b/pve-rs/Makefile > index afe792a..d6a667f 100644 > --- a/pve-rs/Makefile > +++ b/pve-rs/Makefile > @@ -27,6 +27,7 @@ PERLMOD_GENPACKAGE := /usr/lib/perlmod/genpackage.pl \ > > PERLMOD_PACKAGES := \ > PVE::RS::Firewall::SDN \ > + PVE::RS::OCI \ > PVE::RS::OpenId \ > PVE::RS::ResourceScheduling::Static \ > PVE::RS::TFA > diff --git a/pve-rs/debian/control b/pve-rs/debian/control > index 9e424ec..243b428 100644 > --- a/pve-rs/debian/control > +++ b/pve-rs/debian/control > @@ -10,6 +10,7 @@ Build-Depends: cargo:native , > librust-http-1+default-dev (>= 0.2.7-~~), > librust-libc-0.2+default-dev, > librust-nix-0.29+default-dev, > + librust-oci-spec-0.8+default-dev (>= 0.8.1-~~), > librust-openssl-0.10+default-dev (>= 0.10.40-~~), > librust-perlmod-0.14+default-dev (>= 0.13.5-~~), > librust-perlmod-0.14+exporter-dev (>= 0.13.5-~~), > @@ -24,6 +25,7 @@ Build-Depends: cargo:native , > librust-proxmox-log-1+default-dev, > librust-proxmox-notify-1+default-dev (>= 0.5.4), > librust-proxmox-notify-1+pve-context-dev, > + librust-proxmox-oci-0.1+default-dev, > librust-proxmox-openid-1+default-dev (>= 0.10.4-~~), > librust-proxmox-resource-scheduling-1+default-dev, > librust-proxmox-shared-cache-1+default-dev, > diff --git a/pve-rs/src/lib.rs b/pve-rs/src/lib.rs > index bb979b9..1fe9e77 100644 > --- a/pve-rs/src/lib.rs > +++ b/pve-rs/src/lib.rs > @@ -12,6 +12,7 @@ use proxmox_notify::{Config, Notification, Severity}; > mod common; > > pub mod firewall; > +pub mod oci; > pub mod openid; > > pub mod bindings; > diff --git a/pve-rs/src/oci.rs b/pve-rs/src/oci.rs > new file mode 100644 > index 0000000..dd556aa > --- /dev/null > +++ b/pve-rs/src/oci.rs > @@ -0,0 +1,20 @@ > +#[perlmod::package(name = "PVE::RS::OCI")] > +mod export { > + use anyhow::{Error, bail}; > + use oci_spec::image::Config; I think `proxmox-oci` should re-export this type, then we only need to depend on the one crate. > + use proxmox_oci::{ParseError, ProxmoxOciError}; > + > + #[export] > + pub fn parse_and_extract_image( > + oci_tar_path: &str, > + rootfs_path: &str, > + ) -> Result, Error> { > + match proxmox_oci::parse_and_extract_image(oci_tar_path, rootfs_path) { > + Ok(config) => Ok(Some(config.unwrap_or_default())), > + Err(err) => match err { > + ProxmoxOciError::ParseError(ParseError::NotAnOciImage(_)) => Ok(None), ^ Why are we doing this? > + err => bail!("{err}"), > + }, > + } > + } > +} > -- > 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel