loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.44k stars 311 forks source link

DevPod Kubernetes provider not handling bind mounts correctly #947

Open nesta219 opened 4 months ago

nesta219 commented 4 months ago

What happened?
I wanted to use devcontainer mounts to mount a pip.conf file to my DevPod container in order to pull private python dependencies. When I looked at the file on my DevPod's filesystem though, the pip.conf file was not a file, it was an empty directory.

What did you expect to happen instead?
I expected the pip.conf file to be created in the target location

How can we reproduce the bug? (as minimally and precisely as possible)

My devcontainer.json:

{
   ...
  "mounts": [
    {
      "source": "/opt/homebrew/etc/pip.conf",
      "target": "/tmp/pip.conf",
      "type": "bind"
    }
  ],
  ...
}

Local Environment:

DevPod Provider:

Anything else we need to know?

pascalbreuninger commented 4 months ago

Hey @nesta219, I've been investigating this for a bit and haven't found a (quick) reliable solution for the kubernetes provider. The problem is that an empty volume mount will be usually (depends on the container runtime) created as a directory in the container.

There are ways around this but none of the ones I'm aware of are easy. I'd keep this ticket open for now and see how many other people face this problem.

scottwn commented 1 month ago

I've noticed the same using the AWS provider. The workspace directory is not mounted to the container. Should I open a separate issue for the AWS provider mounts?

pascalbreuninger commented 1 month ago

@scottwn This issue is about single file mounts not working on kubernetes, what you're describing sounds like a different problem to me. Would be great if you could open a separate issue for it 👍