-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix rkt mounts and add arbitrary volume mounting #1812
Conversation
|
||
// rktVolumesConfigOption is the key for enabling the use of custom | ||
// bind volumes. | ||
rktVolumesConfigOption = "rkt.volumes.enabled" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this documented on the website? Plus the docker option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
cmdArgs = append(cmdArgs, fmt.Sprintf("--mount=volume=%s,target=%s", task.Name, ctx.AllocDir.SharedDir)) | ||
|
||
// Mount /alloc | ||
cmdArgs = append(cmdArgs, fmt.Sprintf("--volume=%salloc,kind=host,source=%s", task.Name, ctx.AllocDir.SharedDir)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should be using file path.Join and using the constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To generate the source=%s
path? Won't that just be reimplementing what's in ctx.AllocDir.SharedDir
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the unique volume names.
827e8b5
to
a5c13e1
Compare
@@ -9,6 +9,7 @@ IMPROVEMENTS: | |||
* client: Introduce a `secrets/` directory to tasks where sensitive data can | |||
be written [GH-1681] | |||
* driver: Export `NOMAD_JOB_NAME` environment variable [GH-1804] | |||
* driver/rkt: Support rkt volumes (rkt >= 1.0.0 required) [GH-1812] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lexicographical ordering, rkt after docker
|
||
// Mount arbitrary volumes if enabled | ||
if len(driverConfig.Volumes) > 0 { | ||
if enabled := d.config.ReadBoolDefault(rktVolumesConfigOption, false); !enabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to default true
## Task Directories | ||
* `volumes` - (Optional) A list of `host_path:container_path` strings to bind | ||
host paths to container paths. Can only be run on clients with the | ||
`rkt.volumes.enabled` option set to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording should slightly change based on changing the default
@@ -141,7 +149,7 @@ func (d *RktDriver) Fingerprint(cfg *config.Config, node *structs.Node) (bool, e | |||
return false, nil | |||
} | |||
|
|||
outBytes, err := exec.Command("rkt", "version").Output() | |||
outBytes, err := exec.Command(rktCmd, "version").Output() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add rktVolumesConfigOption to the attributes during fingerprinting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
c4fd186
to
31a8149
Compare
Make section names match between docker and rkt
Fix rkt docs and custom volume mounting
dc1dabe
to
5357579
Compare
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Just like #1767 did for the docker driver.