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

Can't mount data (share_path) #2263

Closed
dasmehdix opened this issue Oct 6, 2020 · 18 comments
Closed

Can't mount data (share_path) #2263

dasmehdix opened this issue Oct 6, 2020 · 18 comments
Labels
documentation Documentation should be updated

Comments

@dasmehdix
Copy link

Hi. I am newbie about docker usage. I have a dataset with lots of photos. I want to label them into CVAT. As mentioned in doc, I should mount my dataset into docker. I tried multiple things. I edit and rebuilded docker-compose.yml and docker-composo.override.yml but still docker can't acces my dataset. My OS is Windows 10 with WSL2. In the example share_path, the path is /mnt/share. Do I need to give path of my dataset like C:/Users/Desktop/.../ or do I need to give path of WSL2 for windows?

@azhavoro azhavoro added the documentation Documentation should be updated label Oct 6, 2020
@jackneil
Copy link

jackneil commented Oct 7, 2020

Hi @dasmehdix. Here's how I got it to work in docker-compose.override.yml:

version: "2.3"
services:
cvat:
environment:
CVAT_SHARE_URL: "Mounted from the e:\VoTT host directory"
volumes:
- type: bind
source: "e:\VoTT"
target: /home/django/share

just replace with your source location. and make sure your indentation is right since github is flattening them

@dasmehdix
Copy link
Author

dasmehdix commented Oct 8, 2020

Hi @dasmehdix. Here's how I got it to work in docker-compose.override.yml:

version: "2.3"
services:
cvat:
environment:
CVAT_SHARE_URL: "Mounted from the e:\VoTT host directory"
volumes:

  • type: bind
    source: "e:\VoTT"
    target: /home/django/share

just replace with your source location. and make sure your indentation is right since github is flattening them

Let's say my dataset is in path C:\Users\XX\Desktop\YY in windows enviroment.

version: "2.3"
services:
cvat:
environment:
CVAT_SHARE_URL: "Mounted from the C:\Users\XX\Desktop\YY host directory"
volumes:

  • type: bind
    source: "C:\Users\XX\Desktop\YY"
    target: /home/django/share

So, is this configuration true for my enviroment?
BTW, thanks for answer.

Edit:
ERROR: create cvat_cvat_share: invalid option: "source"
This problem appers when I run that .yml file.

@bsekachev
Copy link
Member

do I need to give path of WSL2 for windows

I suppose, yes. Since you run docker under WSL, you need to provide path in WSL.
BTW, we updated docker-compose version to 3.3 in develop branch, just for your information.

@veer5551
Copy link

Hello,

Using CVAT directly in Windows 10 (without WSL).
Tried mounting data and encountered the following errors.

ERROR: for cvat Cannot create container for service cvat: failed to mount local volume: mount E:\e\cvat_data:/var/lib/docker/volumes/cvat_cvat_share/_data, flags: 0x1000: no such file or directory

My docker-compose.override.yml file

version: "2.3"
services:
  cvat_proxy:
    environment:
      CVAT_HOST: "localhost"

  cvat:
    environment:
      CVAT_SHARE_URL: "Mounted from /e/cvat_data host directory"
    volumes:
      - cvat_share:/home/django/share:ro

volumes:
  cvat_share:
    driver_opts:
      type: none
      device: /e/cvat_data
      o: bind

Tried all possible combinations for the paths representations, but still can't mount the storage!
Could you please have a look?

Thanks a lot!

@jackneil
Copy link

jackneil commented Oct 23, 2020 via email

@veer5551
Copy link

Yes @jackneil, that was the first thing I did.
I wonder, I was able to successfully mount Data with same override file with previous version of CVAT.

Need to look a little deeper into the issue I guess!
Thanks!

@veer5551
Copy link

Hello,

Having hard time figuring it out!
Below is the Image showing Error + File Sharing enabled in Docker Desktop + compose.override file

image

Has any one figured it out?
Am missing something ?

Thanks a lot!

@ChrisCurrin
Copy link

this seemed to work for me:

  1. create a volume
docker volume create --name cvat_share --opt type=none --opt device=/home/cbc/my_shared_folder --opt o=bind
  1. tell docker to search for a volume created externally
# docker-compose.override.yml
version: "3.3"

services:
  cvat:
    environment:
      CVAT_SHARE_URL: ""
    volumes:
      - cvat_share:/home/django/share:ro

volumes:
  cvat_share:
    external: true

@veer5551
Copy link

Hey @ChrisCurrin,
Thanks a lot!! That worked Effortlessly!
Saved me!

Thanks!

@tralfamadude
Copy link

tralfamadude commented Feb 24, 2021

