#497  Allow the Server Shell Executor cache to be saved to a specified volume
Closed
Stephen S opened 2 years ago
  1. I have installed OneDev using docker
  2. As the boot volume (where / and /home are located) is limited in space, I have put OneDev's data folder (/opt/onedev) in another volume
  3. Yet, when executing a build on OneDev, I noticed the operations are writing data into the boot volume

I think it would be useful to be able to bind OneDev's internal cache system to a volume in the docker-compose.yml file, as is usual in many self-hosted applications.

Robin Shen commented 2 years ago

I am a bit confused. OneDev creates cache inside /opt/onedev/site/cache. If you mounted /opt/onedev to a different volume, the cache folder should also resides on that volume. I tested at my side and it works this way.

Stephen S commented 2 years ago

And yet, while an image was being built, I noticed the space on the boot volume decreased rapidly. I have checked the mounting point of /opt/onedev and it is indeed on another partition than the boot volume.

Stephen S commented 2 years ago

Here is the docker-compose.yml file I am using:

version: "3"

services:
  onedev:
    image: 1dev/server
    container_name: odv
    restart: unless-stopped
    ports:
      - 6610:6610
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /mnt/nvm204/odv/dta:/opt/onedev
Stephen S commented 2 years ago

And the space on nvm204 stayed almost identical.

Stephen S commented 2 years ago

I think I have found the culprit: I was using DOCKER_BUILDKIT=1 in my build instructions and it was caching on the main disk. Sorry for the waste of time.

Robin Shen commented 2 years ago

Thanks for letting me know.

Robin Shen changed state to 'Closed' 2 years ago
Previous Value Current Value
Open
Closed
Stephen S commented 2 years ago

No, in fact please reopen it: I am testing it with another build with BUILDKIT inactivated and the space on boot disk is still shrinking (not at the same pace than before but still). Don't you think docker is the culprit, writing stuff in its image cache? Also remember: I am using the Server Shell job executor.

Robin Shen commented 2 years ago

If docker writes stuff to boot volume, it is out of OneDev's control. It is not an issue of OneDev's cache. You may need to figure out which folder docker is written its temp file and then mount that folder to a different volume directly on the host machine (since OneDev docker operation is relayed to host machine).

Stephen S commented 2 years ago

OK, you are right. But this was in case it happens to somebody else.

issue 1 of 1
Type
Improvement
Priority
Major
Assignee
Issue Votes (0)
Watchers (3)
Reference
onedev/server#497
Please wait...
Page is in error, reload to recover