1. 09 Sep, 2019 15 commits
    • Ludovic Courtès's avatar
      kernels: 'read-message' no longer swallows heartbeat messages. · 1abf4098
      Ludovic Courtès authored
      * jupyter/kernels.scm (read-message): Return heartbeat messages.
      1abf4098
    • Ludovic Courtès's avatar
      Switch to Guile-JSON 3.x. · 0bd4ecd7
      Ludovic Courtès authored
      Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on
      until now: it maps JSON dictionaries to alists (instead of hash tables),
      and JSON arrays to vectors (instead of lists).  This commit is about
      adjusting all the existing code to this new mapping.
      
      * jupyter/kernels.scm (kernel-arguments): Use 'assoc-ref' instead of
      'hash-ref'; pass JSON array through 'vector->list'.
      (relay-message, reply-html): Likewise.
      * jupyter/messages.scm (string->header): Likewise.
      * guix-jupyter-container.scm (local-eval, reply-execute-request): Likewise.
      * guix-jupyter-kernel.scm (reply-execute-request): Likewise.
      * guix-kernel/jupyter-client.scm (json->kernel): Likewise.
      * tests/kernels.scm: Likewise.
      * environment.scm (propagated-inputs): Replace GUILE-JSON with
      GUILE-JSON-3.
      0bd4ecd7
    • Ludovic Courtès's avatar
      kernels: Test "kernel_info_request". · 200be24b
      Ludovic Courtès authored
      * tests/kernels.scm ("run-kernel python3"): Try to get a "status"
      message.
      ("kernel_info_request"): New test.
      200be24b
    • Ludovic Courtès's avatar
      kernels: 'read-message' reads from any of the kernel's sockets. · d88fb653
      Ludovic Courtès authored
      * jupyter/kernels.scm (read-message): Rewrite to use 'zmq-poll'.  Add
      optional 'timeout' parameter.
      * tests/kernels.scm ("execute_request"): Call 'read-message' thrice and
      check all three replies.
      d88fb653
    • Ludovic Courtès's avatar
      kernels: 'run-kernel' no longer requires a UUID parameter. · 22e7d33f
      Ludovic Courtès authored
      * jupyter/kernels.scm (run-kernel): Remove 'uuid' parameter and add
       #:identity parameter.  Do not set ZMQ_IDENTITY on SOCKET-SHELL when
       #:identity is #f.
      * guix-jupyter-container.scm (reply-execute-request): Pass #:identity to
      'run-kernel'.
      * tests/kernels.scm (%kernel-uuid): Remove.
      ("run-kernel python3"): Remove %KERNEL-UUID argument from 'run-kernel'
      call.
      ("execute_request"): Remove #:recipient argument to 'send-message'.
      Remove reference to %KERNEL-UUID.
      22e7d33f
    • Ludovic Courtès's avatar
      messages: 'message-parts' accepts #f as the recipient. · 22b789fc
      Ludovic Courtès authored
      * jupyter/messages.scm (message-parts): Allow #:recipients to be #f.
      22b789fc
    • Ludovic Courtès's avatar
      kernels: Add 'kernel-sockets'. · 3b418494
      Ludovic Courtès authored
      * jupyter/kernels.scm (kernel-sockets): New procedure.
      (close-kernel): Use it.
      3b418494
    • Ludovic Courtès's avatar
      kernels: Add test talking to ipykernel. · 6874b76c
      Ludovic Courtès authored
      * tests/kernels.scm: New file.
      * Makefile.am (SCM_TESTS): Add it.
      * environment.scm <native-inputs>: Add JUPYTER, PYTHON-IPYTHON, and
      PYTHON-IPYKERNEL.
      6874b76c
    • Ludovic Courtès's avatar
      messages: Provide a simpler 'header' procedure and export it. · 89d52b8f
      Ludovic Courtès authored
      * jupyter/messages.scm (<header>): Rename contructor to '%header'.
      (%protocol-version): New variable.
      (current-date-string, header, make-header): New procedures.
      (reply): Adjust to new 'header' API.
      (string->header): Likewise.
      89d52b8f
    • Ludovic Courtès's avatar
      Move more kernel helpers to (guix kernels). · 16553955
      Ludovic Courtès authored
      * guix-kernel/jupyter-client.scm (read-message, send-message, pub)
      (pub-busy, pub-idle, reply-html): Move to...
      * jupyter/kernels.scm: ... here.
      16553955
    • Ludovic Courtès's avatar
      Rename (guix-kernel jupyter-server) to (jupyter kernels). · 0556e9dd
      Ludovic Courtès authored
      * guix-kernel/jupyter-server.scm: Rename to...
      * jupyter/kernels.scm: ... this.
      * guix-jupyter-container.scm, guix-jupyter-kernel.scm,
      guix-kernel/jupyter-client.scm: Adjust accordingly.
      * Makefile.am (SOURCES): Likewise.
      0556e9dd
    • Ludovic Courtès's avatar
      Move messaging to (jupyter messages). · 2cc4a5cc
      Ludovic Courtès authored
      * guix-kernel/jupyter-client.scm (<header>, <message>, message)
      (make-message, message-parts, reply, message-type, message-sender)
      (string->header, header->string, parts->message, DELIM): Move to...
      * jupyter/messages.scm: ... here.  New file.
      (get-signature, make-id): New procedures.
      * guix-kernel/hmac.msc, guix-kernel/tools.scm, tests/tools.scm: Remove.
      * Makefile.am (SOURCES, SCM_TESTS): Adjust accordingly.
      * guix-jupyter-container.scm, guix-jupyter-kernel.scm,
      guix-kernel/jupyter-client.scm: Adjust import list accordingly.
      * tests/hmac.scm (get-signature): New variable.
      2cc4a5cc
    • Ludovic Courtès's avatar
      Use <kernel> records to represent proxies. · 7da97367
      Ludovic Courtès authored
      * guix-jupyter-kernel.scm (<proxy>): Remove.
      (register-proxy): Add docstring.
      (new-container-connect): Return a <kernel> object.
      (reply-execute-request, kill-containers): Adjust accordingly.
      7da97367
    • Ludovic Courtès's avatar
      Remove <notebook>, use <kernel> throughout. · 30004d60
      Ludovic Courtès authored
      * guix-kernel/jupyter-client.scm (<notebook>, notebook): Remove.
      (json->notebook): Rename to...
      (json->kernel): ... this, and adjust accordingly.
      (read-message, send-message, relay-message, pub, pub-busy)
      (pub-idle, reply-html): Adjust accordingly.
      * guix-kernel/jupyter-server.scm (<kernel>)[key]: New field.
      (kernel-iopub): New macro.
      (kernel): Add #:key.
      (close-kernel): New procedure.
      * guix-jupyter-kernel.scm: Adjust, replacing "notebook" with "kernel".
      * guix-jupyter-container.scm: Likewise.
      30004d60
    • Ludovic Courtès's avatar
      Rewrite Jupyter messaging. · cc7fa604
      Ludovic Courtès authored
      Introduce <message> and <header> record that map directly to the Jupyter
      specs.
      
      This is a breaking change.
      cc7fa604
  2. 11 Jun, 2019 1 commit
  3. 14 Feb, 2019 2 commits
  4. 16 Oct, 2018 3 commits
    • Ludovic Courtès's avatar
      kernel: Remove unused 'send-to-container' parameter. · ab176916
      Ludovic Courtès authored
      * guix-jupyter-kernel.scm (send-to-container): Remove unused
      'containers' parameter.
      (proxy-exec-container, kill-containers): Adjust accordingly.
      ab176916
    • Ludovic Courtès's avatar
      kernel: Define a <proxy> record type and use it. · eb1396b5
      Ludovic Courtès authored
      * guix-jupyter-kernel.scm: Use SRFI-19.
      (session-id): Adjust accordingly.
      (<proxy>): New record type.
      (register-container, container-by-name, container-socket-by-name):
      Remove.
      (register-proxy, proxy-by-name): New procedures.
      (reply-execute-request): Adjust accordingly.
      (kill-containers): Rewrite using 'vlist-for-each'.
      (new-container-connect): Return a proxy record.
      eb1396b5
    • Ludovic Courtès's avatar
      client: 'pub' procedures now take a notebook. · 4f172f92
      Ludovic Courtès authored
      * guix-kernel/jupyter-client.scm (pub, pub-busy, pub-idle): Remove
      'socket' and 'key' parameters, add 'notebook' parameter instead.
      4f172f92
  5. 15 Oct, 2018 2 commits
    • Ludovic Courtès's avatar
      kernel: Remove '%notebook' global variable. · 3ec4956c
      Ludovic Courtès authored
      * guix-jupyter-kernel.scm (%notebook): Remove.
      (reply-kernel-info-request): Remove 'socket' parameter; add 'notebook'
      parameter and adjust accordingly.
      (reply-execute-request): Likewise.
      (shutdown): Likewise.
      (start-container): Add 'notebook' parameter and use it.
      (start-kernel): Likewise.
      (run-new-container): Remove.
      <top level>: Adjust 'sigaction' and 'start-kernel' calls accordingly.
      3ec4956c
    • Ludovic Courtès's avatar
      client: Add a <notebook> record type and use it. · c7fd4571
      Ludovic Courtès authored
      * guix-kernel/jupyter-client.scm (<notebook>): New record type.
      (json->notebook, close-notebook): New procedures.
      * guix-jupyter-kernel.scm (%notebook): New variable.
      (notebook-info, get-notebook-info-atom)
      (notebook-info-control-port, notebook-info-shell-port)
      (notebook-info-transport, notebook-info-signature-scheme)
      (notebook-info-stdin-port, notebook-info-heartbeat-port)
      (notebook-info-ip, notebook-info-iopub-port)
      (notebook-info-key, create-address, context)
      (addr-heartbeat, addr-shell, addr-control, addr-iopub)
      (addr-stdin, socket-heartbeat, socket-shell, socket-control)
      (socket-iopub, socket-stdin, addresses, sockets): Remove.
      Remove top-level calls to 'zmq-set-socket-option' and
      'zmq-bind-socket'.
      (proxy-exec-container, heartbeat-handler, general-handler)
      (reply-kernel-info-request, reply-execute-request)
      (start-container, start-kernel): Refer to %NOTEBOOK instead of referring
      to the individual variables.
      (atexit, sig-exit-handler): Remove.
      (shutdown): Remove call to 'atexit'.
      (exit-handler): New procedure.
      Use it in top-level 'sigaction' calls.
      c7fd4571
  6. 11 Oct, 2018 1 commit
    • Ludovic Courtès's avatar
      jupyter-server: Define a <kernel> record type. · b59ff4a5
      Ludovic Courtès authored
      * guix-kernel/jupyter-server.scm (<kernel>): New record type.
      (kernel): New procedure.
      (run-kernel): Return a <kernel> instead of an alist.
      * guix-jupyter-container.scm (register-kernel): Replace 'name' and
      'values' parameters with 'kernel'.
      (kernel-by-name): Return the kernel itself, not the pair.
      (kernel-shell-by-name, kernel-iosub-by-name): Remove.
      (proxy-exec-kernel): Adjust accordingly.
      b59ff4a5
  7. 24 Sep, 2018 2 commits
    • Ludovic Courtès's avatar
      jupyter-server: Use keyword arguments. · 40b45870
      Ludovic Courtès authored
      * guix-kernel/jupyter-server.scm (new-connection-file): Change to use
      keyword arguments.  Use 'call-with-output-file' instead of
      'open-output-file'.
      (run-kernel): Adjust accordingly.
      40b45870
    • Ludovic Courtès's avatar
      Send and receive bytevectors. · da295031
      Ludovic Courtès authored
      This avoids the occasional string decoding error for byte streams that
      were not actual UTF-8 strings.
      
      This is based on commit fbab29d738b46d8637579ccec93be49520a4606f ("Fixed
      a bug when the kernel could not send kernel_info (1 minute pause after
      notebook starts)") of <https://github.com/jerry40/guile-kernel
      
      >.
      
      * guix-jupyter-container.scm (reply-execute-request): Turn UUID into a
      bytevector.
      * guix-jupyter-kernel.scm (send-to-container): Turn NAME into a
      bytevector and use 'zmq-send-msg-parts-bytevector'.
      (heartbeat-handler): Use '-bytevector' send and receive procedures.
      (general-handler): Likewise.  Add calls to 'utf8->string' as needed.
      * guix-kernel/jupyter-client.scm (send-to-jupyter)
      (pub): Likewise.
      * guix-kernel/jupyter-server.scm (run-kernel): Likewise.
      Co-authored-by: default avatarjerry40 <epanfilov@gmail.com>
      da295031
  8. 21 Sep, 2018 3 commits
  9. 20 Sep, 2018 2 commits
  10. 11 Sep, 2018 9 commits