unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bengt Richter <bokr@bokr.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: RFC: subcommand to pause/resume builds
Date: Wed, 4 Nov 2020 11:28:14 +0100	[thread overview]
Message-ID: <20201104102814.GA30224@LionPure> (raw)
In-Reply-To: <87zh3yczss.fsf@gnu.org>

Hi all,

On +2020-11-03 14:53:07 +0100, Ludovic Courtès wrote:
> Hi,
> 
> John Soo <jsoo1@asu.edu> skribis:
> 
> > I was looking to pause a long build today and asked on IRC how to
> > accomplish pause/resume.  It seems this is possible already with the
> > following:
> >
> > kill --signal SIGSTOP|SIGCONT {pids-of-build-process-tree}
> >
> > There is already a command to list the processes associated to guix
> > commands: guix processes.  Perhaps pause/resume can be a subcommand or
> > set of flags to guix processes. The following is the first thing that
> > comes to mind:
> >
> > guix processes --pause package-name ... --resume package-name ...
> >
> > What do you think?
> 
> First, note that the daemon is unaware of “packages”, it only knows
> about “derivations”.
>

What if you turned the problem inside out, and made the derivation
volunteer to be paused (at sensible places in its progress)?

I.e., if you defined part of a given derivation "hash-prefixed-derivation-file-name-in-question.drv"
to do a check for the existence of

    /var/guix/daemon-ctl/hash-prefixed-derivation-file-name-in-question.drv.sfx
    (.sfx appended to signify special effects :) 

ISTM that could open the door for some easy hacks, (and probably some dangers to watch for :)
E.g. a proof of concept might be just to sleep 6 seconds (say) and repeat sleep/check
until the file disappears.

IWG this should not change anything for non-volunteering derivations other than the load-relief
of not running the sleeping process(es).

Then the person wanting to pause the derivation "hash-prefixed-derivation-file-name-in-question.drv"
could do so simply by
    touch  /var/guix/daemon-ctl/hash-prefixed-derivation-file-name-in-question.drv.sfx
and deleting it when wanting to allow it to continue.

Later, if that works, .sfx files could have content, for as yet unimagined purposes ;)

[...]
> 
> Conclusion: I don’t think we can implement this reliably.
>

IDK from the outside, but inside-out, WDYT?

> HTH!
> 
> Ludo’.
> 

-- 
Regards,
Bengt Richter


  parent reply	other threads:[~2020-11-04 10:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 18:56 RFC: subcommand to pause/resume builds John Soo
2020-11-03 13:53 ` Ludovic Courtès
2020-11-03 14:41   ` John Soo
2020-11-03 16:32   ` Tobias Geerinckx-Rice
2020-11-03 17:12     ` John Soo
2020-11-06  8:56       ` Ludovic Courtès
2020-11-03 17:19     ` Tobias Geerinckx-Rice
2020-11-03 18:27       ` John Soo
2020-11-03 20:01       ` John Soo
2020-11-06  8:58         ` Ludovic Courtès
2020-11-06 23:00           ` John Soo
2020-11-04 10:28   ` Bengt Richter [this message]
2020-11-06 21:11   ` Mark H Weaver
2020-11-08 16:30     ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2020-11-05  4:37 John Soo

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20201104102814.GA30224@LionPure \
    --to=bokr@bokr.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).