1. 30 Sep, 2019 2 commits
    • Ludovic Courtès's avatar
      kernels: Make 'jupyter-kernel-path' a SRFI-39 parameter. · 7bbbe8ec
      Ludovic Courtès authored
      * jupyter/kernels.scm (jupyter-kernel-path): Make a parameter.
      7bbbe8ec
    • Ludovic Courtès's avatar
      Add support for a built-in Guile kernel. · 1da53a23
      Ludovic Courtès authored
      * jupyter/kernels.scm (jupyter-kernel-path, kernel-specs): Export.
      * jupyter/guile.scm (guile-kernel-specs, available-kernel-specs-files):
      New procedures.
      * guix-jupyter-kernel.scm (create-environment): Use
      'available-kernel-specs' instead of 'available-kernel-specs-files' and
      adjust accordingly.
      (start-container)[spawn]: Likewise.
      * guix-kernel-demo.ipynb: Add example.
      1da53a23
  2. 26 Sep, 2019 1 commit
    • Ludovic Courtès's avatar
      messages: Add <kernel-status>. · b23ee453
      Ludovic Courtès authored
      * jupyter/messages.scm (<kernel-status>): New record type.
      * jupyter/kernels.scm (pub): Expect a <kernel-status> record and use
      'kernel-status->json'.
      (pub-busy, pub-idle): Pass a <kernel-status> record.
      * tests/kernels.scm ("run-kernel python3")
      ("kernel_info_request", "execute_request"): Use 'json->kernel-status'
      instead of alists.
      b23ee453
  3. 24 Sep, 2019 3 commits
  4. 20 Sep, 2019 1 commit
  5. 19 Sep, 2019 1 commit
    • Ludovic Courtès's avatar
      environment: Rewrite to use a profile manifest and 'eval/container*'. · 24c8abfd
      Ludovic Courtès authored
      * guix/jupyter/environ.scm: Remove.
      * guix/jupyter/environment.scm, guix/jupyter/containers.scm: New files.
      * tests/environ.scm: Remove.
      * Makefile.am (SOURCES): Adjust accordingly.
      (SCM_TESTS): Remove tests/environ.scm.
      * guix-jupyter-container.scm <top level>: Turn into...
      (run-inner-proxy): ... this.  New procedure.
      * guix-jupyter-kernel.scm (%inferior): New variable.
      (reply-execute-request): Use 'string-tokenize' and
      'specifications->manifest'.  Pass the manifest to 'start-container'.
      (module-to-import?): New procedure.
      (start-container): Rewrite to take a manifest and to evaluate code with
      'eval/container*'.  Set the 'GUIX_ENVIRONMENT' and 'JUPYTER_PATH'
      environment variables.
      * jupyter/kernels.scm (jupyter-kernel-path): Remove "GUIX_PROFILE"
      hack.
      24c8abfd
  6. 16 Sep, 2019 1 commit
    • Ludovic Courtès's avatar
      Require Guile-Gcrypt >= 0.2.0. · 84c4fdb6
      Ludovic Courtès authored
      * configure.ac: Ensure we have the (gcrypt mac) module.
      * jupyter/kernels.scm: Use (gcrypt mac) instead of (gcrypt hmac).
      (generate-key): Call 'generate-signing-key'.
      * jupyter/messages.scm: Use (gcrypt mac).
      (get-signature): Use 'mac-algorithm' instead of a symbol.
      84c4fdb6
  7. 13 Sep, 2019 4 commits
    • Ludovic Courtès's avatar
      json: Rebase on top of 'define-record-type*'. · b01b7af1
      Ludovic Courtès authored
      * jupyter/json.scm (json, <=>): New variables.
      (define-json-reader): Adjust to the new syntax for SPEC.
      (define-json-writer): Likewise.
      (define-json-mapping): Rebase on top of 'define-record-type*'.  Move
      JSON field spec under the 'json' keyword.
      * jupyter/kernels.scm (<kernel-specs>, <connection>): Adjust
      accordingly.
      (find-kernel-specs, allocate-connection): Use new syntactic
      constructors.
      b01b7af1
    • Ludovic Courtès's avatar
      kernels: 'reply-html' doesn't set a recipient on iopub messages. · 0ff99a32
      Ludovic Courtès authored
      * jupyter/kernels.scm (reply-html): Pass #:recipient only when SOCKET is
      'kernel-shell'.
      0ff99a32
    • Ludovic Courtès's avatar
      kernels: 'reply-html' replies to the message sender. · aa902cec
      Ludovic Courtès authored
      * jupyter/kernels.scm (reply-html): Pass #:recipient to 'send-message'.
      aa902cec
    • Ludovic Courtès's avatar
      Rewrite proxy to use 'serve-kernels'. · 1726ccb3
      Ludovic Courtès authored
      * jupyter/kernels.scm (generate-key): New procedure.
      (relay-message): Remove.
      * jupyter/messages.scm (<message>): Use 'define-immutable-record-type'
      and define 'set-message-content'.
      * guix-jupyter-container.scm (local-eval): Rewrite in terms of
      'send-message'.
      (reply-html-to-kernel): Remove.
      (general-handler): Copy from *-kernel.scm.
      (execute-request-sans-magic): New procedure.
      (ignore-request, reply-execute-request, shutdown): Adjust to new calling
      convention.
      (%main-kernel, %main-kernel-id): New variables.
      <top level>: Use 'serve-kernels'.
      * guix-jupyter-kernel.scm (%main-kernel, %main-kernel-id): New
      variables.
      (general-handler): Check whether we're talking to %MAIN-KERNEL.
      (reply-kernel-info-request, reply-execute-request, shutdown): Add 'kind'
      parameter.
      (new-container-connect): Remove.
      (start-container): Return a <kernel>.
      <top level>: Pass both the "default" container kernel and our client to
      'server-kernels'.  Set %MAIN-KERNEL.
      1726ccb3
  8. 12 Sep, 2019 2 commits
    • Ludovic Courtès's avatar
      kernels: Allow for OS-allocated TCP port numbers. · 150c006f
      Ludovic Courtès authored
      * jupyter/kernels.scm (allocate-connection): #:first-port defaults to #f.
      [allocate-port]: New procedure
      [try-connect]: New procedure.
      Use it in lieu of 'test-bind', and remove the extra 'zmq-connect'
      calls.
      (test-bind): Remove.
      150c006f
    • Ludovic Courtès's avatar
      servers: Add 'serve-kernels'. · fe70f6da
      Ludovic Courtès authored
      * jupyter/kernels.scm (kernel-socket-kind): New procedure.
      (zmq-poll*, allocate-connection): Export.
      * jupyter/servers.scm (%server-scheduler-prompt, %server-exit-prompt):
      New variables.
      * jupyter/servers.scm (monitor-client, leave-server-loop)
      (serve-kernels): New procedures.
      * tests/servers.scm: New file.
      fe70f6da
  9. 09 Sep, 2019 12 commits
    • Ludovic Courtès's avatar
      kernels: Catch EINTR on 'zmq-poll' calls. · 5093a6ea
      Ludovic Courtès authored
      * jupyter/kernels.scm (EINTR-safe): New procedure.
      (read-message): Use it.
      5093a6ea
    • Ludovic Courtès's avatar
      kernels: 'read-message' no longer calls a non-existent procedure. · baaad11b
      Ludovic Courtès authored
      * jupyter/kernels.scm (read-message): Remove call to non-existent
      'zmq-get-msg-bytevector'.
      baaad11b
    • Ludovic Courtès's avatar
      kernels: Define <connection> record type and use it. · 3edceba2
      Ludovic Courtès authored
      * jupyter/kernels.scm (<kernel>): Use 'define-immutable-record-type'.
      Add 'set-kernel-name' and 'set-kernel-pid'.
      (find-kernel-by-name): Rename to...
      (find-kernel-specs-file): ... this.
      (find-kernel-specs): New procedure.
      (<connection>): New record type.
      (new-connection-file, kernel-arguments, exec-kernel): Remove.
      (allocate-connection, spawn-kernel): New procedure.
      (run-kernel): Rewrite to take a <kernel-spec> and to use
      'allocate-connection'.
      * tests/kernels.scm (%python3-specs): New variable.
      ("run-kernel python3"): Adjust accordingly.
      * guix-jupyter-container.scm (reply-execute-request): Likewise.
      3edceba2
    • Ludovic Courtès's avatar
      kernels: Define <kernel-specs>. · 4c8895dd
      Ludovic Courtès authored
      * jupyter/kernels.scm (<kernel-specs>): New record type.
      (kernel-arguments): Use 'json->kernel-specs' and 'kernel-specs-arguments'.
      4c8895dd
    • 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: '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
      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
      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
      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
  10. 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
  11. 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
  12. 21 Sep, 2018 3 commits
  13. 11 Sep, 2018 1 commit
    • Ludovic Courtès's avatar
      Really search for 'ipython' in $PATH. · 669abe5e
      Ludovic Courtès authored
      Previously we assumed $PATH contained a single entry.
      
      * guix-kernel/jupyter-server.scm (search-path->list): New procedure.
      (exec-kernel): Use it along with 'search-path' to determine the absolute
      file name of 'ipython'.
      669abe5e
  14. 17 Jul, 2018 1 commit
    • ROUBY Pierre-Antoine's avatar
      guix-kernel: Add ipython. · 0c25abe7
      ROUBY Pierre-Antoine authored
      * guix-jupyter-container.scm (proxy-exec-kernel): Get streams message
        type.
        (local-eval): Send 'guix-end-of-eval' message.
      * guix-jupyter-kernel.scm (proxy-exec-container): Get streams message
        type.
      * guix-kernel/jupyter-client.scm (reply-html): Send 'guix-end-of-eval'
        message.
      * guix-kernel/jupyter-server.scm (exec-kernel): Add IPython.
      0c25abe7
  15. 05 Jul, 2018 1 commit
    • ROUBY Pierre-Antoine's avatar
      guix-kernel: Run Jupyter kernel over Guix kernel. · a76494a7
      ROUBY Pierre-Antoine authored
      * guix-jupyter-container.scm: Add magic kernel command.
      * guix-jupyter-kernel.scm: Add magic kernel command.
      * guix-kernel/jupyter-server.scm: New file.
      * Makefile.am: Add jupyter-server to SOURCE.
      * guix-kernel/magic.scm (magic-kernel?,
        magic-get-kernel-name): Add procedure.
        (magic?): Change '%%' by ';;'.
      * guix-kernel-demo.ipynb: Add new guix-kernel features.
      * logo.png: New file.
      a76494a7