qlik-oss / server-side-extension

A Qlik server-side extension protocol for extending the Qlik built-in expression library with functionality from external calculation engines.
MIT License
155 stars 126 forks source link

Issues with Python in Docker container #23

Closed stigmhenriksen closed 6 years ago

stigmhenriksen commented 6 years ago

Description

I do have some issues running server side extension in docker. The building of the docker files runs fine. per your instructions. However, when running the image I get a Python error. I'm running docker in CentOS I have also tested this in Ubuntu - still receiving the same error.

Steps to Reproduce

  1. download the zip file and unzip it in correct directory
  2. build the image with: -docker build -t qlik-oss/sse-helloworld -f Dockerfile.helloworld . The build runs fine
  3. Run the image

    sseissues docker run --rm -p 50052:50052 qlik-oss/sse-helloworld

Actual behavior

Gets and error, see attached screenshot

Environment

Docker

Operating system

CentOS and Ubunut 16.04

Qlik Sense

[ ] Desktop

Versions

tobiaslindulf commented 6 years ago

Hi, It looks like you may have ended up with an older python version than 3.4.1 in the docker container. That is what we believe when reading this: https://docs.python.org/3/library/os.html#os.makedirs . We do not know the reason for this, but it might be worth to try to force the python version to at least 3.5. It might be the base docker image "grpc/python" that is changed or something. Can you try to exchange the content in the docker file to the following instead and try again?

FROM python:3.6.2-jessie

ADD . /app

RUN pip install grpcio && pip install numpy

WORKDIR /app ENTRYPOINT ["python"] CMD ["ColumnOperations/ExtensionService_column.py"] EXPOSE 50053

stigmhenriksen commented 6 years ago

HI , Build runs fine, but now I'm getting another error when starting the container. Moreover, when starting the service in Docker swarm it does not converge. I can see that are are some issues with 1.8 version of Grpc and that 1.7.3 version should be used.

Please advice

image

kjartan-qlik commented 6 years ago

Hi @stigmhenriksen, thanks for the update. I've gotten the docker file to build and run on a Debian VM with the following content.

FROM python:3.6

WORKDIR /app
ADD . /app

RUN pip install --trusted-host pypi.python.org -r requirements.txt

EXPOSE 50052

CMD ["python", "HelloWorld/ExtensionService_helloworld.py"]

If you wish to force the version of grpcio then you can do so in the requirements.txt. We will update our docker files soon to fix this issue.

stigmhenriksen commented 6 years ago

Hi, Now it is working, I'm using the following docker script: FROM python:3.6.2-jessie

ADD . /app

ENV GRPCIO_VERSION 1.7.3

RUN pip install grpcio==${GRPCIO_VERSION} \ && pip install numpy

WORKDIR /app ENTRYPOINT ["python"] CMD ["HelloWorld/ExtensionService_helloworld.py"] EXPOSE 50052

Thanks for your support and swift feedback