You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build a system like HackerRank, i.e., the code submitted by the user should be executed on the server. From what I understand, bst can be used for this.
If I run bst, it opens my shell as mentioned in the documentation. If I delete files the changes are persisted outside my isolated environment. Can somebody please explain what I am missing?
I tried changing the root with --root, but this is what I get:
samuel@Titan ~/p/bst (main) [1]> bst --root ~/Desktop/test-root ls
bst-init: execvpe ls: No such file or directory
PS: I have no knowledge about namespaces.
The text was updated successfully, but these errors were encountered:
In these cases bst won't setup a root filesystem for you because there's just too much variation between use-cases. For what you want to do, there's a few options:
Bind-mount the root onto itself read-only (e.g., bst -r <root> --mount <root>,/,none,rbind,ro). This of course means that your rootfs won't be mutable (so no running some package manager) but is probably the fastest way to provide a working immutable root.
Copy the root dir and just enter it. If your system supports filesystems with unprivileged subvolume creation and snapshotting like btrfs, this can be extremely quick too.
If your kernel allows the use of overlay2 mounts unprivileged in a user namespace, then you can use a setup script to create a discardable overlay: bst -r /mnt --setup 'mount -t tmpfs tmp /tmp && mount -t overlay overlay -o lowerdir=/,upperdir=/tmp/upper,workdir=/tmp/work $ROOT'. Most distro kernels disable this though.
All of these are still highly dependent on what you want to achieve. You could also construct a rootfs dynamically with copies and bind-mounts with an elaborate setup script too.
I am trying to build a system like HackerRank, i.e., the code submitted by the user should be executed on the server. From what I understand,
bst
can be used for this.If I run
bst
, it opens my shell as mentioned in the documentation. If I delete files the changes are persisted outside my isolated environment. Can somebody please explain what I am missing?I tried changing the root with
--root
, but this is what I get:PS: I have no knowledge about namespaces.
The text was updated successfully, but these errors were encountered: