GNU bug report logs - #45905
[PATCH] IPFS service definition

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Fri, 15 Jan 2021 21:24:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45905 in the body.
You can then email your comments to 45905 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Fri, 15 Jan 2021 21:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 15 Jan 2021 21:24:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: guix-patches <at> gnu.org
Subject: [PATCH] IPFS service definition
Date: Fri, 15 Jan 2021 22:22:54 +0100
[Message part 1 (text/plain, inline)]
Hi Guix!

A patch defining simple ‘ipfs-service-type’ is attached. I've tested
this in a VM, and will test it on a ‘real’ system later. The gateway
is currently broken, it tries to redirect to non-existent subdomains
of localhost. Correcting this might require fiddling with the DNS
configuration.

Maxime
-- 
Maxime Devos <maximedevos <at> telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7  011F 49E3 EE22 1917 25EE
Freenode handle: mdevos
[0001-services-Add-ipfs-service-type.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Mon, 22 Mar 2021 17:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 45905 <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Mon, 22 Mar 2021 18:17:49 +0100
Hi Maxime,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> A patch defining simple ‘ipfs-service-type’ is attached. I've tested
> this in a VM, and will test it on a ‘real’ system later. The gateway
> is currently broken, it tries to redirect to non-existent subdomains
> of localhost. Correcting this might require fiddling with the DNS
> configuration.

OK.  That doesn’t prevent one from using it, right?

> From c441bca727df67837652eb2f0b5ad23528fd11a3 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos <at> telenet.be>
> Date: Fri, 15 Jan 2021 21:46:42 +0100
> Subject: [PATCH] services: Add ipfs-service-type
>
> * gnu/services/networking.scm (ipfs-service-type)
>   (%ipfs-home-mapping, %ipfs-environment)
>   (%ipfs-accounts, %ipfs-home): New variables.
>   (ipfs-configuration, ipfs-configuration?)
>   (ipfs-configuration-package, ipfs-configuration-gateway)
>   (ipfs-configuration-api, ipfs-shepherd-service)
>   (ipfs-binary, %ipfs-activation): New procedures.
> * doc/guix.texi (Networking Services): Document it.

[...]

> +@lisp
> +;; part of the operating-system declaration

I think you can omit this line.

> +(service ipfs-service-type
> +              (ipfs-configuration
> +               (gateway "/ip4/127.0.0.1/tcp/8880")
> +               (api "/ip4/127.0.0.1/tcp/8881")))

Indentation is left (should be aligned with ‘ipfs-service-type’.)

> +      (start #~(make-forkexec-constructor/container
> +                #$ipfs-daemon-command
> +                #:namespaces '#$(fold delq %namespaces '(user net))
> +                #:mappings (list #$%ipfs-home-mapping)
> +                #:log-file "/var/log/ipfs.log"
> +                #:user "ipfs"
> +                #:group "ipfs"
> +                #:environment-variables #$%ipfs-environment))

Nice!

> +  ;; Run ipfs init and ipfs config from a container,
> +  ;; in case the IPFS daemon was compromised at some point
> +  ;; and ~/.ipfs is now a symlink to somewhere outside
> +  ;; %ipfs-home.
> +  (define container-gexp
> +    (with-extensions (list shepherd)
> +      (with-imported-modules (source-module-closure
> +                              '((gnu build shepherd)
> +                                (gnu system file-systems)))
> +        #~(begin
> +            (use-modules (gnu build shepherd)
> +                         (gnu system file-systems))
> +            (let* ((constructor
> +                    (make-forkexec-constructor/container
> +                     (list #$inner-script)
> +                     #:namespaces '#$(fold delq %namespaces '(user))
> +                     #:mappings (list #$%ipfs-home-mapping)
> +                     #:user "ipfs"
> +                     #:group "ipfs"
> +                     #:environment-variables #$%ipfs-environment))
> +                   (pid (constructor)))
> +              (waitpid pid))))))
> +  ;; The activation may happen from the initrd, which uses
> +  ;; a statically-linked guile, while the guix container
> +  ;; procedures require a working dynamic-link.
> +  (define container-script
> +    (program-file "ipfs-activation-container" container-gexp))
> +  #~(system* #$container-script))

That’s a bit involved, but it makes sense to me.

The patch LGTM.  However, we usually commit services along with a system
test under (gnu tests …).  The manual has info on how to run individual
system tests:

  https://guix.gnu.org/manual/en/html_node/Running-the-Test-Suite.html

Could you write a test that ensures that basic functionality works?  It
could be as simple as waiting for the service to be up, then invoking
‘ipfs add’ and ‘ipfs get’.  WDYT?

Thank you!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Mon, 22 Mar 2021 18:41:01 GMT) Full text and rfc822 format available.

Message #11 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45905 <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Mon, 22 Mar 2021 19:40:37 +0100
[Message part 1 (text/plain, inline)]
On Mon, 2021-03-22 at 18:17 +0100, Ludovic Courtès wrote:
> Hi Maxime,
Hi

> Maxime Devos <maximedevos <at> telenet.be> skribis:
> 
> > A patch defining simple ‘ipfs-service-type’ is attached. I've tested
> > this in a VM, and will test it on a ‘real’ system later. The gateway
> > is currently broken, it tries to redirect to non-existent subdomains
> > of localhost. Correcting this might require fiddling with the DNS
> > configuration.
> 
> OK.  That doesn’t prevent one from using it, right?

Nah, the REST API presumably works just fine and there is plenty to see on
the webui:

http://localhost:5001/ipfs/bafybeif4zkmu7qdhkpf3pnhwxipylqleof7rl6ojbe7mq3fzogz6m4xk3i/#/

Not perfect, but it might suffice for your purposes.
That reminds me the configuration can be modified from there.
I didn't figure how to disable that.  Not ideal from a security
perspective, but at least its only loopback & ipfs is in a container.

> > +@lisp
> > +;; part of the operating-system declaration

> I think you can omit this line.

I think I found that line somewhere & copied it for consistency,
but it has been some time ago.

> > +(service ipfs-service-type
> > +              (ipfs-configuration
> > +               (gateway "/ip4/127.0.0.1/tcp/8880")
> > +               (api "/ip4/127.0.0.1/tcp/8881")))
> 
> Indentation is left (should be aligned with ‘ipfs-service-type’.)

Ok, not sure how this happened.

> > +      (start #~(make-forkexec-constructor/container
> > +                [container stuff]
> > +                #:environment-variables #$%ipfs-environment))
> 
> Nice!
Yep!  Also, this reminds me I'm not sure what the distinction between
#+ and #~ is in activation gexps, in shepherd services definitions,
etc.

> > +  ;; Run ipfs init and ipfs config from a container,
> > +  ;; in case the IPFS daemon was compromised at some point
> > +  ;; and ~/.ipfs is now a symlink to somewhere outside
> > +  ;; %ipfs-home.
> > +  (define container-gexp [complicated container stuff])
> > 
> That’s a bit involved, but it makes sense to me.

Unfortunately, there are (non-container related) some more issues.
Last few weeks I've been seeing this error (/var/log/ipfs.log):

(start snip)
Error: fs-repo requires migration
Initializing daemon...
go-ipfs version: 0.8.0
Repo version: 11
System version: amd64/linux
Golang version: go1.14.15
Found outdated fs-repo, migrations need to be run.
Run migrations now? [y/N] Not running migrations of fs-repo now.
Please get fs-repo-migrations from https://dist.ipfs.io

Error: fs-repo requires migration
(end snip)

(Super hacky work-around:
  rm -r /var/lib/ipfs
  mkdir /var/lib/ipfs
  chmod a-rwx /var/lib/ipfs
  chmod u+rwx /var/lib/ipfs
  chown ipfs:ipfs /var/lib/ipfs
  sudo -u ipfs -g ipfs "`guix build go-ipfs`/bin/ipfs" init
  # ^ this can take some seconds to complete
  sudo -u ipfs -g ipfs "`guix build go-ipfs`/bin/ipfs" config API /ip4/127.0.0.1/tcp/5001
  sudo -u ipfs -g ipfs "`guix build go-ipfs`/bin/ipfs" config Addresses.Gateway /ip4/127.0.0.1/tcp/8082
  herd enable ipfs
  herd start ipfs)

Unfortunately "fs-repo-migrations" does not seem to be packaged in Guix.
Apparently there has been a change in repo format in the go-ipfs v0.7.0
--> v0.8.0 upgrade.  I believe for most users simply automatically running
the upgrades would be sufficient.

Now, how could we do this safely from shepherd?  Maybe before starting open
a pipe, write "y\n" to it an pass it as file descriptor 0 (stdin) would
be sufficient?  But shepherd always closes /dev/stdin before exec IIRC ..

Seems like shepherd needs support for file descriptor!  I've a patch for
that, but it needs to be verified (& corrected likely) on GNU/Hurd.  Feel
free to ask for the incomplete patch if you're impatient and want to finish
it yourself!  (Seems to work on GNU/Linux in any case.)

> The patch LGTM.  However, we usually commit services along with a system
> test under (gnu tests …).  The manual has info on how to run individual
> system tests:
> 
>   https://guix.gnu.org/manual/en/html_node/Running-the-Test-Suite.html
> 
> Could you write a test that ensures that basic functionality works?  It
> could be as simple as waiting for the service to be up, then invoking
> ‘ipfs add’ and ‘ipfs get’.  WDYT?

Will look into it eventually, but I am currently occupied with other things
that have deadlines )-:. (Not feeling very inspired for a
writing/presentation assignment ...)  (And I would rather hack on GNUnet
frankly; IPFS is more of a stop-gap to me for having some distributed
something for substitutes.)  So feel free to beat me to it.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Tue, 23 Mar 2021 13:10:01 GMT) Full text and rfc822 format available.

Message #14 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 45905 <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Tue, 23 Mar 2021 14:08:55 +0100
Hi Maxime!

Maxime Devos <maximedevos <at> telenet.be> skribis:

>> OK.  That doesn’t prevent one from using it, right?
>
> Nah, the REST API presumably works just fine and there is plenty to see on
> the webui:
>
> http://localhost:5001/ipfs/bafybeif4zkmu7qdhkpf3pnhwxipylqleof7rl6ojbe7mq3fzogz6m4xk3i/#/
>
> Not perfect, but it might suffice for your purposes.
> That reminds me the configuration can be modified from there.
> I didn't figure how to disable that.  Not ideal from a security
> perspective, but at least its only loopback & ipfs is in a container.

Good.

[...]

> Yep!  Also, this reminds me I'm not sure what the distinction between
> #+ and #~ is in activation gexps, in shepherd services definitions,
> etc.

#+ is ‘ungexp-native’.  It makes sense if you consider a cross-compiled
system.  Code in an activation gexp is meant to run on the target
system, so you want to use #$ (‘ungexp’) there.

You might want to use #+ when building things that can just as well be
built natively.  For instance, the background image for GRUB must be
built by running Inkscape natively on the host system, so we use
#+inkscape (or similar) to do that.

I hope that makes sense.

> Unfortunately, there are (non-container related) some more issues.
> Last few weeks I've been seeing this error (/var/log/ipfs.log):
>
> (start snip)
> Error: fs-repo requires migration
> Initializing daemon...
> go-ipfs version: 0.8.0
> Repo version: 11
> System version: amd64/linux
> Golang version: go1.14.15
> Found outdated fs-repo, migrations need to be run.
> Run migrations now? [y/N] Not running migrations of fs-repo now.
> Please get fs-repo-migrations from https://dist.ipfs.io
>
> Error: fs-repo requires migration
> (end snip)

Bah, I remember seeing that.

> Unfortunately "fs-repo-migrations" does not seem to be packaged in Guix.
> Apparently there has been a change in repo format in the go-ipfs v0.7.0
> --> v0.8.0 upgrade.  I believe for most users simply automatically running
> the upgrades would be sufficient.

Yes, I think so.  We “just” need to package ‘fs-repo-migrations’ first.

Perhaps it’d be okay, as a first step, to provide an IPFS service that
doesn’t handle migrations automatically.

> Now, how could we do this safely from shepherd?  Maybe before starting open
> a pipe, write "y\n" to it an pass it as file descriptor 0 (stdin) would
> be sufficient?  But shepherd always closes /dev/stdin before exec IIRC ..

You could have the ‘ipfs’ Shepherd service depend on, say, a one-shot
‘ipfs-migration’ service.  The ‘ipfs-migration’ service would run
‘fs-repo-migrations’ if it’s necessary.

>> The patch LGTM.  However, we usually commit services along with a system
>> test under (gnu tests …).  The manual has info on how to run individual
>> system tests:
>> 
>>   https://guix.gnu.org/manual/en/html_node/Running-the-Test-Suite.html
>> 
>> Could you write a test that ensures that basic functionality works?  It
>> could be as simple as waiting for the service to be up, then invoking
>> ‘ipfs add’ and ‘ipfs get’.  WDYT?
>
> Will look into it eventually, but I am currently occupied with other things
> that have deadlines )-:. (Not feeling very inspired for a
> writing/presentation assignment ...)  (And I would rather hack on GNUnet
> frankly; IPFS is more of a stop-gap to me for having some distributed
> something for substitutes.)  So feel free to beat me to it.

