├── .condarc ├── README.md ├── environment.yml ├── LICENSE.md └── Dockerfile /.condarc: -------------------------------------------------------------------------------- 1 | channels: 2 | - defaults 3 | 4 | show_channel_urls: True 5 | 6 | create_default_packages: 7 | - nomkl 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Data Science Docker Image 2 | 3 | This is a fork of [The Civis Data Science Docker Image](https://github.com/civisanalytics/datascience-python), customized for VoteAmerica. 4 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: datascience 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - awscli=1.17.15 7 | - beautifulsoup4=4.8.2 8 | - botocore=1.14.15 9 | - boto=2.49.0 10 | - boto3=1.11.15 11 | - bqplot=0.12.3 12 | - click=6.7 13 | - cloudpickle=1.2.2 14 | - cython=0.29.15 15 | - dask=2.10.1 16 | - feather-format=0.4.0 17 | - glmnet=2.1.1 18 | - ipython=7.12.0 19 | - ipywidgets=7.5.1 20 | - jinja2=2.11.1 21 | - joblib=0.14.1 22 | - jsonschema=3.2.0 23 | - jupyter=1.0.0 24 | - libffi=3.2.1 25 | - libgfortran=3.0.0 26 | - libtiff=4.1.0 27 | - libxml2=2.9.10 28 | - matplotlib=3.1.3 29 | - nomkl=3.0 30 | - notebook=6.0.3 31 | - nose=1.3.7 32 | - numexpr=2.7.1 33 | - numpy=1.17.3 34 | - openblas=0.3.6 35 | - pandas=0.25.3 36 | - patsy=0.5.1 37 | - pip=20.0.2 38 | - psycopg2=2.8.4 39 | - pyarrow=0.16.0 40 | - pycrypto=2.6.1 41 | - pytest=5.3.5 42 | - python=3.7.6 43 | - pyyaml=3.13 44 | - requests=2.22.0 45 | - s3fs=0.4.0 46 | - seaborn=0.10.0 47 | - scipy=1.4.1 48 | - scikit-learn=0.22.1 49 | - statsmodels=0.11.0 50 | - urllib3=1.25.7 51 | - xgboost=0.81 52 | - pip: 53 | - civis==1.14.1 54 | - civisml-extensions==0.2.1 55 | - dropbox==9.4.0 56 | - ftputil==3.4 57 | - muffnn==2.3.1 58 | - pubnub==4.3.0 59 | - pysftp==0.2.9 60 | - requests-toolbelt==0.9.1 61 | - tensorflow==1.15.2 62 | - hubspot-api-client==1.1.0 63 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, Civis Analytics 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | MAINTAINER support@civisanalytics.com 3 | 4 | RUN DEBIAN_FRONTEND=noninteractive apt-get update -y --no-install-recommends && \ 5 | apt-get install -y --no-install-recommends locales && \ 6 | locale-gen en_US.UTF-8 && \ 7 | apt-get install -y --no-install-recommends software-properties-common && \ 8 | apt-get install -y --no-install-recommends \ 9 | make \ 10 | automake \ 11 | libpq-dev \ 12 | libffi-dev \ 13 | gfortran \ 14 | g++ \ 15 | git \ 16 | libboost-program-options-dev \ 17 | libtool \ 18 | libxrender1 \ 19 | wget \ 20 | ca-certificates \ 21 | curl && \ 22 | apt-get clean -y && \ 23 | rm -rf /var/lib/apt/lists/* 24 | 25 | # Set environment variables for UTF-8, conda, and shell environments 26 | ENV LANG=en_US.UTF-8 \ 27 | LANGUAGE=en_US:en \ 28 | LC_ALL=en_US.UTF-8 \ 29 | CONDARC=/opt/conda/.condarc \ 30 | BASH_ENV=/etc/profile \ 31 | PATH=/opt/conda/bin:$PATH \ 32 | CIVIS_MINICONDA_VERSION=4.5.12 \ 33 | CIVIS_CONDA_VERSION=4.8.1 \ 34 | CIVIS_PYTHON_VERSION=3.7.6 35 | 36 | # Conda install. 37 | # 38 | # Everything is installed in the root environment. This allows for 39 | # upgrades to the packages and eliminates the pain of trying to activate 40 | # some other environment automatically for the many different ways 41 | # people can use a docker image. 42 | # 43 | # Things are pinned to prevent upgrades from conda and force it to 44 | # resolve dependencies relative to a fixed conda & python version. 45 | # 46 | # Note that the python version is also listed in the environment.yml 47 | # file. The version in CIVIS_PYTHON_VERSION is the source of truth. 48 | # If you want to change the python version, you need to change it in 49 | # **both** places. The python version has been left in the `environment.yml` 50 | # file so that people can create environments equivalent to this 51 | # container. 52 | # 53 | # The ordering of these steps seems to matter. You seem to have to 54 | # install a specific python version by hand and then pin it. 55 | # 1) install conda using CIVIS_MINICONDA_VERSION (may not be most up to date conda version) 56 | # 2) pin conda to the version given by CIVIS_CONDA_VERSION 57 | # 3) install the python version CIVIS_PYTHON_VERSION 58 | # 4) pin the python version 59 | # 60 | # Extra symlinks are added at the end because... 61 | # Red Hat and Debian use different names for this file. git2R wants the latter. 62 | # See conda-recipes GH 423 63 | RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \ 64 | wget --quiet https://repo.continuum.io/miniconda/Miniconda3-${CIVIS_MINICONDA_VERSION}-Linux-x86_64.sh && \ 65 | /bin/bash /Miniconda3-${CIVIS_MINICONDA_VERSION}-Linux-x86_64.sh -b -p /opt/conda && \ 66 | rm Miniconda3-${CIVIS_MINICONDA_VERSION}-Linux-x86_64.sh && \ 67 | /opt/conda/bin/conda install --yes conda==${CIVIS_MINICONDA_VERSION} && \ 68 | conda install conda=${CIVIS_CONDA_VERSION} && \ 69 | echo "conda ==${CIVIS_CONDA_VERSION}" > /opt/conda/conda-meta/pinned && \ 70 | conda install --yes python==${CIVIS_PYTHON_VERSION} && \ 71 | echo "python ==${CIVIS_PYTHON_VERSION}" >> /opt/conda/conda-meta/pinned && \ 72 | conda clean --all -y && \ 73 | ln -s /opt/conda/lib/libopenblas.so /opt/conda/lib/libblas.so && \ 74 | ln -s /opt/conda/lib/libopenblas.so /opt/conda/lib/liblapack.so && \ 75 | ln -s /opt/conda/lib/libssl.so /opt/conda/lib/libssl.so.6 && \ 76 | ln -s /opt/conda/lib/libcrypto.so /opt/conda/lib/libcrypto.so.6 77 | 78 | # Install boto in the base environment for private s3 channel support. 79 | # Install Python Packages 80 | COPY .condarc /opt/conda/.condarc 81 | COPY environment.yml environment.yml 82 | RUN conda install -y boto && \ 83 | conda install -y nomkl && \ 84 | conda env update -f environment.yml -n root && \ 85 | conda clean --all -y && \ 86 | rm -rf ~/.cache/pip 87 | 88 | # We aren't running a GUI, so force matplotlib to use 89 | # the non-interactive "Agg" backend for graphics. 90 | # Run matplotlib once to build the font cache. 91 | ENV MATPLOTLIBRC=${HOME}/.config/matplotlib/matplotlibrc 92 | RUN mkdir -p ${HOME}/.config/matplotlib && \ 93 | echo "backend : Agg" > ${HOME}/.config/matplotlib/matplotlibrc && \ 94 | python -c "import matplotlib.pyplot" 95 | 96 | # Enable widgetsnbextension for jupyter widgets. 97 | # See https://ipywidgets.readthedocs.io/en/stable/user_install.html. 98 | # This enables the extension in the conda environment. The conda-forge version 99 | # does this upon installation, but the default channel version doesn't seem to, 100 | # so we'll run this (again) just in case. 101 | RUN jupyter nbextension enable --py widgetsnbextension 102 | 103 | # Instruct joblib to use disk for temporary files. Joblib defaults to 104 | # /shm when that directory is present. In the Docker container, /shm is 105 | # present but defaults to 64 MB. 106 | # https://github.com/joblib/joblib/blob/0.11/joblib/parallel.py#L328L342 107 | ENV JOBLIB_TEMP_FOLDER=/tmp 108 | 109 | ENV VERSION=6.2.1 \ 110 | VERSION_MAJOR=6 \ 111 | VERSION_MINOR=2 \ 112 | VERSION_MICRO=1 113 | --------------------------------------------------------------------------------