-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
134 additions
and
41 deletions.
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,15 +1,28 @@ | ||
FROM debian:buster | ||
# OSNICK=stretch|bionic|buster | ||
ARG OSNICK=buster | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
FROM redisfab/redisedgevision-${OSNICK}:0.2.0 | ||
|
||
# This is due on the following error on ARMv8: | ||
# /usr/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block | ||
# Something is exausting TLS, causing libgomp to fail. Preloading it as a workaround helps. | ||
# ENV LD_PRELOAD /usr/lib/aarch64-linux-gnu/libgomp.so.1 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get -qq update | ||
RUN apt-get -q install -y python wget | ||
|
||
RUN set -x; \ | ||
apt-get install -y wget python3-distutils ;\ | ||
wget -q https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py ;\ | ||
python /tmp/get-pip.py | ||
RUN apt-get -q install -y python-opencv | ||
python3 /tmp/get-pip.py | ||
|
||
RUN pip install redis==3.2.1 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ADD read_camera.py ./ | ||
ADD *.jpg ./ | ||
RUN pip install redis | ||
|
||
CMD [ "python", "./read_camera.py" ] | ||
CMD [ "python3", "./read_camera.py" ] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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 |
---|---|---|
@@ -1,11 +1,24 @@ | ||
version: '3' | ||
services: | ||
redis: | ||
build: | ||
context: ../redis | ||
ports: | ||
- "6379:6379" | ||
environment: | ||
- MAX_IMAGES | ||
app: | ||
build: ../app | ||
depends_on: | ||
- redis | ||
command: ['init.py', '--url', 'redis://redis:6379'] | ||
camera: | ||
build: | ||
context: camera | ||
context: ../camera | ||
dockerfile: Dockerfile.debian | ||
depends_on: | ||
- redis | ||
environment: | ||
- ANIMAL | ||
command: python ./read_camera.py -u redis://redis:6379 --test | ||
- MAX_IMAGES | ||
command: ['python3', '/usr/src/app/read_camera.py', '-u', 'redis://redis:6379', '--test'] |
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,37 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
|
||
def to_int(x): | ||
try: | ||
return int(x) | ||
except: | ||
if x == '': | ||
return 10 | ||
return -1 | ||
|
||
if len(sys.argv) > 1: | ||
fields = sys.argv[1].split(':') | ||
else: | ||
fields = [''] | ||
fields = map(lambda x: to_int(x), fields) | ||
row = "" | ||
i = 0 | ||
n = len(fields) | ||
for line in sys.stdin: | ||
s = line.strip() | ||
m = len(s) | ||
c = fields[i] | ||
i = i + 1 | ||
if c != -1: | ||
if m > c: | ||
m = c | ||
s = s[0:m] + ' ' * (c - m) | ||
if i < n: | ||
s = s + ' ' | ||
row = row + s | ||
if i == n: | ||
print(row) | ||
row = '' | ||
i = 0 |
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