From d43de0e9cd8941d88e604ba94780e948893dc68c Mon Sep 17 00:00:00 2001 From: Karel Malec Date: Wed, 7 Jun 2017 00:17:33 +0200 Subject: [PATCH 1/3] Add a no_overlay option for the rkt task config. --- client/driver/rkt.go | 11 ++++++++++- website/source/docs/drivers/rkt.html.md | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/client/driver/rkt.go b/client/driver/rkt.go index 4f29e33b340c..afd3c44a0899 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -82,7 +82,8 @@ type RktDriverConfig struct { PortMap map[string]string `mapstructure:"-"` // A map of host port and the port name defined in the image manifest file Volumes []string `mapstructure:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container - Debug bool `mapstructure:"debug"` // Enable debug option for rkt command + NoOverlay bool `mapstructure:"no_overlay"` // disable overlayfs for rkt run + Debug bool `mapstructure:"debug"` // Enable debug option for rkt command } // rktHandle is returned from Start/Open as a handle to the PID @@ -155,6 +156,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error { "volumes": &fields.FieldSchema{ Type: fields.TypeArray, }, + "no_overlay": &fields.FieldSchema{ + Type: fields.TypeBool, + }, }, } @@ -264,6 +268,11 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e } cmdArgs = append(cmdArgs, "run") + // disable overlayfs + if driverConfig.NoOverlay { + cmdArgs = append(cmdArgs, "--no-overlay=true") + } + // Write the UUID out to a file in the state dir so we can read it back // in and access the pod by UUID from other commands uuidPath := filepath.Join(ctx.TaskDir.Dir, "rkt.uuid") diff --git a/website/source/docs/drivers/rkt.html.md b/website/source/docs/drivers/rkt.html.md index b3efe62a408e..1d7755698826 100644 --- a/website/source/docs/drivers/rkt.html.md +++ b/website/source/docs/drivers/rkt.html.md @@ -88,6 +88,9 @@ The `rkt` driver supports the following configuration in the job spec: * `debug` - (Optional) Enable rkt command debug option. +* `no_overlay` - (Optional) When enabled, will use --no-overlay=true flag for 'rkt run'. + Useful when running jobs on older systems affected by https://github.com/rkt/rkt/issues/1922 + * `volumes` - (Optional) A list of `host_path:container_path` strings to bind host paths to container paths. From aa5b61c98204f0377035ce69c32cfc816bd811cc Mon Sep 17 00:00:00 2001 From: Karel Malec Date: Wed, 7 Jun 2017 20:54:21 +0200 Subject: [PATCH 2/3] Fix the backticks --- website/source/docs/drivers/rkt.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/docs/drivers/rkt.html.md b/website/source/docs/drivers/rkt.html.md index 1d7755698826..96663f23b164 100644 --- a/website/source/docs/drivers/rkt.html.md +++ b/website/source/docs/drivers/rkt.html.md @@ -88,7 +88,7 @@ The `rkt` driver supports the following configuration in the job spec: * `debug` - (Optional) Enable rkt command debug option. -* `no_overlay` - (Optional) When enabled, will use --no-overlay=true flag for 'rkt run'. +* `no_overlay` - (Optional) When enabled, will use `--no-overlay=true` flag for 'rkt run'. Useful when running jobs on older systems affected by https://github.com/rkt/rkt/issues/1922 * `volumes` - (Optional) A list of `host_path:container_path` strings to bind From 9f362d6557ae026483692d3aac5073be51ea3062 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 9 Jun 2017 10:40:47 -0700 Subject: [PATCH 3/3] Fix bad merge conflict resolution --- client/driver/rkt.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/driver/rkt.go b/client/driver/rkt.go index 7193466a9efc..7ad4ad4d073e 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -83,8 +83,8 @@ type RktDriverConfig struct { Volumes []string `mapstructure:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container InsecureOptions []string `mapstructure:"insecure_options"` // list of args for --insecure-options - NoOverlay bool `mapstructure:"no_overlay"` // disable overlayfs for rkt run - Debug bool `mapstructure:"debug"` // Enable debug option for rkt command + NoOverlay bool `mapstructure:"no_overlay"` // disable overlayfs for rkt run + Debug bool `mapstructure:"debug"` // Enable debug option for rkt command } // rktHandle is returned from Start/Open as a handle to the PID @@ -159,6 +159,7 @@ func (d *RktDriver) Validate(config map[string]interface{}) error { }, "no_overlay": &fields.FieldSchema{ Type: fields.TypeBool, + }, "insecure_options": &fields.FieldSchema{ Type: fields.TypeArray, },