-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker dependency management and sanity checking
- Loading branch information
Showing
8 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM ubuntu:latest | ||
FROM python:3.7 | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y ffmpeg | ||
|
||
RUN python -m pip install pipenv | ||
|
||
COPY . /var/movie-meme-generator/ | ||
WORKDIR /var/movie-meme-generator | ||
|
||
RUN pipenv install | ||
|
||
ENTRYPOINT [ "pipenv", "run", "python", "movie-meme-generator.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Movie Meme Generator | ||
========== | ||
|
||
WIP. Currently just a sanity check script for all dependencies. | ||
See if it works: | ||
|
||
docker build -t movie-meme-generator . | ||
docker run movie-meme-generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from moviememes.sanitycheck import run_sanity_checks | ||
|
||
if __name__ == '__main__': | ||
run_sanity_checks() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import PIL, requests, subprocess, sys, traceback | ||
|
||
def python_version_check(): | ||
print("Checking Python version...") | ||
print("Running on:", sys.version) | ||
print("OK") | ||
|
||
def requests_check(): | ||
print("Testing requests library...") | ||
response = requests.get('http://example.org') | ||
if response.status_code == 200: | ||
print("OK") | ||
else: | ||
print(f"ERROR: Example query returned non-200 code: {response.status_code}") | ||
|
||
def ffmpeg_check(): | ||
print("Testing ffmpeg availability...") | ||
try: | ||
subprocess.check_call(['ffmpeg', '-version']) | ||
print("OK") | ||
except Exception as e: | ||
print("ERROR running `ffmpeg -version`") | ||
traceback.print_exc() | ||
|
||
def pillow_check(): | ||
print("Testing Pillow availability...") | ||
print("Using: ", PIL.PILLOW_VERSION) | ||
print("OK") | ||
|
||
SANITY_CHECKS = [ | ||
python_version_check, | ||
pillow_check, | ||
requests_check, | ||
ffmpeg_check, | ||
] | ||
|
||
def run_sanity_checks(): | ||
for sanity_check in SANITY_CHECKS: | ||
sanity_check() | ||
print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Do not remove me |