public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [RFC proxmox 1/3] new proxmox-server-config crate
Date: Mon, 30 Oct 2023 12:41:21 +0100	[thread overview]
Message-ID: <62a733aa-8124-469c-9cae-13a37646ff9d@proxmox.com> (raw)
In-Reply-To: <a86c676b-39ec-ad35-5ff7-747cc69bddf8@proxmox.com>

Am 30/10/2023 um 12:05 schrieb Dominik Csapak:
> On 10/25/23 18:38, Thomas Lamprecht wrote:
>> Would name it "proxmox-rest-server-config" or "proxmox-api-config", and here
>> I'm asking myself (without really trying to answer it myself): why isn't
>> this part of proxmox-rest-server, it's only relevant when used in combination
>> of there, simply to allow use-sites that do not depend on the rest of that
>> crates code?
>>
> 
> you're right that it's currently only used together with the 
> rest-server, but i though it might bite us in the future if we put that 
> together. We might want to have some daemons that does not have a rest
> part in the future?

then adapt to the actual reality that happens in the future? It's not like
this is then set in stone, and especially with rust one can adapt this
relatively easily, or at least without fear of subtle breakage.

> e.g. like we now have a few of them in PVE (pvestatd, qmeventd, spiceproxy)

Yes, which either mostly exists due to the lack of (sane) threading in perl,
or are simple and have no need for worker stuff (like qmeventd, or the syscall
proxy, already written in rust).

> also having more smaller crates does improve compile time for boxes
> with many cores (not really an argument for or against, just a side effect)

This crate is so small, that the static overhead of having it probably even
increases total build time ;-)

But I digress, I do not argue against having small, or even micro crates,
on the contrary they can be great for certain stuff.
And "certain stuff" is doing the heavy lifting there, as there are only some
cases where one can be sure up-front that a micro crate is best. E.g., one
ideal one would have a small scope, and allow one to be almost certain that
the ABI never has to be broken. A config trait crate for our (still a bit messy)
daemons isn't one of those IMO. Most others can only be decided (for sure) in
retrospect, until then the code should live as close to the actual use case
as possible (i.e., a micro crate can be fine, having it in the crate that uses
it can be fine, but not putting it in-between in some monster helper crate
like proxmox-sys please!).

Here it could be OK'ish, but I'd favor having this in rest-server until there's
an actual use case to reason about.
 >> Also, mostly important for  the other two crates: did you check the history
>> of the files you mode? If there's anything relevant, I'd favor isolating that
>> and then merging it in, like I did when splitting out rest-server, but it can
>> sometimes be a bit of a PITA, so  can be decided case-by-case for those new
>> crates..
>>
> 
> i'll look into it. I did not spend much time on such things for the RFC.
> just wanted to see how others feel about the general approach

If it's messy, or hardly worth it, then specifying the previous location
(including some verison, or even commit rev) would already make it lots
easier to find, if really needed.


>>> +    name: String,
>>> +    base_dir: PathBuf,
>>> +    user: User,
>>> +    privileged_user: OnceLock<User>,
>>> +
>>> +    task_dir: OnceLock<PathBuf>,
>>
>> not sure if this should be an option, e.g., for simple CRUD
>> API daemons there might not be any worker tasks at all.
>>
> 
> that's one reason i used OnceLock, since it's only created when either
> one sets it manually, or access it the first time
> 
> but Option would work too ofc if that's preferred

no hard preference, but Option feels more explicit for a, well optional,
use-case – but if we keep this code in proxmox-rest-server for now it
wouldn't matter anyway.




  reply	other threads:[~2023-10-30 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 10:39 [pbs-devel] [RFC proxmox/proxmox-backup] refactor common server code from pbs Dominik Csapak
2023-10-18 10:39 ` [pbs-devel] [RFC proxmox 1/3] new proxmox-server-config crate Dominik Csapak
2023-10-25 16:38   ` Thomas Lamprecht
2023-10-30 11:05     ` Dominik Csapak
2023-10-30 11:41       ` Thomas Lamprecht [this message]
2023-10-18 10:39 ` [pbs-devel] [RFC proxmox 2/3] new proxmox-jobstate crate Dominik Csapak
2023-10-18 10:39 ` [pbs-devel] [RFC proxmox 3/3] new proxmox-cert-management crate Dominik Csapak
2023-10-18 10:39 ` [pbs-devel] [RFC proxmox-backup 1/1] use proxmox_jobstate and proxmox_cert_management crates Dominik Csapak
2023-10-24  8:17 ` [pbs-devel] [RFC proxmox/proxmox-backup] refactor common server code from pbs Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62a733aa-8124-469c-9cae-13a37646ff9d@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal