Giter Site home page Giter Site logo

Comments (12)

EleRas avatar EleRas commented on September 13, 2024 1

I currently have a long print running, but as soon as it's finished, I'll try it again.

from obico-server.

kennethjiang avatar kennethjiang commented on September 13, 2024 1

Found the problem and fixed it. Thank you @EleRas for reporting this to us! Please pull the latest code.

from obico-server.

kennethjiang avatar kennethjiang commented on September 13, 2024

Based on my understanding, these output was from the command python manage.py --collect-statics in the process of building a docker image. Since the folder media will be remounted when the container really runs, the folders and files being deleted were actually just copies of the original files.

Although I'm quite sure about my understand but please confirm whether your timelapses were really deleted or not @EleRas

from obico-server.

EleRas avatar EleRas commented on September 13, 2024

I found my mistake: I mounted the external volume to /media, not /app/static_build/media - so the data wasn't stored in the external volume at all. This should documented in either the docker-compose.yml or the readme ;)

from obico-server.

kennethjiang avatar kennethjiang commented on September 13, 2024

What do you think needs to be documented? Should we document where to mount the volume or these messages can be ignored?

from obico-server.

EleRas avatar EleRas commented on September 13, 2024

Where to mount the volume, since this isn't documented yet, as far as I can see

from obico-server.

kennethjiang avatar kennethjiang commented on September 13, 2024

We actually specified the mount point (not media folder, but its parent folder) at: https://github.com/TheSpaghettiDetective/TheSpaghettiDetective/blob/5664de2b0fe5461fa64bc81b85bd33241eb5bf97/docker-compose.yml#L8

I'm actually curious why you chose to mount media at a different directory? Was it because the original mount point (volume mapping in Docker's term) somehow didn't work for you?

from obico-server.

EleRas avatar EleRas commented on September 13, 2024

That was the first thing I did - but this resulted in the media - files being stored in the git - checkout and being deleted during a docker-compose build. Having seen the error message "Deleting 'media..." I thought that the data was stored in /media as well and the data in the git - checkout just being artefacts.

from obico-server.

kennethjiang avatar kennethjiang commented on September 13, 2024

The static_build dir is in .gitignore: https://github.com/TheSpaghettiDetective/TheSpaghettiDetective/blob/5664de2b0fe5461fa64bc81b85bd33241eb5bf97/.gitignore#L126

Are you sure somehow it ended up in git? Can you elaborate more?

from obico-server.

EleRas avatar EleRas commented on September 13, 2024

It didn't end in git itself, what I meant was: the media was in a directory below the git - checkout (/web/static_build) - and /web/static_build is being emptied by docker-compose build

from obico-server.

kennethjiang avatar kennethjiang commented on September 13, 2024

Sorry for misunderstanding you @EleRas ?

If you revert your changes to the mount point (basically going back to the original code by doing git reset --hard), will these files (the ones in TheSpaghettiDetective/web/static_build) still be deleted after docker-compse up --build -d?

from obico-server.

EleRas avatar EleRas commented on September 13, 2024

Okay, I could reproduce it reliable:

git clone https://github.com/TheSpaghettiDetective/TheSpaghettiDetective.git tsd
cd tsd
docker-compose up --build -d
[configure via web] && [run timelapse]
OR just sudo mkdir web/static_build/media && sudo touch web/static_build/media/test
ls -lisah web/static_build/media/
total 8,0K
97255700 4,0K drwxr-xr-x  2 root root 4,0K Apr  5 19:32 .
96996053 4,0K drwxr-xr-x 12 root root 4,0K Apr  5 19:32 ..
97255701    0 -rw-r--r--  1 root root    0 Apr  5 19:32 test
docker-compose up --build -d
ls -lisah web/static_build/media/
total 8,0K
97255700 4,0K drwxr-xr-x  2 root root 4,0K Apr  5 19:34 .
96996053 4,0K drwxr-xr-x 12 root root 4,0K Apr  5 19:34 ..

So the media - directory is emptied during docker-compose up --build, it also doesn't matter if TSD was configured or not. Another interesting point: the web/db.sqlite3 is not deleted during the rebuild.

from obico-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.