Skip to content

Commit

Permalink
Allow silo/bindflt to be turned off via an annotation
Browse files Browse the repository at this point in the history
This should fix regression #1699
  • Loading branch information
hach-que committed Feb 8, 2024
1 parent b0d91fb commit ca36c1f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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

0 comments on commit ca36c1f

Please sign in to comment.