|
|
@ -31,7 +31,7 @@ function check_gvisor {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Check if a trivial command works under gvisor with the proposed flags.
|
|
|
|
# Check if a trivial command works under gvisor with the proposed flags.
|
|
|
|
if runsc --network none "$@" do true 2> /dev/null; then
|
|
|
|
if runsc --network none "$@" "do" true 2> /dev/null; then
|
|
|
|
export GVISOR_FLAGS="$@"
|
|
|
|
export GVISOR_FLAGS="$@"
|
|
|
|
export GVISOR_AVAILABLE=1
|
|
|
|
export GVISOR_AVAILABLE=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -40,9 +40,9 @@ function check_gvisor {
|
|
|
|
check_gvisor --unprivileged --ignore-cgroups
|
|
|
|
check_gvisor --unprivileged --ignore-cgroups
|
|
|
|
check_gvisor --unprivileged
|
|
|
|
check_gvisor --unprivileged
|
|
|
|
|
|
|
|
|
|
|
|
# If we can't use --unprivileged, stick with --rootless and no checkpoint
|
|
|
|
# If we can't use --unprivileged, stick with --rootless. We will not make a checkpoint.
|
|
|
|
if [[ -z "$GVISOR_FLAGS" ]]; then
|
|
|
|
check_gvisor --rootless
|
|
|
|
check_gvisor --rootless
|
|
|
|
|
|
|
|
else
|
|
|
|
if [[ "$GVISOR_FLAGS" =~ "-unprivileged" ]]; then
|
|
|
|
export GRIST_CHECKPOINT=/tmp/engine_$(echo $PWD | sed "s/[^a-zA-Z0-9]/_/g")
|
|
|
|
export GRIST_CHECKPOINT=/tmp/engine_$(echo $PWD | sed "s/[^a-zA-Z0-9]/_/g")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|