Skip to content

Commit

Permalink
Fix up log message
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Jul 11, 2018
1 parent b1e22b0 commit 246366a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ data*
memorious.env
docker-compose.*
.git
.gitignore
.gitignore
__pycache__
41 changes: 41 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM alpine
ENV DEBIAN_FRONTEND noninteractive

ENV TESSDATA_PREFIX /usr/share/tesseract-ocr

# Add OCR for captcha-breaking:
RUN apk --no-cache add tesseract-ocr-dev

# Not using py3-icu py3-pillow because they're outdated.
RUN apk --no-cache add python3 python3-dev build-base \
# pillow dependencies:
jpeg-dev zlib-dev libwebp-dev tiff-dev \
# pyicu dependencies:
icu-dev \
# general ssl support, and requests[security]:
ca-certificates libffi-dev openssl-dev \
# bundled dependencies:
py3-lxml py3-psycopg2 py3-gunicorn

RUN pip3 install -q pyicu requests[security] \
&& rm -rf /root/.cache

COPY setup.py /memorious/
COPY memorious /memorious/memorious
COPY ui /memorious/ui
WORKDIR /memorious
RUN pip3 install -q -e . \
&& rm -rf /root/.cache
RUN pip3 install -q -e ./ui \
&& rm -rf /root/.cache

ENV MEMORIOUS_BASE_PATH=/data \
MEMORIOUS_INCREMENTAL=true \
MEMORIOUS_EAGER=false \
C_FORCE_ROOT=true

# # Web ui:
# # RUN gunicorn -t 300 memorious_ui:app

# # Worker:
# # RUN celery -A memorious.tasks -c 10 -l INFO worker
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

all: clean test
all: clean

clean:
rm -rf dist build .eggs
Expand Down
6 changes: 5 additions & 1 deletion memorious/logic/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ def execute(self, data):
so."""
try:
signals.operation_start.send(self)
self.log.info('[%s] run_id: %s', self.stage.name, self.run_id)
self.log.info('[%s->%s(%s)]: %s',
self.crawler.name,
self.stage.name,
self.stage.method_name,
self.run_id)
return self.stage.method(self, data)
except Exception as exc:
self.emit_exception(exc)
Expand Down

0 comments on commit 246366a

Please sign in to comment.