~ruther/guix-local

ref: db6dcf816f55db26dac42e669d0851c8be468d2d guix-local/guix/scripts/offload.scm -rw-r--r-- 28.3 KiB
940a8c57 — Ludovic Courtès 11 years ago
offload: Remove mutual exclusion on transfers.

Suggested by Mark H. Weaver <mhw@netris.org>
at <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00352.html>.

* guix/scripts/offload.scm (transfer-and-offload): Remove uses of
  'with-machine-lock'.
0363991a — Ludovic Courtès 11 years ago
Break module cycle involving (guix store) and (guix ui).

Before, there was a cycle along the lines of:

  (guix store) -> (guix nar) -> (guix ui) -> (guix store)

This caused problems, as discussed at:

  http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00109.html

This patch removes cycles in the (guix ...) modules.

* guix/nar.scm (&nar-error, &nar-read-error, dump, write-contents,
  read-contents, %archive-version-1, write-file, restore-file): Move to...
* guix/serialization.scm: ... here.
* guix/store.scm: Remove dependency on (guix nar).
* guix/scripts/hash.scm, guix/scripts/offload.scm,
  guix/scripts/substitute-binary.scm, tests/nar.scm, tests/store.scm,
  tests/substitute-binary.scm: Adjust accordingly.
46025e94 — Ludovic Courtès 11 years ago
offload: Use a total order when sorting available machines.

* guix/scripts/offload.scm (machine-less-loaded?, machine-faster?):
  Remove.
  (machine-power-factor): New procedure.
  (machine-less-loaded-or-faster?): Use it.
b1fea303 — Ludovic Courtès 11 years ago
offload: Try another machine when the "best" machine is overloaded.

* guix/scripts/offload.scm (choose-build-machine): When BEST is
  overloaded, try the other machines.
e759c0a3 — Mark H Weaver 11 years ago
Merge branch 'master' into core-updates
b9a31d90 — Ludovic Courtès 11 years ago
offload: Ignore EEXIST when registering a .drv as a GC root.

Fixes <http://bugs.gnu.org/18115>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/scripts/offload.scm (register-gc-root)[script]: Wrap 'symlink'
  call in "catch 'system-error", and ignore EEXIST errors.
b1e48f22 — Ludovic Courtès 11 years ago
offload: Ignore unreachable machines.

Fixes <http://bugs.gnu.org/18070>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/scripts/offload.scm (remote-pipe): Augment docstring.
  (machine-load): Return +inf.0 instead of 1 if MACHINE does not respond
  or responds badly.
c1202fb1 — Ludovic Courtès 11 years ago
guix {system,offload}: Improve reporting of syntax errors.

* guix/scripts/system.scm (read-operating-system) <catch handler>: Add
  case for 'syntax-error'.  Correct message for default case.
* guix/scripts/offload.scm (build-machines) <catch handler>: Add case
  for 'syntax-error'.
* tests/guix-system.sh: New file.
* Makefile.am (SH_TESTS): Add it.
af018f5e — Ludovic Courtès 11 years ago
Merge branch 'master' into core-updates
30ce8012 — Ludovic Courtès 12 years ago
offload: '{send,receive}-files' wait for completion of the transfer.

Fixes situations where the remote 'guix build' is invoked before the
.drv has been completely copied, as reported at
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00174.html>.

In some cases 'send-files' would return before the other end is done
importing the files, and so the subsequent 'guix build' invocation would
just miss the .drv file it refers to.

* guix/utils.scm (call-with-decompressed-port): Don't close PORT.
  (call-with-compressed-output-port): Likewise.
* tests/utils.scm ("compressed-output-port + decompressed-port"): Adjust
  accordingly.
* guix/scripts/offload.scm (send-files): Add explicit (close-pipe pipe)
  call.
  (retrieve-files): Likewise.
66ef5411 — Ludovic Courtès 12 years ago
offload: Better synchronize with remote invocation of 'guix archive --missing'.

* guix/scripts/offload.scm (send-files)[missing-files]: Call 'waitpid'
  after reading all of MISSING.
c9501414 — Ludovic Courtès 12 years ago
offload: Remove all the GC roots in case of multiple-output derivations.

* guix/scripts/offload.scm (remove-gc-root): Rename to...
  (remove-gc-roots): ... this.
  [builder]: Use 'scandir' and remove all the files starting with
  %GC-ROOT-FILE.
  (transfer-and-offload): Adjust to renaming; remove
  'false-if-exception' wraps.
a4b42825 — Ludovic Courtès 12 years ago
offload: Bail out when failing to register a GC root on the build machine.

* guix/scripts/offload.scm (register-gc-root): Call 'leave' when
  'close-pipe' returns non-zero.
4b00f343 — Ludovic Courtès 12 years ago
offload: Prevent the '.drv' and build result from being GC'd.

Before that, there was a small time window during which the GC could
wipe the .drv (before 'guix build' has been called), or the build
result (before 'retrieve-files' has started.)

* guix/scripts/offload.scm (remote-pipe): Add #:quote? parameter and
  honor it.
  (%gc-root-file): New variable.
  (register-gc-root, remove-gc-root): New procedures.
  (offload): Adjust comment.  Run 'guix build' with '-r %GC-ROOT-FILE'.
  (transfer-and-offload): Call 'register-gc-root' before
  sending (derivation-file-name DRV).  Call 'remove-gc-root' after the
  call to 'offload' or 'retrieve-files'.
  (send-files): Call 'remote-pipe' with #:quote? #f.
  (retrieve-files): Likewise.
36b5851d — Ludovic Courtès 12 years ago
offload: Exit with code 100 upon build failures.

* guix/scripts/offload.scm (transfer-and-offload): Exit with code 100
  upon build failure.
07fb21b2 — Ludovic Courtès 12 years ago
offload: Remove erroneous 'close-pipe' call.

* guix/scripts/offload.scm (send-files): Remove 'close-pipe' call from
  'guard' handler ('pipe' here referred to Guile's 'pipe' procedure.)
6c41cce0 — Ludovic Courtès 12 years ago
offload: Wait for the processes involved in 'guix archive --missing'.

* guix/scripts/offload.scm (send-files): Keep the second return value of
  'filtered-port'.  Call 'waitpid' on it.
236e6648 — Ludovic Courtès 12 years ago
offload: Allow one transfer in each direction simultaneously.

* guix/scripts/offload.scm (transfer-and-offload): Use 'upload' lock
  instead of 'bandwidth' around 'send-files' calls, and 'download' lock
  around 'retrieve-files' call.
3dfd8af5 — Ludovic Courtès 12 years ago
offload: Disable SSH-level compression.

* guix/scripts/offload.scm (remote-pipe): Remove '-z' lsh command line
  argument.  This makes transfers almost an order of magnitude slower.
  OpenSSH's ssh(1) man page notes: "Compression is desirable on modem lines
  and other slow connections, but will only slow down things on fast
  networks."  See also
  <http://www.spikelab.org/blog/transfer-largedata-scp-tarssh-tarnc-compared.html>.
8b7af637 — Ludovic Courtès 12 years ago
offload: Compress files being sent/retrieved.

* guix/scripts/offload.scm (send-files): Add "xz -dc |" to the remote
  pipe command.  Pass PIPE through 'call-with-compressed-output-port'.
  Remove 'close-pipe' call.
  (retrieve-files): Add "| xz -c" to the remote pipe command.  Pass PIPE
  through 'call-with-decompressed-port'.  Remove 'close-pipe' call.
Next