Commit 8b59a735 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

kernel: Record the kernel's directory and home directory.

* guix/jupyter/kernel.scm (spawn-kernel/container)[mounts]: Take 'home'
instead of 'root'.  Adjust 'device' field accordingly.
Call 'set-kernel-properties' to record the kernel's root and home
directories.
parent f4d19593
......@@ -160,9 +160,9 @@ monadic value, a <kernel> connected to that process."
(allocate-connection context "tcp" "127.0.0.1"
(generate-key)))
(define (mounts root)
(define (mounts home)
(cons (file-system
(device (string-append root "/home"))
(device home)
(mount-point "/home/jupyter")
(type "none")
(check? #f)
......@@ -177,10 +177,13 @@ monadic value, a <kernel> connected to that process."
;; FIXME: Remove ROOT once the kernel has terminated.
(mlet* %store-monad ((root ((lift0 make-container-directory %store-monad)))
(home -> (string-append root "/home"))
(pid (eval/container* (spawn profile)
(string-append root "/root")
#:mounts (mounts root)
#:mounts (mounts home)
#:namespaces namespaces
#:guest-uid 1000
#:guest-gid 1000)))
(return (set-kernel-pid kernel pid))))
(return (set-kernel-properties (set-kernel-pid kernel pid)
`((home . ,home)
(directory . ,root))))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment