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

External Apps download data directly to the docker image, not host storage (Docker on Unraid) #466

Open
farhills opened this issue Dec 5, 2024 · 1 comment
Labels
docker Docker Engine API enhancement New feature or request

Comments

@farhills
Copy link

farhills commented Dec 5, 2024

Describe the bug

I originally posted this to docker-socket-proxy, but think app_api might be the more appropriate repo?
nextcloud/docker-socket-proxy#40

Docker image size limit is exceeded during external app installation, causing install to fail.

Steps/Code to Reproduce

  1. Configure and test the Daemon
  2. Run the test deployment
  3. Install an external App (STT Whisper 2)
  4. Data for both the test deployment as well as the installed app is saved to the docker image /volumes dir. As the STT Whisper app has a significant amount of AI model data, the docker image size limit is exceeded causing the install to fail.

Image

Expected Results

I am not a dev, so this could be a misunderstanding on my part, but I thought the docker image held executable binaries, whereas application data (such as AI models in this specific case) should be stored elsewhere on the host storage.

Assuming I'm not wrong, there should be a host path env variable for downloaded data to be saved to the host storage outside the docker image (since my nextcloud instance is installed via docker as well, presumably this path can be read/imported from the main nextcloud installation).

If this already exists, could the docs be updated to include the container path where downloaded external app data will be saved so that we can map it appropriately on the host system?

Actual Results

Docker image size limit exceeded, causing exapp install to fail.

Setup configuration

Web server: Nginx

Database: Maria 10.11

PHP version: 8.3

Nextcloud version: 29.0.4

Operating system: Docker / Unraid 6.12.13

@bigcat88 bigcat88 added enhancement New feature or request docker Docker Engine API labels Jan 2, 2025
@R0Wi
Copy link
Member

R0Wi commented Jan 22, 2025

Generally speaking an External App is nothing else than a Docker container, managed by Nextcloud. By default, when NC creates a container, it will create a named volume and attach it to the container here:

return self::EX_APP_CONTAINER_PREFIX . $appId . '_data';

You should be able to see the mount if you docker inspect the container

"Mounts": [
   {
      "Type": "volume",
      "Source": "nc_app_workflow_ocr_backend_data",
      "Target": "/nc_app_workflow_ocr_backend_data"
   }
]

If the ExApp properly implements it's file handling, it should persist files at this location. The default ExApp Python framework already supports this:

https://github.com/cloud-py-api/nc_py_api/blob/f6ecab817d25a7c55ae296ab713997db905cc705/nc_py_api/ex_app/misc.py#L9

And also stt_whisper2 makes use of this:

https://github.com/nextcloud/stt_whisper2/blob/34aa8f11fac6ede530c48c3f15a7742150bc64c8/lib/main.py#L31

Coming back to your question: if you want to use a different physical location for your named Docker volumes, check the --data-root parameter. The default path on Linux for Docker images is /var/lib/docker/volumes but using the above parameter, you can define your own root storage path which fits your environment. I don't think that this should be handled by Nextcloud.

Hope this helps 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Docker Engine API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants