Skip to content

Commit

Permalink
overhaul build
Browse files Browse the repository at this point in the history
  • Loading branch information
amancevice committed Oct 13, 2023
1 parent 216e059 commit e5da355
Show file tree
Hide file tree
Showing 7 changed files with 3,365 additions and 1,702 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
**/.docker/
**/.env
requirements*.txt
67 changes: 34 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ ARG PYTHON_VERSION=3.9
FROM python:$PYTHON_VERSION

# Configure environment
# superset recommended defaults: https://superset.apache.org/docs/installation/configuring-superset#running-on-a-wsgi-http-server
# gunicorn recommended defaults: https://docs.gunicorn.org/en/0.17.2/configure.html#security
ARG SUPERSET_VERSION=2.0.1
# superset/gunicorn recommended defaults:
# - https://superset.apache.org/docs/installation/configuring-superset#running-on-a-wsgi-http-server
# - https://docs.gunicorn.org/en/latest/configure.html
ENV FLASK_APP=superset
ENV GUNICORN_BIND=0.0.0.0:8088
ENV GUNICORN_LIMIT_REQUEST_FIELD_SIZE=8190
Expand All @@ -18,49 +18,50 @@ ENV GUNICORN_WORKER_CLASS=gevent
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONPATH=/etc/superset:/home/superset:$PYTHONPATH
ENV SUPERSET_REPO=apache/superset
ENV SUPERSET_HOME=/var/lib/superset
ENV SUPERSET_VERSION=$SUPERSET_VERSION
ENV GUNICORN_CMD_ARGS="--bind $GUNICORN_BIND --limit-request-field_size $GUNICORN_LIMIT_REQUEST_FIELD_SIZE --limit-request-line $GUNICORN_LIMIT_REQUEST_LINE --threads $GUNICORN_THREADS --timeout $GUNICORN_TIMEOUT --workers $GUNICORN_WORKERS --worker-class $GUNICORN_WORKER_CLASS"

# Configure filesystem
COPY bin /usr/local/bin
VOLUME /etc/superset
VOLUME /home/superset
VOLUME /var/lib/superset

# Create superset user & install dependencies
WORKDIR /home/superset
COPY requirements*.txt ./
RUN groupadd supergroup && \
useradd -U -G supergroup superset && \
chown superset:superset /home/superset && \
mkdir -p /etc/superset && \
mkdir -p $SUPERSET_HOME && \
chown -R superset:superset /etc/superset && \
mkdir -p /etc/superset && \
chown -R superset:superset $SUPERSET_HOME && \
chown -R superset:superset /home/superset && \
chown -R superset:superset /etc/superset && \
apt-get update && \
apt-get install -y \
build-essential \
curl \
default-libmysqlclient-dev \
freetds-bin \
freetds-dev \
libaio1 \
libecpg-dev \
libffi-dev \
libldap2-dev \
libpq-dev \
libsasl2-2 \
libsasl2-dev \
libsasl2-modules-gssapi-mit \
libssl-dev && \
apt-get clean && \
pip install -r requirements.txt && \
pip install -r requirements-dev.txt && \
pip install apache-superset==$SUPERSET_VERSION
build-essential \
curl \
default-libmysqlclient-dev \
freetds-bin \
freetds-dev \
libaio1 \
libecpg-dev \
libffi-dev \
libldap2-dev \
libpq-dev \
libsasl2-2 \
libsasl2-dev \
libsasl2-modules-gssapi-mit \
libssl-dev && \
apt-get clean && \
pip install -U pip

# Configure Filesystem
COPY bin /usr/local/bin
VOLUME /etc/superset
VOLUME /home/superset
VOLUME /var/lib/superset
# Install pips
RUN pip install pystan==3.7.0
COPY requirements*.txt ./
RUN pip install -r requirements.txt
RUN pip install -r requirements-dev.txt

# Finalize application
# Configure application
EXPOSE 8088
USER superset
HEALTHCHECK CMD ["curl", "-f", "http://localhost:8088/health"]
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ PYTHON_VERSION := $(shell pyenv local)
SUPERSET_VERSION := $(shell grep apache-superset Pipfile | grep -Eo '[0-9.]+')

build: requirements-dev.txt
docker build \
docker buildx build \
--platform linux/amd64 \
--tag $(REPO) \
--tag $(REPO):$(SUPERSET_VERSION) \
.
Expand Down
61 changes: 29 additions & 32 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,41 @@ url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

# This section for Python packages that
# MUST be installed before anything else
[packages]
pystan = "==2.19.1.1"
apache-superset = "==3.0.0"
cython = "==3.0.3"
# pystan = "==3.7.0"
urllib3 = "==1.26.17"

# This section for all other packages
[dev-packages]
"infi.clickhouse-orm" = "==1.0.2"
authlib = "==0.14.3"
clickhouse-sqlalchemy = "==0.1.6"
cx-oracle = "==7.3.0"
elasticsearch-dbapi = "==0.1.2"
flask-cors = "==3.0.9"
"infi.clickhouse-orm" = "==2.1.3"
authlib = "==1.2.1"
clickhouse-sqlalchemy = "==0.2.4"
cx-oracle = "==8.3.0"
# elasticsearch-dbapi = "==0.2.10"
flask-cors = "==4.0.0"
flask-mail = "==0.9.1"
flask-oauth = "==0.12"
flask-oauthlib = "==0.9.5"
gevent = "==22.10.2"
impyla = "==0.14.0"
markupsafe = "==2.0.1"
mysqlclient = "==1.4.2"
openpyxl = "==3.0.10"
pillow = "==9.3.0"
prophet = "==1.0.1"
psycopg2 = "==2.9.3"
pyathena = "==1.5.1"
pydruid = "==0.5.7"
pyhive = "==0.6.1"
pyldap = "==2.4.28"
pymssql-linux = "==2.1.6"
redis = "==4.5.4"
sasl = "==0.2.1"
snowflake-sqlalchemy = "==1.2.1"
sqlalchemy-bigquery = "==1.6.1"
flask-oauthlib = "==0.9.6"
gevent = "==23.9.1"
impyla = "==0.18.0"
markupsafe = "==2.1.3"
mysqlclient = "==2.2.0"
openpyxl = "==3.1.2"
pillow = "==10.0.1"
# prophet = "==1.1.4"
psycopg2 = "==2.9.7"
pyathena = "==3.0.7"
pydruid = "==0.6.5"
pyhive = "==0.7.0"
pyldap = "==3.0.0"
# pymssql-linux = "==2.1.6"
sasl = "==0.3.1"
# snowflake-sqlalchemy = "==1.5.0"
sqlalchemy-bigquery = "==1.8.0"
sqlalchemy-redshift = "==0.8.14"
sqlalchemy-trino = "==0.3.0"
thrift-sasl = "==0.3.0"
werkzeug = "==2.0.3"
wtforms = "==2.3.3"
sqlalchemy-trino = "==0.5.0"
thrift-sasl = "==0.4.3"

[requires]
python_version = "3.9"
Loading

0 comments on commit e5da355

Please sign in to comment.