Skip to content

Commit

Permalink
Merge pull request #104 from ninzavivek/vivek_hugepages_mount
Browse files Browse the repository at this point in the history
Hugepages support for LCOW
  • Loading branch information
katiewasnothere authored Sep 7, 2021
2 parents df7756e + 979a403 commit c738ca4
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit c738ca4

Please sign in to comment.