Browse Source

HUE-8737 [docker] Python 3 Dockerfile skeleton

Romain 5 years ago
parent
commit
b5b963f1df
2 changed files with 133 additions and 0 deletions
  1. 60 0
      desktop/core/requirements.txt
  2. 73 0
      tools/docker/hue/Dockerfile.py3

+ 60 - 0
desktop/core/requirements.txt

@@ -0,0 +1,60 @@
+asn1crypto==0.24.0
+avro-python3==1.8.2
+Babel==2.5.1
+BabelDjango==0.2.2
+boto==2.46.1
+celery==4.2.1
+cffi==1.13.2
+channels==2.1.6
+channels-redis==2.3.2
+configobj==5.0.6
+cryptography==2.8
+Django==1.11.28 # Django 2 then 3?
+# django-auth-ldap==1.3.0
+django-axes==2.2.0
+django-celery-beat==1.4.0
+django_celery_results==1.0.4
+django-crequest==2018.5.11
+django-debug-panel==0.8.3
+django-debug-toolbar==1.9.1
+django-extensions==1.8.0
+djangomako==1.0.1
+django-nose==1.4.5
+django_opentracing==1.1.0
+django_prometheus==1.0.15
+django-webpack-loader==0.5.0
+enum34==1.1.6
+enum-compat==0.0.2
+eventlet==0.24.1
+future==0.18.2
+greenlet==0.4.15
+gunicorn==19.9.0
+jaeger-client==4.0.0
+jdcal==1.0.1
+kazoo==2.0
+kerberos==1.3.0
+lockfile==0.12.2
+lxml==4.5.0
+Mako==1.0.7
+Markdown==3.1
+MarkupSafe==0.9.3
+nose==1.3.7
+openpyxl==2.6.2
+pyformance==0.3.2
+pysaml2>=4.5.0
+python-crontab==2.3.6
+python-dateutil==2.4.2
+# python-ldap==3.1.0
+python-oauth2==1.1.0
+pytidylib==0.3.2
+pytz==2015.2
+pyyaml>=4.2b1
+requests>=2.20.0
+requests-kerberos==0.12.0
+rsa==3.4.2
+sasl==0.2.1  # Move to https://pypi.org/project/sasl3/ ?
+six==1.12.0
+SQLAlchemy==1.3.8
+sqlparse==0.2.0
+tablib==0.13.0
+thrift==0.13.0

+ 73 - 0
tools/docker/hue/Dockerfile.py3

@@ -0,0 +1,73 @@
+# Welcome to Hue (http://gethue.com) Dockerfile
+
+FROM ubuntu:18.04
+LABEL description="Hue SQL Assistant - gethue.com"
+
+# TODO: run as hue from the start to avoid the long chmod
+
+ENV DEBIAN_FRONTEND=noninteractive
+RUN export PYTHON_VER=python3.6
+
+RUN apt-get update -y && apt-get install -y \
+  python3-pip \
+  #libmariadb-dev-compat \
+  # python3.6-dev \
+
+  #libsasl2-modules-gssapi-mit \
+  libkrb5-dev \
+  libsasl2-dev \
+  libxml2-dev \
+  libxslt-dev \
+  #libssl-dev \
+  libmysqlclient-dev \
+  libldap2-dev \
+  libsnappy-dev \
+  python3.6-venv
+
+ADD . /hue
+WORKDIR /hue
+
+RUN pip3 install virtualenv
+RUN python3.6 -m venv python_env
+
+SHELL ["/bin/bash", "-c"]
+RUN source python_env/bin/activate
+
+RUN pip3 install -r desktop/core/requirements.txt
+
+
+# Not doing a `make prod`, so manually getting production ini
+RUN rm desktop/conf/*
+COPY desktop/conf.dist desktop/conf
+
+# Need recent version for Ubuntu
+# RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - \
+#  && apt-get install -y nodejs
+
+RUN PREFIX=/usr/share PYTHON_VER=python3.6 make install # install not working?
+RUN useradd -ms /bin/bash hue && chown -R hue /usr/share/hue
+
+# Only keep install dir
+# Note: get more minimal image by pulling install dir in a stage 2 image
+WORKDIR /usr/share/hue
+RUN rm -rf /hue \
+  && rm -rf node_modules
+
+# Install DB connectors
+# To move to requirements_connectors.txt
+RUN ./build/env/bin/pip install \
+  psycopg2-binary \
+  redis==2.10.6 \
+  django_redis \
+  flower \
+  pyhive \
+  gevent \
+  # Needed for Jaeger
+  threadloop \
+  thrift-sasl==0.2.1
+
+COPY tools/docker/hue/conf desktop/conf
+COPY tools/docker/hue/startup.sh .
+
+EXPOSE 8888
+CMD ["./startup.sh"]