Skip to content
Merged
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
5 changes: 5 additions & 0 deletions cmd/oci-runtime-tool/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var generateFlags = []cli.Flag{
cli.StringSliceFlag{Name: "linux-gidmappings", Usage: "add GIDMappings e.g HostID:ContainerID:Size"},
cli.StringSliceFlag{Name: "linux-hugepage-limits-add", Usage: "add hugepage resource limits"},
cli.StringSliceFlag{Name: "linux-hugepage-limits-drop", Usage: "drop hugepage resource limits"},
cli.StringFlag{Name: "linux-intelRdt-l3CacheSchema", Usage: "specifies the schema for L3 cache id and capacity bitmask"},
cli.StringSliceFlag{Name: "linux-masked-paths", Usage: "specifies paths can not be read inside container"},
cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"},
cli.Uint64Flag{Name: "linux-mem-kernel-tcp", Usage: "kernel memory limit for tcp (in bytes)"},
Expand Down Expand Up @@ -652,6 +653,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
}
}

if context.IsSet("linux-intelRdt-l3CacheSchema") {
g.SetLinuxIntelRdtL3CacheSchema(context.String("linux-intelRdt-l3CacheSchema"))
}

if context.IsSet("linux-mems") {
g.SetLinuxResourcesCPUMems(context.String("linux-mems"))
}
Expand Down
1 change: 1 addition & 0 deletions completions/bash/oci-runtime-tool
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ _oci-runtime-tool_generate() {
--linux-gidmappings
--linux-hugepage-limits-add
--linux-hugepage-limits-drop
--linux-intelRdt-l3CacheSchema
--linux-masked-paths
--linux-mem-kernel-limit
--linux-mem-kernel-tcp
Expand Down
6 changes: 6 additions & 0 deletions generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,12 @@ func (g *Generator) SetLinuxCgroupsPath(path string) {
g.spec.Linux.CgroupsPath = path
}

// SetLinuxIntelRdtL3CacheSchema sets g.spec.Linux.IntelRdt.L3CacheSchema
func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string) {
g.initSpecLinuxIntelRdt()
g.spec.Linux.IntelRdt.L3CacheSchema = schema
}

// SetLinuxMountLabel sets g.spec.Linux.MountLabel.
func (g *Generator) SetLinuxMountLabel(label string) {
g.initSpecLinux()
Expand Down
7 changes: 7 additions & 0 deletions generate/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ func (g *Generator) initSpecLinux() {
}
}

func (g *Generator) initSpecLinuxIntelRdt() {
g.initSpecLinux()
if g.spec.Linux.IntelRdt == nil {
g.spec.Linux.IntelRdt = &rspec.LinuxIntelRdt{}
}
}

func (g *Generator) initSpecLinuxSysctl() {
g.initSpecLinux()
if g.spec.Linux.Sysctl == nil {
Expand Down
3 changes: 3 additions & 0 deletions man/oci-runtime-tool-generate.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ read the configuration from `config.json`.
Drop hugepage rsource limits. Just need to specify PAGESIZE. e.g. --linux-hugepage-limits-drop=4MB
This option can be specified multiple times.

**--linux-intelRdt-l3CacheSchema**=""
Specifies the schema for L3 cache id and capacity bitmask.

**--linux-masked-paths**=[]
Specifies paths can not be read inside container. e.g. --linux-masked-paths=/proc/kcore
This option can be specified multiple times.
Expand Down