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

Hugepages support for LCOW #104

Merged
Merged
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
13 changes: 10 additions & 3 deletions pkg/server/container_create_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ package server

import (
"fmt"
"github.com/sirupsen/logrus"
"net/url"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"

"github.com/sirupsen/logrus"

runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
Expand Down Expand Up @@ -171,9 +172,9 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
}

log.G(ctx).WithFields(logrus.Fields{
"id": id,
"id": id,
"runtimeHandler": sandbox.RuntimeHandler,
"spec": spew.NewFormatter(spec),
"spec": spew.NewFormatter(spec),
}).Debug("Container creation")

// If the config field is specified, set the snapshotter label to reuse the pods
Expand Down Expand Up @@ -514,6 +515,12 @@ func (c *criService) addOCIMounts(ctx context.Context, g *generator, platform im
return errors.Errorf(`sandbox://%s' mounts are only supported for LCOW`, src)
}
mountType = "bind"
} else if strings.HasPrefix(src, "hugepages://") {
// mount source prefix hugepages:// is only supported with lcow
if platform.OS != "linux" || platform.Architecture != "amd64" {
return errors.Errorf(`hugepages://%s mounts are only supported for LCOW`, src)
}
mountType = "bind"
} else if strings.Contains(src, "kubernetes.io~empty-dir") && platform.OS == "linux" && platform.Architecture == "amd64" {
// kubernetes.io~empty-dir in the mount path indicates it comes from the kubernetes
// empty-dir plugin, which creates an empty scratch directory to be shared between
Expand Down