Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow silo/bindflt to be turned off via an annotation #2022

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/containerd-shim-runhcs-v1/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ func (p *pod) CreateTask(ctx context.Context, req *task.CreateTaskRequest, s *sp
s.Annotations,
annotations.HostProcessInheritUser,
annotations.HostProcessRootfsLocation,
annotations.HostProcessDisableSilo,
)
}

Expand Down
7 changes: 7 additions & 0 deletions internal/jobcontainers/jobcontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/Microsoft/hcsshim/internal/queue"
"github.com/Microsoft/hcsshim/internal/resources"
"github.com/Microsoft/hcsshim/internal/winapi"
"github.com/Microsoft/hcsshim/pkg/annotations"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"golang.org/x/sys/windows"
Expand Down Expand Up @@ -188,6 +189,12 @@ func Create(ctx context.Context, id string, s *specs.Spec) (_ cow.Container, _ *
}
})

if forceNoSilo, ok := s.Annotations[annotations.HostProcessDisableSilo]; ok {
if forceNoSilo == "true" {
fileBindingSupport = false
}
}

var closer resources.ResourceCloser
if fileBindingSupport {
closer, err = container.bindSetup(ctx, s)
Expand Down
3 changes: 3 additions & 0 deletions pkg/annotations/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ const (
// supplied was C:\rootfs and the container's ID is 12345678 the rootfs will be located at C:\rootfs\12345678.
HostProcessRootfsLocation = "microsoft.com/hostprocess-rootfs-location"

// HostProcessDisableSilo indicates to turn off silo/bindflt features, even if the host supports it.
HostProcessDisableSilo = "microsoft.com/hostprocess-no-silo"

// AllowOvercommit indicates if we should allow over commit memory for UVM.
// Defaults to true. For physical backed memory, set to false.
AllowOvercommit = "io.microsoft.virtualmachine.computetopology.memory.allowovercommit"
Expand Down
Loading