I’m not offering to work on it :-), but hopefully you or maybe some
fellow contributor can finish it up in the coming weeks!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Sun, 28 Mar 2021 16:37:01 GMT) Full text and rfc822 format available.

Message #17 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45905 <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Sun, 28 Mar 2021 18:36:13 +0200
[Message part 1 (text/plain, inline)]
On Tue, 2021-03-23 at 14:08 +0100, Ludovic Courtès wrote:
> [...]
> Yes, I think so.  We “just” need to package ‘fs-repo-migrations’ first.
> 
> Perhaps it’d be okay, as a first step, to provide an IPFS service that
> doesn’t handle migrations automatically.
> 
> [...]

Punt for later.

> > > The patch LGTM.  However, we usually commit services along with a system
> > > test under (gnu tests …).  The manual has info on how to run individual
> > > system tests:
> > > 
> > >   https://guix.gnu.org/manual/en/html_node/Running-the-Test-Suite.html
> > > 
> > > Could you write a test that ensures that basic functionality works?  It
> > > could be as simple as waiting for the service to be up, then invoking
> > > ‘ipfs add’ and ‘ipfs get’.  WDYT?
> > 
> > [...]

I have attached a revised patch series testing such basic functionality.
However, I tested the functionality with the HTTP interface instead of
with the command line, as the CLI tools assume the IPFS daemon is run
as the same user as the CLI tools.

