Skip to content

Commit

Permalink
HUE-8737 [py3] Refactor and remove dependencies in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
romainr committed Mar 17, 2020
1 parent b5b963f commit b364698
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Makefile.sdk
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ $(EXT_PY_ENV_INSTALL_TARGETS): CUR_EXT_PY=$(notdir $(@D))

#
# ext-env-pip-install
# Pip install any 3rd party package that are based on requirements_py3.txt
# Pip install any 3rd party package that are based on requirements.txt
#
.PHONY: ext-env-pip-install
ext-env-pip-install:
@echo '--- Installing requirement.txt into virtual-env via $(ENV_PIP) command to file $(REQUIREMENT_FILE).'
@echo '--- Installing $(REQUIREMENT_FILE) into virtual-env via $(ENV_PIP)'
@$(ENV_PIP) install -r $(REQUIREMENT_FILE)
@echo '--- Finished requirement.txt into virtual-env'
@echo '--- Finished $(REQUIREMENT_FILE) into virtual-env'
@$(ENV_PIP) install $(NAVOPTAPI_WHL)
@echo '--- Finished $(NAVOPTAPI_WHL) into virtual-env'

Expand Down
5 changes: 4 additions & 1 deletion Makefile.vars
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ VER_ERR_MSG = "Variable PYTHON_VER is $(PYTHON_VER) but it only supports python2
PYTHON_VER ?= python2.7
PYTHON_EXE = $(shell echo $(PYTHON_VER) | sed "s/\.//")

$(info "PYTHON_VER is $(PYTHON_VER)")

ifeq ($(PYTHON_VER),python2.7)
$(info "PYTHON_VER is $(PYTHON_VER)")
$(info "Python 2 module install of desktop/ext-py")
EXT_ENV_INSTALL = ext-env-install
else ifeq ($(shell echo $(PYTHON_VER) | head -c 8),python3.)
$(info "Python 3 module install via pip")
PYTHON_VER := $(shell echo $(PYTHON_VER) | head -c 9)
MINOR_VER = $(shell echo -n $(PYTHON_VER) | tail -c 1)
ifeq ($(shell test $(MINOR_VER) -lt 5; echo $$?),0)
Expand Down
4 changes: 1 addition & 3 deletions desktop/core/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ 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
Expand Down Expand Up @@ -54,7 +52,7 @@ 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
SQLAlchemy==1.3.15
sqlparse==0.2.0
tablib==0.13.0
thrift==0.13.0
28 changes: 12 additions & 16 deletions tools/docker/hue/Dockerfile.py3
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ 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 \
python3-pip #libmariadb-dev-compat # python3.6-dev \
libkrb5-dev \
libsasl2-modules-gssapi-mit \
libsasl2-dev \
libkrb5-dev \
libxml2-dev \
libxslt-dev \
#libssl-dev \
libxslt-dev \ #libssl-dev \
libmysqlclient-dev \
libldap2-dev \
libsnappy-dev \
Expand All @@ -27,11 +23,11 @@ RUN apt-get update -y && apt-get install -y \
ADD . /hue
WORKDIR /hue

RUN pip3 install virtualenv
RUN python3.6 -m venv python_env
#RUN pip3 install virtualenv
#RUN python3.6 -m venv python_env

SHELL ["/bin/bash", "-c"]
RUN source python_env/bin/activate
#SHELL ["/bin/bash", "-c"]
#RUN source python_env/bin/activate

RUN pip3 install -r desktop/core/requirements.txt

Expand Down Expand Up @@ -60,12 +56,12 @@ RUN ./build/env/bin/pip install \
redis==2.10.6 \
django_redis \
flower \
pyhive \
git+https://github.com/gethue/PyHive #pyhive \
gevent \
# Needed for Jaeger
threadloop \
threadloop # Needed for Jaeger \
thrift-sasl==0.2.1


COPY tools/docker/hue/conf desktop/conf
COPY tools/docker/hue/startup.sh .

Expand Down

0 comments on commit b364698

Please sign in to comment.