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

add Dockerfile #522

Merged
34 commits merged into from Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b035660
add scipy for py2.7 on travis-ci
bearney74 Mar 14, 2017
1426eb2
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 14, 2017
26ab7dc
add tests for ffmeg_parse_infos
bearney74 Mar 15, 2017
24f3f47
put communicate back in
bearney74 Mar 15, 2017
4f9709d
fix syntax error
bearney74 Mar 15, 2017
2e9f460
Update test_misc.py
bearney74 Mar 15, 2017
2c70ab2
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 15, 2017
29089b2
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 30, 2017
f54556c
Merge branch 'master' of github.com:Zulko/moviepy
bearney74 Mar 31, 2017
17d882d
add Dockerfile; modify tests
bearney74 Mar 31, 2017
1310c83
add soft link so that ffmpeg can be accessed at command prompt
bearney74 Apr 3, 2017
1c16e6d
add ffmpeg soft link comment, remove unnecessary comment.
bearney74 Apr 3, 2017
cbb0571
modify source of Dockerfile
bearney74 Apr 3, 2017
9317774
fix conflict in Dockerfile
bearney74 Apr 3, 2017
4a90a9e
add basic docker documentation
bearney74 Apr 3, 2017
5cbfa01
move rst to md
bearney74 Apr 3, 2017
6c22be9
fix docker container name
bearney74 Apr 3, 2017
50bf162
clarify docs
bearney74 Apr 4, 2017
3519ad2
modify md code segments to rst code comments
bearney74 Apr 4, 2017
5e24305
modify md code segments to rst code comments
bearney74 Apr 4, 2017
b0f2ce6
modify md code segments to rst code comments
bearney74 Apr 4, 2017
463c9d8
modify md code segments to rst code comments
bearney74 Apr 4, 2017
b1ea13c
modify md code segments to rst code comments
bearney74 Apr 4, 2017
bb441ff
modify md code segments to rst code comments
bearney74 Apr 4, 2017
78caa6d
modify md code segments to rst code comments
bearney74 Apr 4, 2017
4775a99
fix code
bearney74 Apr 4, 2017
862987c
fix code
bearney74 Apr 4, 2017
ac73b78
fix code
bearney74 Apr 4, 2017
ba8b1a1
fix code
bearney74 Apr 4, 2017
1d2d3f0
fix code
bearney74 Apr 4, 2017
c9dcc17
fix code
bearney74 Apr 4, 2017
76f09cd
fix code
bearney74 Apr 4, 2017
65d5463
fix code
bearney74 Apr 4, 2017
b085e16
fix code
bearney74 Apr 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM python:3

# Install numpy using system package manager
RUN apt-get -y update && apt-get -y install libav-tools imagemagick libopencv-dev python-opencv

# Install some special fonts we use in testing, etc..
RUN apt-get -y install fonts-liberation

RUN apt-get install -y locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8

ENV LC_ALL C.UTF-8

# do we need all of these, maybe remove some of them?
RUN pip install imageio numpy scipy matplotlib pandas sympy nose decorator tqdm pillow pytest

# install scikit-image after the other deps, it doesn't cause errors this way.
RUN pip install scikit-image sklearn

ADD . /var/src/moviepy/
#RUN git clone https://github.com/Zulko/moviepy.git /var/src/moviepy
RUN cd /var/src/moviepy/ && python setup.py install

# install ffmpeg from imageio.
RUN python -c "import imageio; imageio.plugins.ffmpeg.download()"

#add soft link so that ffmpeg can executed (like usual) from command line
RUN ln -s /root/.imageio/ffmpeg/ffmpeg.linux64 /usr/bin/ffmpeg

# modify ImageMagick policy file so that Textclips work correctly.
RUN cat /etc/ImageMagick-6/policy.xml | sed 's/none/read,write/g'> /etc/ImageMagick-6/policy.xml
42 changes: 42 additions & 0 deletions docs/docker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Moviepy Docker
===============

Prequisites
-------------

1. Docker installed `Docker for Mac, Docker for windows, linux, etc <https://www.docker.com/get-docker/>`_
2. Build the Dockerfile ::

docker build -t moviepy -f Dockerfile .


Steps to run the git repo unittests from docker
------------------------------------------------

Get a bash prompt in the moviepy container ::

cd tests
docker run -it -v `pwd`:/tests moviepy bash

Run the tests ::

cd tests
python test_issues.py

Running your own moviepy script from docker
--------------------------------------------

Change directory to where your script is located

If moviepy docker container is already running, you can connect by: ::

docker exec -it moviepy python myscript.py

If the container isn't running already ::

docker run -it moviepy bash
python myscript.py

You can also start a container and run a script in one command: ::

docker run -it -v `pwd`:/code moviepy python myscript.py
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ User Guide
getting_started/getting_started
gallery
examples/examples
docker
FAQ
ref/ref

Expand Down
41 changes: 27 additions & 14 deletions tests/test_PR.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,41 @@

from moviepy.editor import *

import sys
sys.path.append("tests")
import download_media
from test_helper import PYTHON_VERSION, TMP_DIR, TRAVIS

def test_download_media(capsys):
with capsys.disabled():
download_media.download()

def test_PR_306():
if TRAVIS:
return

#put this back in once we get ImageMagick working on travis-ci
#assert TextClip.list('font') != []
#assert TextClip.list('color') != []
assert TextClip.list('font') != []
assert TextClip.list('color') != []

#with pytest.raises(Exception, message="Expecting Exception"):
# TextClip.list('blah')
pass
with pytest.raises(Exception, message="Expecting Exception"):
TextClip.list('blah')


def test_PR_339():
if TRAVIS:
return

#in caption mode
#overlay = TextClip(txt='foo',
# color='white',
# size=(640, 480),
# method='caption',
# align='center',
# fontsize=25)
overlay = TextClip(txt='foo',
color='white', font="Liberation-Mono",
size=(640, 480),
method='caption',
align='center',
fontsize=25)

#in_label_mode
#overlay = TextClip(txt='foo', method='label')
pass
overlay = TextClip(txt='foo', font="Liberation-Mono", method='label')


def test_PR_424():
Expand All @@ -44,7 +56,8 @@ def test_PR_424():

def test_PR_458():
clip = ColorClip([1000, 600], color=(60, 60, 60), duration=10)
clip.write_videofile("test.mp4", progress_bar=False, fps=30)
clip.write_videofile(os.path.join(TMP_DIR, "test.mp4"),
progress_bar=False, fps=30)


def test_PR_515():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_subtitles():
if TRAVIS:
return

generator = lambda txt: TextClip(txt, font='Georgia-Regular',
generator = lambda txt: TextClip(txt, font='Liberation-Mono',
size=(800,600), fontsize=24,
method='caption', align='South',
color='white')
Expand Down