diff --git a/Dockerfile b/Dockerfile index 7e745f3323a3101cb212c42ae89c14be76652ae4..7973e6913d6905fd658854316b5be3f3272b6082 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,14 @@ FROM clarinpl/python:3.6 RUN apt-get update && apt-get install -y --no-install-recommends \ - cmake \ - default-jdk \ + software-properties-common \ + build-essential \ + pwrutils \ corpus2-python3.6 \ wccl-python3.6 \ + python3.6 \ + python3.6-dev \ + default-jdk \ libicu-dev \ libboost1.58-all-dev @@ -22,47 +26,35 @@ RUN apt-get update && \ ENV JAVA_HOME /opt/jdk ENV PATH ${PATH}:${JAVA_HOME}/bin -# installing polem -# RUN cd . -# RUN rm /usr/bin/python3 -# RUN ln -s /usr/bin/python3.6 /usr/bin/python3 -# RUN alias python3='/usr/bin/python3.6' -#RUN apt-get -y install default-jdk +WORKDIR /home/worker +COPY ./requirements.txt . +RUN python3.6 -m pip install -r requirements.txt + WORKDIR /build/ RUN git clone https://github.com/gkubon/Polem &&\ - mkdir polem/cpp/build &&\ - cd polem/cpp/build &&\ + mkdir Polem/build &&\ + cd Polem/build &&\ cmake .. &&\ make &&\ make install -# RUN mkdir -p /build/Polem/build -# COPY . /build/Polem -# RUN rm /build/Polem/build -rf -# WORKDIR /build/Polem/build -# RUN cmake .. -# RUN make -j -# RUN make install -# RUN ldconfig -# RUN mkdir /data -# RUN mv /build/Polem/corpus /data -# WORKDIR /app #install mewex -WORKDIR /build -RUN git clone https://github.com/MGniew/MeWeX.git -RUN cd MeWeX/mwextractor/mwextractor && \ +WORKDIR /build/ +RUN git clone https://gitlab.clarin-pl.eu/team-semantics/mewex && \ + cd mewex/mwextractor/mwextractor && \ mkdir build && \ cd build && \ cmake .. && \ make install && \ ldconfig -RUN cd MeWeX/mewexlib/ && \ +RUN cd mewex && \ + mkdir mewexlib/mewexlib/data/relations/ontology &&\ + mv mewexlib/mewexlib/data/relations/*.ccl mewexlib/mewexlib/data/relations/ontology +RUN cd mewex/mewexlib/ && \ python3.6 setup.py install WORKDIR /home/worker COPY ./src ./src COPY ./main.py . -COPY ./requirements.txt . -RUN python3.6 -m pip install -r requirements.txt CMD ["python3.6", "main.py", "service"] diff --git a/config.ini b/config.ini index 383bd8186ced16fa441d2ab8597878b71e862579..2504e02b7be22ccd0fdf55a02ee8e3628151bc4a 100644 --- a/config.ini +++ b/config.ini @@ -7,7 +7,6 @@ rabbit_user = test rabbit_password = test queue_prefix =nlp_ - [tool] workers_number = 4 diff --git a/docker-compose.yml b/docker-compose.yml index 96a8916bca738f94d7a825d88f99e5c79bc3d50c..61235fc513a689bc802b8e4982699810ead08b7e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: - main.py - service volumes: - - '/samba:/samba' + - './samba:/samba' - './config.ini:/home/worker/config.ini' - './src:/home/worker/src' - './main.py:/home/worker/main.py' diff --git a/requirements.txt b/requirements.txt index 57a8aa0f289b4be5c988f529c498107c10269607..e129cd1e68f9c87b722fc9ec0671183d33c9e4dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +cmake +Cython nlp_ws lxml ujson diff --git a/src/__pycache__/mewex.cpython-36.pyc b/src/__pycache__/mewex.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0bf7670507a6b774028ae07d961c9ffabe191e6f Binary files /dev/null and b/src/__pycache__/mewex.cpython-36.pyc differ diff --git a/src/mewex.py b/src/mewex.py index 6bd4bbc34bf8850510b240e5b5d93da403f49876..33b24884d1e78cf1dfb3eb99a66770550d652b3f 100644 --- a/src/mewex.py +++ b/src/mewex.py @@ -2,6 +2,7 @@ import os import re import io +import pathlib import mewexlib as mwl @@ -20,6 +21,7 @@ class MewexWorker(NLPWorker): if os.path.isdir(input_path) else (input_path,) ) + print(args['input_files']) if not os.path.exists(output_path): os.makedirs(output_path) args['output_file'] = output_path+"/mewex.csv"