[bug#72766,v3,2/2] gnu: slurm: Move client executables into separate output.
Commit Message
* gnu/packages/parallel.scm (slurm)[outputs]: Add client.
[arguments]: Add move-client-executables phase.
Change-Id: Id7441b0b34a5b8433e4c38bd5c56e4ca1fec587c
---
gnu/packages/parallel.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Comments
Hi Arun,
Arun Isaac <arunisaac@systemreboot.net> skribis:
> * gnu/packages/parallel.scm (slurm)[outputs]: Add client.
> [arguments]: Add move-client-executables phase.
>
> Change-Id: Id7441b0b34a5b8433e4c38bd5c56e4ca1fec587c
[...]
> + (outputs '("out" "client"))
> (arguments
> (list #:configure-flags
> #~(list "--enable-pam"
> @@ -291,7 +292,17 @@ (define-public slurm
> (invoke "make" "install" "-C" "contribs/pmi")
>
> ;; Others expect pmi2.
> - (invoke "make" "install" "-C" "contribs/pmi2"))))))
> + (invoke "make" "install" "-C" "contribs/pmi2")))
> + (add-after 'install 'move-client-executables
> + (lambda _
> + (let ((client-bin (string-append #$output:client "/bin")))
> + (mkdir-p client-bin)
> + (for-each (lambda (executable)
> + (rename-file executable
> + (string-append client-bin
> + "/"
> + (basename executable))))
> + (find-files (string-append #$output "/bin")))))))))
I think “bin” would be a more conventional name for the output; this is
used in a couple of packages and recognized by ‘package->recutils’.
However, what does ‘guix size slurm:client’ report? I suspect it
depends on slurm:out, in which case moving to a separate output makes no
difference from that perspective.
Thanks,
Ludo’.
Hi Ludo,
> I think “bin” would be a more conventional name for the output; this is
> used in a couple of packages and recognized by ‘package->recutils’.
Sure, fixed now.
> However, what does ‘guix size slurm:client’ report? I suspect it
> depends on slurm:out, in which case moving to a separate output makes no
> difference from that perspective.
Yep, that's right.
$ ./pre-inst-env guix size slurm:out | tail -n1
total: 192.6 MiB
$ ./pre-inst-env guix size slurm:bin | tail -n1
total: 201.3 MiB
$ ./pre-inst-env guix size slurm:bin | grep slurm
/gnu/store/2qhgkq79ahw64n4kmr3znl8v66z0n87j-slurm-23.11.10 192.6 17.5 8.7%
/gnu/store/6f3d93i0zdr48v6bp471dfsk7r89xdqh-slurm-23.11.10-bin 201.3 1.3 0.6%
Should I then go back to the idea of creating a slurm-minimal variant?
Regards,
Arun
Hello,
Arun Isaac <arunisaac@systemreboot.net> skribis:
>> I think “bin” would be a more conventional name for the output; this is
>> used in a couple of packages and recognized by ‘package->recutils’.
>
> Sure, fixed now.
>
>> However, what does ‘guix size slurm:client’ report? I suspect it
>> depends on slurm:out, in which case moving to a separate output makes no
>> difference from that perspective.
>
> Yep, that's right.
>
> $ ./pre-inst-env guix size slurm:out | tail -n1
> total: 192.6 MiB
> $ ./pre-inst-env guix size slurm:bin | tail -n1
> total: 201.3 MiB
> $ ./pre-inst-env guix size slurm:bin | grep slurm
> /gnu/store/2qhgkq79ahw64n4kmr3znl8v66z0n87j-slurm-23.11.10 192.6 17.5 8.7%
> /gnu/store/6f3d93i0zdr48v6bp471dfsk7r89xdqh-slurm-23.11.10-bin 201.3 1.3 0.6%
OK.
Hmm I just realized that the introduction of this extra output would at
least deserve a news entry too, because I can already see myself as the
Guix support guy at my workplace having to reply to confused colleagues
who realize that ‘guix shell slurm‘ or similar no longer gives them
‘salloc’ & co. :-)
> Should I then go back to the idea of creating a slurm-minimal variant?
Yes, probably.
Apologies for all the back and forth and hesitations; it’s tricky!
Ludo’.
> Hmm I just realized that the introduction of this extra output would at
> least deserve a news entry too, because I can already see myself as the
> Guix support guy at my workplace having to reply to confused colleagues
> who realize that ‘guix shell slurm‘ or similar no longer gives them
> ‘salloc’ & co. :-)
>
>> Should I then go back to the idea of creating a slurm-minimal variant?
>
> Yes, probably.
>
> Apologies for all the back and forth and hesitations; it’s tricky!
No worries! A v4 patch follows. Do I need to add a news entry for this
v4 patch? I guess not, but just checking.
@@ -246,6 +246,7 @@ (define-public slurm
(native-inputs
(list autoconf expect perl pkg-config python-wrapper))
(build-system gnu-build-system)
+ (outputs '("out" "client"))
(arguments
(list #:configure-flags
#~(list "--enable-pam"
@@ -291,7 +292,17 @@ (define-public slurm
(invoke "make" "install" "-C" "contribs/pmi")
;; Others expect pmi2.
- (invoke "make" "install" "-C" "contribs/pmi2"))))))
+ (invoke "make" "install" "-C" "contribs/pmi2")))
+ (add-after 'install 'move-client-executables
+ (lambda _
+ (let ((client-bin (string-append #$output:client "/bin")))
+ (mkdir-p client-bin)
+ (for-each (lambda (executable)
+ (rename-file executable
+ (string-append client-bin
+ "/"
+ (basename executable))))
+ (find-files (string-append #$output "/bin")))))))))
(home-page "https://slurm.schedmd.com/")
(synopsis "Workload manager for cluster computing")
(description