Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
revert(docker): revert alpine docker to reduce size
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 12, 2019
1 parent 9c1a606 commit cc72cf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
17 changes: 8 additions & 9 deletions Dockerfiles/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@ LABEL maintainer="team@gnes.ai" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="GNES is Generic Nerual Elastic Search"

RUN apk add --no-cache \
--virtual=.build-dependencies \
build-base g++ gfortran file binutils zeromq-dev \
musl-dev python3-dev py-pgen cython openblas-dev && \
apk add --no-cache libstdc++ openblas libzmq


WORKDIR /gnes/

ADD . ./

RUN ln -s locale.h /usr/include/xlocale.h && \
RUN apk add --no-cache \
--virtual=.build-dependencies \
build-base g++ gfortran file binutils zeromq-dev \
musl-dev python3-dev py-pgen cython openblas-dev && \
apk add --no-cache libstdc++ openblas libzmq && \
ln -s locale.h /usr/include/xlocale.h && \
pip install . --no-cache-dir --compile && \
find /usr/lib/python3.7/ -name 'tests' -exec rm -r '{}' + && \
find /usr/lib/python3.7/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \
rm /usr/include/xlocale.h && \
rm -rf /tmp/* && \
rm -rf /gnes && \
apk del .build-dependencies
apk del .build-dependencies && \
rm -rf /var/cache/apk/*

WORKDIR /

Expand Down
5 changes: 4 additions & 1 deletion gnes/service/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import threading
from concurrent.futures import ThreadPoolExecutor

import grpc

import grpc
from .. import __version__, __proto_version__
from ..client.base import ZmqClient
from ..helper import set_logger
from ..proto import gnes_pb2_grpc, gnes_pb2, router2str
Expand Down Expand Up @@ -66,6 +67,8 @@ def add_envelope(self, body: 'gnes_pb2.Request', zmq_client: 'ZmqClient'):
msg.envelope.part_id = 1
msg.envelope.num_part.append(1)
msg.envelope.timeout = 5000
msg.envelope.gnes_version = __version__
msg.envelope.proto_version = __proto_version__
r = msg.envelope.routes.add()
r.service = FrontendService.__name__
r.timestamp.GetCurrentTime()
Expand Down

0 comments on commit cc72cf2

Please sign in to comment.