From dfbe0055b114f243c1df7b82b1b3d0c890bdc7e5 Mon Sep 17 00:00:00 2001 From: Nabeel Date: Wed, 21 Nov 2018 20:55:46 +1100 Subject: [PATCH] Dockerfile for release 3.7 Dockerfile for release 3.7, plus some documentation updates. The docker image now runs on Python 3.6.7. --- README.md | 8 ++++---- docker/Dockerfile v.3.7 | 40 ++++++++++++++++++++++++++++++++++++++++ docs/README.md | 8 ++++---- 3 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 docker/Dockerfile v.3.7 diff --git a/README.md b/README.md index e13b8d5..b9b538d 100644 --- a/README.md +++ b/README.md @@ -82,19 +82,19 @@ _Note that this SSE and Docker do not handle file locking, and so do not support ## Pre-requisites - Qlik Sense Enterprise or Qlik Sense Desktop -- Python >= 3.4 < 3.7. The recommended version is 3.6.6. - - _Note: The latest stable version of python is 3.6. The `pystan` library, which is required for `fbprophet`, is known to have issues with Python 3.7 on Windows._ +- Python >= 3.4 < 3.7. The recommended version is 3.6.7. + - _Note: The latest stable version of Python for this SSE is 3.6. The `pystan` library, which is required for `fbprophet`, is known to have issues with Python 3.7 on Windows._ - Microsoft Visual C++ Build Tools ## Installation -1. Get Python from [here](https://www.python.org/downloads/release/python-366/). Remember to select the option to add Python to your PATH environment variable. +1. Get Python from [here](https://www.python.org/downloads/release/python-367/). Remember to select the option to add Python to your PATH environment variable. 2. You'll also need a recent C++ compiler as this is a requirement for the `pystan` library used by `fbprophet`. One option is to use [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017). If you are having trouble finding the correct installer try [this direct link](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15). An alternative is to use the `mingw-w64` compiler as described in the [PyStan documentation](http://pystan.readthedocs.io/en/latest/windows.html). - If you're using the Visual Studio installer, select the Visual C++ Build Tools workload in the installer and make sure you select the C++ compilers in the optional components:

![C++ Compiler Installation](docs/images/Install-01.png) -3. Download this git repository or get the [latest release](https://github.com/nabeel-qlik/qlik-py-tools/releases) and extract it to a location of your choice. The machine where you are placing this repository should have access to a local or remote Qlik Sense instance. +3. Download the [latest release](https://github.com/nabeel-qlik/qlik-py-tools/releases) for this SSE and extract it to a location of your choice. The machine where you are placing this repository should have access to a local or remote Qlik Sense instance. 4. Right click `Qlik-Py-Init.bat` and chose 'Run as Administrator'. You can open this file in a text editor to review the commands that will be executed. If everything goes smoothly you will see a Python virtual environment being set up, project files being copied, some packages being installed and TCP Port `50055` being opened for inbound communication. - Note that the script always ends with a "All done" message and does not check for errors. diff --git a/docker/Dockerfile v.3.7 b/docker/Dockerfile v.3.7 new file mode 100644 index 0000000..a36815c --- /dev/null +++ b/docker/Dockerfile v.3.7 @@ -0,0 +1,40 @@ +# Use an official Python runtime as a parent image +FROM python:3.6.7 + +# Set the working directory to /qlik-py-tools +WORKDIR /qlik-py-tools + +# Copy the current directory contents into the container at /qlik-py-tools +COPY . /qlik-py-tools + +# Install dependencies +RUN apt-get update +RUN apt-get install build-essential + +# Upgrade pip and setuptools +RUN python -m pip install --upgrade setuptools pip + +# Install required packages +RUN pip install grpcio +RUN pip install grpcio-tools +RUN pip install numpy +RUN pip install scipy +RUN pip install pandas +RUN pip install cython +RUN pip install pystan==2.17 +RUN pip install fbprophet +RUN pip install -U scikit-learn +RUN pip install hdbscan +RUN pip install -U skater + +# Copy modified file for skater +COPY ./feature_importance.py /usr/local/lib/python3.6/site-packages/skater-1.1.2-py3.6.egg/skater/core/global_interpretation/ + +# Make port 80 available to the world outside this container +EXPOSE 80 + +# Set the working directory to /qlik-py-tools/core +WORKDIR /qlik-py-tools/core + +# Run __main__.py when the container launches +CMD ["python", "__main__.py"] \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 6049af0..ac863fa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -82,19 +82,19 @@ _Note that this SSE and Docker do not handle file locking, and so do not support ## Pre-requisites - Qlik Sense Enterprise or Qlik Sense Desktop -- Python >= 3.4 < 3.7. The recommended version is 3.6.6. - - _Note: The latest stable version of python is 3.6. The `pystan` library, which is required for `fbprophet`, is known to have issues with Python 3.7 on Windows._ +- Python >= 3.4 < 3.7. The recommended version is 3.6.7. + - _Note: The latest stable version of Python for this SSE is 3.6. The `pystan` library, which is required for `fbprophet`, is known to have issues with Python 3.7 on Windows._ - Microsoft Visual C++ Build Tools ## Installation -1. Get Python from [here](https://www.python.org/downloads/release/python-366/). Remember to select the option to add Python to your PATH environment variable. +1. Get Python from [here](https://www.python.org/downloads/release/python-367/). Remember to select the option to add Python to your PATH environment variable. 2. You'll also need a recent C++ compiler as this is a requirement for the `pystan` library used by `fbprophet`. One option is to use [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017). If you are having trouble finding the correct installer try [this direct link](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15). An alternative is to use the `mingw-w64` compiler as described in the [PyStan documentation](http://pystan.readthedocs.io/en/latest/windows.html). - If you're using the Visual Studio installer, select the Visual C++ Build Tools workload in the installer and make sure you select the C++ compilers in the optional components:

![C++ Compiler Installation](images/Install-01.png) -3. Download this git repository or get the [latest release](https://github.com/nabeel-qlik/qlik-py-tools/releases) and extract it to a location of your choice. The machine where you are placing this repository should have access to a local or remote Qlik Sense instance. +3. Download the [latest release](https://github.com/nabeel-qlik/qlik-py-tools/releases) for this SSE and extract it to a location of your choice. The machine where you are placing this repository should have access to a local or remote Qlik Sense instance. 4. Right click `Qlik-Py-Init.bat` and chose 'Run as Administrator'. You can open this file in a text editor to review the commands that will be executed. If everything goes smoothly you will see a Python virtual environment being set up, project files being copied, some packages being installed and TCP Port `50055` being opened for inbound communication. - Note that the script always ends with a "All done" message and does not check for errors.