I tried what is documented in https://github.com/openvinotoolkit/cvat/blob/master/cvat/apps/documentation/installation.md#share-path
and got "no data" in the Web UI when I picked the Connected File Share tab.

After excessive staring, head scratching, and ruling out other possible issues, I got the documented method to work. I simply had a service mixup (cvat vs cvat_proxy)... no error gets generated if you put a def in the wrong service, it just fails to work.

One thing that would be helpful is that
https://github.com/openvinotoolkit/cvat/blob/master/cvat/apps/documentation/installation.md#share-path
should mention that there must be some files in order for it to appear in the web UI.

@ipesanz
Copy link

ipesanz commented Jun 9, 2021

In adition to @ChrisCurrin answer: Keep the cvat_share:/home/django/share:ro line as it is.... as it's referring to django and not your shared path

@c00lcoder
Copy link

this seemed to work for me:

1. create a volume
docker volume create --name cvat_share --opt type=none --opt device=/home/cbc/my_shared_folder --opt o=bind
1. tell docker to search for a volume created externally
# docker-compose.override.yml
version: "3.3"

services:
  cvat:
    environment:
      CVAT_SHARE_URL: ""
    volumes:
      - cvat_share:/home/django/share:ro

volumes:
  cvat_share:
    external: true

What is the cbc in the path /home/cbc/my_shared_folder? I have a folder called "share" located at /c/share but can't get it to work...so troubleshooting

@ChrisCurrin
Copy link

ChrisCurrin commented Oct 10, 2021 via email

@c00lcoder
Copy link

c00lcoder commented Oct 12, 2021 via email

@isudos
Copy link

isudos commented Nov 22, 2021

I did this:

this seemed to work for me:

  1. create a volume
docker volume create --name cvat_share --opt type=none --opt device=/home/cbc/my_shared_folder --opt o=bind
  1. tell docker to search for a volume created externally
# docker-compose.override.yml
version: "3.3"

services:
  cvat:
    environment:
      CVAT_SHARE_URL: ""
    volumes:
      - cvat_share:/home/django/share:ro

volumes:
  cvat_share:
    external: true

and got
ERROR: for 4925b50df6a1_cvat Cannot create container for service cvat: open /var/lib/docker/volumes/cvat_share/_data: permission denied

I tried to make it 777 and still got same error.
What can cause this?

EDIT: the directory I try to mount is s3 mounted to the system using fuse. It works fine with any other directory.

@gamingflexer
Copy link

This seemed to work for me on Mac M1:

In docker-compose.yml file i made the following changes and also thanks to @c00lcoder for the commands

In services & cvat_utils

    volumes:
      - cvat_data:/home/django/data
      - cvat_keys:/home/django/keys
      - cvat_logs:/home/django/logs
      - cvat_share:/home/django/share:ro

& added this

volumes:
  cvat_db:
  cvat_data:
  cvat_keys:
  cvat_logs:
  cvat_share:
    external: true

On terminal

docker volume create --name cvat_share --opt type=none --opt device=/Users/cosmos/Desktop/Projects/Resume Parser/img_annotations --opt o=bind

docker-compose up -d

Delete the container, prune other volumes if needed and restart docker if this fails

@terancejiang
Copy link

this seemed to work for me:

  1. create a volume
docker volume create --name cvat_share --opt type=none --opt device=/home/cbc/my_shared_folder --opt o=bind
  1. tell docker to search for a volume created externally
# docker-compose.override.yml
version: "3.3"

services:
  cvat:
    environment:
      CVAT_SHARE_URL: ""
    volumes:
      - cvat_share:/home/django/share:ro

volumes:
  cvat_share:
    external: true

work like a charm

@aerdos
Copy link

aerdos commented Mar 14, 2024

For some reason none of the above, or the official docs worked for me. Instead I had to use a combination.

  1. Create a docker-compose.override.yml file in the cvat directory. Note that my definition of the volumes:cvat_share section differs from the official docs.
# docker-compose.override.yml
services:
    cvat_server:
        volumes:
            - cvat_share:/home/django/share:ro
    cvat_worker_import:
        volumes:
            - cvat_share:/home/django/share:ro
    cvat_worker_export:
        volumes:
            - cvat_share:/home/django/share:ro
    cvat_worker_annotation:
        volumes:
            - cvat_share:/home/django/share:ro

volumes:
    cvat_share:
        # this differs from the official docs
        external: true
  1. Create a C:\work_share directory (modify as necessary) and create a Docker volume from it.
docker volume create --name cvat_share --opt type=none --opt device=C:\work_share --opt o=bind
  1. Build
docker compose -f .\docker-compose.yml -f .\docker-compose.override.yml up -d --build

Not sure why the other ideas didn't work for me 🤷, insight appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation should be updated
Projects
None yet
Development

No branches or pull requests