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

mount options for host volumes #24519

Open
kpweiler opened this issue Nov 20, 2024 · 1 comment
Open

mount options for host volumes #24519

kpweiler opened this issue Nov 20, 2024 · 1 comment

Comments

@kpweiler
Copy link

kpweiler commented Nov 20, 2024

Nomad version

1.8.4

Operating system and Environment details

Ubuntu 22.04.5

Issue

I'm trying to mount an autofs mount from the host system into an exec driver task and getting Too many levels of symbolic links error when accessing the mount.

My assumption is that, with the exec driver, nomad is creating a bind mount mount --bind ... in the chroot'd directory from the host. This, in fact, will work if instead nomad were to use mount --rbind ... as rbind will follow submounts. The way I read the documentation, the host-to-task parameter should probably do this on host volumes. You could, alternatively, allow host volumes to set mount options.

Job file (if appropriate)

From the client config:

  host_volume "testvolume" {
    path      = "/testvolume"
    read_only = false
  }

And the full job spec:

job "example-job" {
  datacenters = ["ny5"]
  node_pool   = "bare_metal"

  type        = "batch"

  group "example-job" {

    volume "testvolume" {
      type = "host"
      source = "testvolume"
      read_only = false
    }

    task "example-job" {

      resources {
        memory = 128
      }

      volume_mount {
        volume      = "testvolume"
        destination = "/testvolume"
        read_only   = false
        propagation_mode = "bidirectional"
      }

      driver = "exec"
      config {
        command  = "ls"
        args     = ["/testvolume/testdata/test.txt"]
      }
    }
  }
}
@pkazmierczak pkazmierczak moved this from Needs Triage to Triaging in Nomad - Community Issues Triage Nov 22, 2024
@kpweiler kpweiler changed the title bidirectional volume propagation broken for host volumes using the exec driver host-to-task volume propagation broken for host volumes using the exec driver Dec 2, 2024
@tgross tgross moved this from Triaging to Needs Triage in Nomad - Community Issues Triage Dec 5, 2024
@tgross
Copy link
Member

tgross commented Dec 6, 2024

Hi @kpweiler! This is a timely issue, for sure, as we're currently working on host volume improvements as part of #15489. The MountConfig we end up with is actually the libcontainer runc.Mount structure which allows mount flags.

The volume request (the object in the volume block in the jobspec) already supports mount_options.mount_flags, so it'd be a matter of mapping that to the flags in the runc object. I'll look into getting this added as part of the Dynamic Host Volumes work.

@tgross tgross changed the title host-to-task volume propagation broken for host volumes using the exec driver mount options for host volumes Dec 6, 2024
@tgross tgross added this to the 1.10.0 milestone Dec 6, 2024
@tgross tgross moved this from Needs Triage to In Progress in Nomad - Community Issues Triage Dec 6, 2024
@tgross tgross added the hcc/jira label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants