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

Cannot see files in mounted folder from within a Docker container #1522

Closed
JackCaster opened this issue Sep 19, 2024 · 7 comments
Closed

Cannot see files in mounted folder from within a Docker container #1522

JackCaster opened this issue Sep 19, 2024 · 7 comments
Assignees
Labels
Milestone

Comments

@JackCaster
Copy link

JackCaster commented Sep 19, 2024

Which version of blobfuse was used?

blobfuse2 version 2.3.2

Which OS distribution and version are you using?

Linux Debian

If relevant, please share your mount command.

blobfuse2 mount <...> --config-file=.blobfuse2.yml --subdirectory=<...> --tmp-path=<...>

What was the issue encountered?

I am working with a Docker container (specifically, a VS Code Dev Container). If I mount the blob before I start the Docker container, then I can see the files in the mounted folder. If I mount the blob after I started the Docker container (from a terminal in the host---not within the Docker), I can only see mounted folder but not the actual files.

Have you found a mitigation/solution?

No

Config

allow-other: true # adjust also etc/fuse.conf

logging:
  type: syslog
  level: log_debug

components:
  - libfuse
  - file_cache
  - attr_cache
  - azstorage

libfuse:
  attribute-expiration-sec: 120
  entry-expiration-sec: 120
  negative-entry-expiration-sec: 240

file_cache:
  timeout-sec: 120
  max-size-mb: 4096

attr_cache:
  timeout-sec: 7200

azstorage:
  type: block
  account-name: <...>
  container: <...>
  mode: sas # set env variable AZURE_STORAGE_SAS_TOKEN
@JackCaster
Copy link
Author

To be precise, reloading the container fixes the problem sometimes. Rebuilding the container seems to be the most consistent way to get access to the mounted data

@vibhansa-msft
Copy link
Member

Can you try the same without container. I feel this has something to do with the environment and not blobfuse.

@JackCaster
Copy link
Author

JackCaster commented Sep 19, 2024

Without container it works, so all files are visible. But when the container is running, those files are not visible from within the docker, while being available in the host. Afaik, the folders in the host (included the blobfuse ones) are bind-mounted in the container.

It used to work few months ago (I can’t be too specific on what version I was on), where the mounted blob acted like any other folder. Now, I think there is something about the caching. If I mount the blob and rebuild the container, the files are there. Then, if I unmount the blob in the host, the files remain visible in the container.

I will open an issue on the vscode repo too.

@vibhansa-msft
Copy link
Member

If you have mounted on host and then trying to access it via container, that migth not work. For Blobfuse to work, file-system calls have to reach it via kernel. In case of container accessing the file-system it might be some docker mechanism to access the files and hence I doubt. For your case to work, I suggest mounting inside the container itself.

@JackCaster
Copy link
Author

JackCaster commented Sep 19, 2024

Thanks but I do not fully understand. Are you suggesting that the docker mount mechanism (bind mount) is not compatible with a blobfuse mount?

EDIT

... I suggest mounting inside the container itself.

This could work but it is not ideal. I use blobfuse2 on the host as I need that data available in my system. But I use the devcontainer for some specific development work. I would expect the mapping to work as with other normal local folder

EDIT2
Also, the dockerfile becomes much more complex if I included blobfuse functionalities, which makes collaborative work more complex too (as other collaborators may deal with data in a different way and not use blobfuse at all)

EDIT3
I tried block_cache instead of file_cache and the content of the blobfuse mount is updated in the Docker container after I restarted the container (the file_cache, instead, requires a rebuilt)

@vibhansa-msft
Copy link
Member

So, with block cache things are working fine you mean?
If so, only guess I have here is file-cache is relying on a path that is not accessible to the pod and that might be creating some issue. Otherwise, this behavior shall not change across file-cache or block-cache.

@vibhansa-msft vibhansa-msft self-assigned this Sep 24, 2024
@vibhansa-msft vibhansa-msft added this to the v2-2.4.0 milestone Sep 24, 2024
@vibhansa-msft
Copy link
Member

Blobfuse does support docker containers and AKS. However, required directories are accessible or not has to be taken care by the user while configuring the docker container. Blobfuse will just try to use the provided path and does not play around with ownership of those. If the file-cache path is not available in the system, it may fail. As block-cache is working fine for you, you can stick to block-cache as well. Also, we have some sample docker files in our repository you can check those out as well. Feel free to post any further queries you have here. Closing as there is no action item on the blobfuse side.

@vibhansa-msft vibhansa-msft modified the milestone: v2-2.4.0 Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@JackCaster @vibhansa-msft and others