(IIRC there is an implementation of the CLI tools somewhere that uses
the API endpoint instead of reading/writing to ~/.ipfs, but I don't
recall where.)

I have a problem: I can't run the test I wrote.

$ make && make check-system TESTS="ipfs"
> [compilation bla bla]
> Compiling Scheme modules...
> Selected 1 system tests...
> (end of output)

For some reason, the test I wrote seems to be ignored.

(Also available from my public git repo:
<https://notabug.org/mdevos/guix-gnunet/commit/732c018b9d24f0f36700c6f8715e989ee3d94663>)

Greetings,
Maxime.
[0001-services-Add-ipfs-service-type.patch (text/x-patch, attachment)]
[0002-Add-guix-ipfs.patch (text/x-patch, attachment)]
[0003-gnu-tests-Test-basic-funtionality-of-the-IPFS-servic.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Mon, 29 Mar 2021 14:08:01 GMT) Full text and rfc822 format available.

Message #20 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 45905 <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Mon, 29 Mar 2021 16:07:26 +0200
Hi Maxime,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> TODO: this test isn't run for some reason:
>
> $ make && make check-system TESTS="ipfs"
>> [compilation bla bla]
>> Compiling Scheme modules...
>> Selected 1 system tests...
>> (end of output)
>
> ??? why isn't the IPFS test executed?

[...]

> +(define (run-ipfs-test)
> +  (define os
> +    (marionette-operating-system %ipfs-os
> +                                 #:imported-modules '((gnu services herd)
> +                                                      (guix ipfs))
> +                                 #:requirements '(ipfs)))
> +
> +  (define test
> +    (with-imported-modules '((gnu build marionette))
> +      #~(begin
> +          (use-modules (gnu build marionette)
> +                       (srfi srfi-64))
> +
> +          (define marionette
> +            (make-marionette (list #$(virtual-machine os))))
> +
> +          (define (ipfs-is-alive?)
> +            (marionette-eval
> +             '(begin
> +                (use-modules (gnu services herd)
> +                             (srfi srfi-1))
> +                (live-service-running
> +                 (find (lambda (live)
> +                         (memq 'ipfs
> +                               (live-service-provision live)))
> +                       (current-services))))
> +             marionette))
> +
> +          ;; The default API endpoint port 5001 is used,
> +          ;; so there is no need to parameterize %ipfs-base-url.
> +          ;; By running this within the VM instead of outside the VM
> +          ;; this system test does not have to forward any ports. 
> +          (define (add-data data)
> +            (marionette-eval
> +             `((@ (guix ipfs) add-contents) ,data)))
> +          (define (read-contents object)
> +            (marionette-eval
> +             `((@ (guix ipfs) read-contents) ,object)))
> +
> +          (test-begin "ipfs")

[...]

> +  (gexp->derivation "ipfs-test" test))

You need to add:

  (mkdir #$output)
  (chdir #$output)

right before (test-begin "ipfs").

Failing to do that, you create “ipfs-test.drv” as a zero-output
derivation—i.e., a derivation that doesn’t produce any output.  Since it
produces nothing, the daemon doesn’t bother running its code.

Nitpick: please avoid ‘@’.  Instead, explicitly do:

  (marionette-eval '(use-modules (ipfs)) marionette)

Alternatively, you can arrange to set up port forwarding for the VM and
use the (ipfs) module from the host rather than from the guest.  This is
what (gnu tests ssh) does, for example.

As it stands, the test fails because you need to:

  (define test
    (with-extensions (list guile-json)
      …))

so that Guile-JSON is available, and probably also:

  (with-imported-modules '((ipfs))
    …)

The rest LGTM.

HTH!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Mon, 29 Mar 2021 14:08:02 GMT) Full text and rfc822 format available.

Message #23 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 45905 <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Mon, 29 Mar 2021 16:06:40 +0200
Hi Maxime,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> TODO: this test isn't run for some reason:
>
> $ make && make check-system TESTS="ipfs"
>> [compilation bla bla]
>> Compiling Scheme modules...
>> Selected 1 system tests...
>> (end of output)
>
> ??? why isn't the IPFS test executed?

[...]

> +(define (run-ipfs-test)
> +  (define os
> +    (marionette-operating-system %ipfs-os
> +                                 #:imported-modules '((gnu services herd)
> +                                                      (guix ipfs))
> +                                 #:requirements '(ipfs)))
> +
> +  (define test
> +    (with-imported-modules '((gnu build marionette))
> +      #~(begin
> +          (use-modules (gnu build marionette)
> +                       (srfi srfi-64))
> +
> +          (define marionette
> +            (make-marionette (list #$(virtual-machine os))))
> +
> +          (define (ipfs-is-alive?)
> +            (marionette-eval
> +             '(begin
> +                (use-modules (gnu services herd)
> +                             (srfi srfi-1))
> +                (live-service-running
> +                 (find (lambda (live)
> +                         (memq 'ipfs
> +                               (live-service-provision live)))
> +                       (current-services))))
> +             marionette))
> +
> +          ;; The default API endpoint port 5001 is used,
> +          ;; so there is no need to parameterize %ipfs-base-url.
> +          ;; By running this within the VM instead of outside the VM
> +          ;; this system test does not have to forward any ports. 
> +          (define (add-data data)
> +            (marionette-eval
> +             `((@ (guix ipfs) add-contents) ,data)))
> +          (define (read-contents object)
> +            (marionette-eval
> +             `((@ (guix ipfs) read-contents) ,object)))
> +
> +          (test-begin "ipfs")

[...]

> +  (gexp->derivation "ipfs-test" test))

You need to add:

  (mkdir #$output)
  (chdir #$output)

right before (test-begin "ipfs").

Failing to do that, you create “ipfs-test.drv” as a zero-output
derivation—i.e., a derivation that doesn’t produce any output.  Since it
produces nothing, the daemon doesn’t bother running its code.

Nitpick: please avoid ‘@’.  Instead, explicitly do:

  (marionette-eval '(use-modules (ipfs)) marionette)

Alternatively, you can arrange to set up port forwarding for the VM and
use the (ipfs) module from the host rather than from the guest.  This is
what (gnu tests ssh) does, for example.

As it stands, the test fails because you need to:

  (define test
    (with-extensions (list guile-json)
      …))

so that Guile-JSON is available, and probably also:

  (with-imported-modules '((ipfs))
    …)

The rest LGTM.

HTH!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Tue, 30 Mar 2021 13:39:02 GMT) Full text and rfc822 format available.

Message #26 received at 45905 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
Cc: 45905 <at> debbugs.gnu.org
Subject: [PATCH v3] IPFS service definition
Date: Tue, 30 Mar 2021 15:37:46 +0200
[Message part 1 (text/plain, inline)]
Hi Guix,

Revised patch series is attached.

Changes in v2:

* let the shepherd service depend on (loopback) instead of
  (networking)
* added a (broken) system test for the IPFS service

Changes in v3:

* added 'extensions' argument to 'marionette-operating-system'. 
* fixed the system test
* tweaked the documentation formatting and removed a misleading comment
  on forwarding (port forwarding would be fine here, as the test is run
  in a container so there is no risk of port conflicts IIUC)

Ludovic Courtès wrote:
> Nitpick: please avoid ‘@’.  Instead, explicitly do:
> [...]

I actually prefer '(@ (...) ...)' here, but whatever.  It's changed
in v3.

> As it stands, the test fails because you need to:
>  (define test
>    (with-extensions (list guile-json)
>      …))

As the uploading and downloading is done in the guest, not the host,
this needs to be done somewhat differently.  That's what the patch
‘tests: Support package extensions in the backdoor REPL’ is for.

Greetings,
Maxime
[0001-services-Add-ipfs-service-type.patch (text/x-patch, attachment)]
[0002-Add-guix-ipfs.patch (text/x-patch, attachment)]
[0003-tests-Support-package-extensions-in-the-backdoor-REP.patch (text/x-patch, attachment)]
[0004-gnu-tests-Test-basic-funtionality-of-the-IPFS-servic.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 12 Apr 2021 16:49:02 GMT) Full text and rfc822 format available.

Notification sent to Maxime Devos <maximedevos <at> telenet.be>:
bug acknowledged by developer. (Mon, 12 Apr 2021 16:49:02 GMT) Full text and rfc822 format available.

Message #31 received at 45905-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 45905-done <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Mon, 12 Apr 2021 18:48:15 +0200
Hi Maxime,

Apologies for the delay — I had not seen this new version.

Maxime Devos <maximedevos <at> telenet.be> skribis:

> From 74149efb0dbd1b412fdd14aa87bee80640ea5463 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos <at> telenet.be>
> Date: Fri, 15 Jan 2021 21:46:42 +0100
> Subject: [PATCH 1/4] services: Add ipfs-service-type
>
> * gnu/services/networking.scm (ipfs-service-type)
>   (%ipfs-home-mapping, %ipfs-environment)
>   (%ipfs-accounts, %ipfs-home): New variables.
>   (ipfs-configuration, ipfs-configuration?)
>   (ipfs-configuration-package, ipfs-configuration-gateway)
>   (ipfs-configuration-api, ipfs-shepherd-service)
>   (ipfs-binary, %ipfs-activation): New procedures.
> * doc/guix.texi (Networking Services): Document it.

[...]

> From c1ca4e25ff35fabe89fc7a8b2b4d3521840236c9 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo <at> gnu.org>
> Date: Fri, 28 Dec 2018 01:07:58 +0100
> Subject: [PATCH 2/4] Add (guix ipfs).
>
> This module allows for communicating with the IPFS
> gateway over the HTTP interface.  The commit has been
> cherry-picked from <https://issues.guix.gnu.org/33899>.
>
> The procedures for adding and restoring file trees have
> been removed as according to a reply issue 33899, a different
> format will be used.  The procedure 'add-data' has been
> exported as it will be used in the system test for IPFS.
>
> * guix/ipfs.scm: New file.
> * Makefile.am (MODULES): Add it.

[...]

> From bbf35272775de63ad64aed98a2fa081374f28505 Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos <at> telenet.be>
> Date: Tue, 30 Mar 2021 12:40:14 +0200
> Subject: [PATCH 3/4] tests: Support package extensions in the backdoor REPL.
>
> * gnu/tests.scm
>   (<marionette-configuration>): Add 'extensions' field.
>   (marionette-shepherd-service): Honour the field.
>   (with-import-modules-and-extensions): Define a combination
>   of 'with-import-modules' and 'with-extensions'.

[...]

> From b9134c60d9e662dd497caf0c1819e3e04a5e8b4e Mon Sep 17 00:00:00 2001
> From: Maxime Devos <maximedevos <at> telenet.be>
> Date: Sun, 28 Mar 2021 17:01:49 +0200
> Subject: [PATCH 4/4] gnu: tests: Test basic funtionality of the IPFS service.
>
> It is tested whether the IPFS service listens
> at the gateway and API ports and whether it
> is possible to upload and download a bytevector.
>
> * gnu/tests/networking.scm
>   (%ipfs-os): New variable.
>   (run-ipfs-test): New procedure.
>   (%test-ipfs): New system test.

Pushed all four patches as 68c9e0a56e008f19427bd213cf5b24bdd8fe5922.

Thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45905; Package guix-patches. (Mon, 12 Apr 2021 18:37:01 GMT) Full text and rfc822 format available.

Message #34 received at 45905-done <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45905-done <at> debbugs.gnu.org
Subject: Re: bug#45905: [PATCH] IPFS service definition
Date: Mon, 12 Apr 2021 20:35:57 +0200
On Mon, 2021-04-12 at 18:48 +0200, Ludovic Courtès wrote:
> [...]
> 
> Pushed all four patches as 68c9e0a56e008f19427bd213cf5b24bdd8fe5922.
> 
> Thanks!

Thanks!

Maxime.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 May 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.