From 14c9d571423e559ec1740a119ae5c39813d63402 Mon Sep 17 00:00:00 2001 From: Eyob Yirdaw Date: Tue, 12 Feb 2019 16:42:27 +0300 Subject: [PATCH 1/2] init docker --- Docker/Dockerfile | 57 +++++++++++++++++++++++++++++++++++++++++ Docker/requirements.txt | 5 ++++ 2 files changed, 62 insertions(+) create mode 100644 Docker/Dockerfile create mode 100644 Docker/requirements.txt diff --git a/Docker/Dockerfile b/Docker/Dockerfile new file mode 100644 index 0000000..fe4b77d --- /dev/null +++ b/Docker/Dockerfile @@ -0,0 +1,57 @@ +FROM ubuntu:18.04 + +#ARG CACHEBUST + +RUN apt-get update && apt-get install -y apt-utils sudo + + +RUN adduser --disabled-password --gecos "snetservice user" netk && \ + adduser netk sudo && \ + echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +USER netk + +#RUN whoami + +RUN sudo apt-get install -y git \ + build-essential \ + python3.6 \ + python3.6-dev \ + python3-pip \ + wget \ + curl + + +WORKDIR /home/netk/ + +RUN curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6 + +RUN pip --version + + +WORKDIR /tmp + +COPY requirements.txt /tmp/ +RUN sudo pip install -r requirements.txt +RUN echo 1 +COPY requirements_2.txt /tmp/ +RUN sudo pip install -r requirements_2.txt + +WORKDIR /home/netk/ +RUN mkdir dep +WORKDIR /home/netk/dep + +#RUN git clone https://github.com/singnet/network-analytics-services.git && \ +# cd network-analytics-services + +#RUN echo 8 && \ +# git clone https://github.com/edyirdaw/network-analytics-services.git && \ +# cd network-analytics-services && \ +# git checkout --track origin/example_bipartition + +#RUN pwd + +#RUN cd network-analytics-services/services && python3.6 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. network_analytics_bipartite.proto + +#WORKDIR /home/netk/network-analytics-services/services + diff --git a/Docker/requirements.txt b/Docker/requirements.txt new file mode 100644 index 0000000..28d2065 --- /dev/null +++ b/Docker/requirements.txt @@ -0,0 +1,5 @@ +jsonrpcserver +jsonrpcclient +grpcio +grpcio_tools +numpy From 529f7e7bbd813769ee4fbbeccef173e9a83e795d Mon Sep 17 00:00:00 2001 From: Eyob Yirdaw Date: Tue, 12 Feb 2019 19:08:44 +0300 Subject: [PATCH 2/2] Finished docker file --- Docker/Dockerfile | 38 +++++++++++++++++++------------------- Docker/requirements.txt | 7 +++++++ snet_test_client.py | 3 ++- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Docker/Dockerfile b/Docker/Dockerfile index fe4b77d..ff5e249 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -2,14 +2,14 @@ FROM ubuntu:18.04 #ARG CACHEBUST -RUN apt-get update && apt-get install -y apt-utils sudo +RUN echo 1 && apt-get update && apt-get install -y apt-utils sudo -RUN adduser --disabled-password --gecos "snetservice user" netk && \ - adduser netk sudo && \ +RUN adduser --disabled-password --gecos "snetservice user" top && \ + adduser top sudo && \ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers -USER netk +USER top #RUN whoami @@ -17,12 +17,12 @@ RUN sudo apt-get install -y git \ build-essential \ python3.6 \ python3.6-dev \ - python3-pip \ - wget \ - curl + python3-pip +RUN sudo apt-get install -y wget curl vim -WORKDIR /home/netk/ + +WORKDIR /home/top/ RUN curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6 @@ -34,24 +34,24 @@ WORKDIR /tmp COPY requirements.txt /tmp/ RUN sudo pip install -r requirements.txt RUN echo 1 -COPY requirements_2.txt /tmp/ -RUN sudo pip install -r requirements_2.txt +RUN python3.6 -m nltk.downloader all + -WORKDIR /home/netk/ +WORKDIR /home/top/ RUN mkdir dep -WORKDIR /home/netk/dep +WORKDIR /home/top/dep #RUN git clone https://github.com/singnet/network-analytics-services.git && \ # cd network-analytics-services -#RUN echo 8 && \ -# git clone https://github.com/edyirdaw/network-analytics-services.git && \ -# cd network-analytics-services && \ -# git checkout --track origin/example_bipartition +RUN whoami + +RUN echo 13 && \ + git clone https://github.com/edyirdaw/topic-analysis.git && cd topic-analysis && git checkout --track origin/dev -#RUN pwd +WORKDIR /home/top/dep/topic-analysis -#RUN cd network-analytics-services/services && python3.6 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. network_analytics_bipartite.proto +RUN pwd +RUN python3.6 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. service_spec/topic_analysis.proto -#WORKDIR /home/netk/network-analytics-services/services diff --git a/Docker/requirements.txt b/Docker/requirements.txt index 28d2065..9befa89 100644 --- a/Docker/requirements.txt +++ b/Docker/requirements.txt @@ -3,3 +3,10 @@ jsonrpcclient grpcio grpcio_tools numpy +pandas +scipy +psutil +tables +matplotlib +nltk +stemming==1.0 diff --git a/snet_test_client.py b/snet_test_client.py index 0593e29..060eff4 100644 --- a/snet_test_client.py +++ b/snet_test_client.py @@ -58,7 +58,8 @@ def csv_reader(): def try_plsa(): - channel = grpc.insecure_channel('localhost:5000') + channel = grpc.insecure_channel('localhost:500') + # channel = grpc.insecure_channel('172.17.0.75:5001') stub = topic_analysis_pb2_grpc.TopicAnalysisStub(channel)