You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/10/06 07:46:23 UTC

[GitHub] [superset] zhaoyongjie commented on a diff in pull request #21583: build: optimize docker build by better utilizing build cache

zhaoyongjie commented on code in PR #21583:
URL: https://github.com/apache/superset/pull/21583#discussion_r988661323


##########
Dockerfile:
##########
@@ -85,16 +59,24 @@ RUN mkdir -p ${PYTHONPATH} \
         && apt-get install -y --no-install-recommends \
             build-essential \
             default-libmysqlclient-dev \
+            libsasl2-dev \
             libsasl2-modules-gssapi-mit \
             libpq-dev \
             libecpg-dev \
         && rm -rf /var/lib/apt/lists/*
 
-COPY --from=superset-py /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
-# Copying site-packages doesn't move the CLIs, so let's copy them one by one
-COPY --from=superset-py /usr/local/bin/gunicorn /usr/local/bin/celery /usr/local/bin/flask /usr/bin/
+COPY ./requirements/*.txt  /app/requirements/
+COPY setup.py MANIFEST.in README.md /app/
+
+# setup.py uses the version information in package.json
+COPY superset-frontend/package.json /app/superset-frontend/

Review Comment:
   IMO setup.py to read package.json isn't a good idea but exists a long time in Superset, might change this logic in the separated PR.



##########
Dockerfile:
##########
@@ -15,60 +15,34 @@
 # limitations under the License.
 #
 
-######################################################################
-# PY stage that simply does a pip install on our requirements
-######################################################################
-ARG PY_VER=3.8.13-slim
-FROM python:${PY_VER} AS superset-py
-
-RUN mkdir /app \
-        && apt-get update -y \
-        && apt-get install -y --no-install-recommends \
-            build-essential \
-            default-libmysqlclient-dev \
-            libpq-dev \
-            libsasl2-dev \
-            libecpg-dev \
-        && rm -rf /var/lib/apt/lists/*
-
-# First, we just wanna install requirements, which will allow us to utilize the cache
-# in order to only build if and only if requirements change
-COPY ./requirements/*.txt  /app/requirements/
-COPY setup.py MANIFEST.in README.md /app/
-COPY superset-frontend/package.json /app/superset-frontend/
-RUN cd /app \
-    && mkdir -p superset/static \
-    && touch superset/static/version_info.json \
-    && pip install --no-cache -r requirements/local.txt
-
-
 ######################################################################
 # Node stage to deal with static asset construction
 ######################################################################
+ARG PY_VER=3.8.13-slim

Review Comment:
   The section is the Node image so I think `PY_VER` is useless here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org