Pataclop / Movinyl

Create a disk from the pictures of a movie
MIT License
124 stars 7 forks source link

Really hard to run the project. Any dockerfile? #9

Closed ttben closed 2 years ago

ttben commented 3 years ago

Hi there! 👋

Im trying to start and run your project, but I am struggling to gather all the needed dependencies...

Is there any way to use this code "as a service" ? Maybe a docker image that wraps all the proper dependencies and a well configured environment?

Pataclop commented 3 years ago

There is currently no way to run this as a service... I don't know docker, but yes this is a pain, I'll try to take a look at it.

Happy to help if you have other questions/recommendations !

niniack commented 3 years ago

Hi @ttben, thanks for checking out the project! The execution of the project has always been something that bothers us. Albeit not too much thought was put into this.

@Pataclop I have a bit of experience with docker through a couple other projects. If you don't mind, I can spend a little time to spin up a container for the project over winter break!

ttben commented 3 years ago

Hi @niniack and @Pataclop !

If @Pataclop list all the requirements, libs, version etc, I definitely can help with Docker too :) The project's requirements are definitely missing IMO... :)

Pataclop commented 3 years ago

@ttben @niniack This would be awesome, I'll try to list the dependancies within a day or two (also, do not hesitate to add your results to the google photo album)

Pataclop commented 3 years ago

@ttben @niniack

Here are the needed libraries : FFMEG libxcb-xinerama0 opencv4 (c++) for python 3.8.5 : PIL pymdb (currently installed by the 0_Setup script) pyQt5

I must be missing some libs & stuff, don't know what is pre-included in docker...

ttben commented 3 years ago

Ok ill try this ;) Nothing is included in docker per-se. It is just a box manager, that allows you to put what you want inside it :)

rienafairefr commented 3 years ago

I've successfully run the 0-4 scripts inside a docker container built from the Dockerfile:

FROM ubuntu:20.04

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install tzdata

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    apt-get install -y build-essential libopencv-dev python3-opencv ffmpeg bc

RUN apt-get update && \
    apt-get install -y python3 python3-pip

COPY requirements.txt .
RUN pip3 install -r requirements.txt
RUN mkdir /build

COPY src /build/

WORKDIR /app

RUN mkdir PROCESSING_ZONE

RUN cd /build/disk && make && mv disk /app/
RUN cd /build/page && make && mv page /app/
RUN cd /build/pymdb && python3 setup.py install

COPY . /app

RUN cd src/disk && make && mv disk /app/PROCESSING_ZONE/

RUN cd src/page && make && mv page /app/PROCESSING_ZONE/

ENV PYTHONUNBUFFERED 1
CMD ["/app/commands.sh"]

then, docker run -v <dir with the video files>:/app/PROCESSING_ZONE --rm --user `id -u`:`id -g` movinyl requirements.txt:

py-mdb
PyQt5
PyQt5-stubs
Pillow

It's still hard to run (I had to modify some other things) , but it's a start. will probably send a PR

niniack commented 3 years ago

@rienafairefr

Could you also share the command.sh file that it defaults to?

rienafairefr commented 3 years ago

the commands.sh is this, running sequentially the scripts:

#!/usr/bin/env bash

#./1_IMAGE_GENERATOR
#./3_BATCH_LAUNCH
#./4_RENAME_SAVE
./5_MAKE_PAGE -f infos.txt

the infos.txt needs to be written by hand (or with the rgb tuple in the command line) because there are still manual steps, and the commands are not really indempotent I needed to comment/uncomment the steps as needed, re-build the container, re-run. a bit painful but I managed to create a collage of Quentin Dupieux films in Movinyl format:

image

niniack commented 3 years ago

I'm trying to use the Dockerfile you prepared:

  1. Prepared a requirements.txt in root with the requirements you listed
  2. Prepared the commands.sh file as you just posted, with everything except ./1_IMAGE_GENERATOR commented out
  3. Building the image with docker build -t movinyl:latest .
  4. Running a container with docker run -v film:/app/PROCESSING_ZONE --rm movinyl where film is a new folder I created to store my mp4 file

However, I get the following errors:

mkdir: cannot create directory 'disk': File exists
mkdir: cannot create directory 'disk/images': Not a directory
disk: Invalid data found when processing input
length
(standard_in) 1: syntax error

mkdir: cannot create directory 'loki': Permission denied
mkdir: cannot create directory 'loki/images': No such file or directory
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
length 164.722000
(standard_in) 2: syntax error
.08215561097256857855
mkdir: cannot create directory 'page'(standard_in) 2: syntax error
: File exists
mkdir: cannot create directory 'page/images': Not a directory
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
(standard_in) 2: syntax error
page: Invalid data found when processing input
(standard_in) 2: syntax error
length
(standard_in) 1: syntax error

Any clue as to what's going on?

To begin with, seems like moving the disk binary into PROCESSING_ZONE might be causing issues?

rienafairefr commented 3 years ago

there might be a problem with permissions. the user inside the docker container is mapped to your computer's root user. you can use --user id -u:id -g to help with that. The scripts tend to "treat" many files that don't need to be treated, visible in the for file in *, * will expand to all files, not just the video files you want. The mv disk /app/PROCESSING_ZONE/ is probably useless anyway, because we're mounting stuff to /app/PROCESSING_ZONE . There is a disk file in the film folder on your host, which shouldn't be here. i'd also mount with a -v ./film:/app/PROCESSING_ZONE, safer (otherwise you might be mounting a docker volume instead of a local folder)

niniack commented 3 years ago

@Pataclop I believe pr #11 addresses this!