You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by dp...@apache.org on 2020/02/12 15:48:48 UTC

[incubator-superset] branch master updated: [docker] fix, Dockerfile for frontend builds (#9114)

This is an automated email from the ASF dual-hosted git repository.

dpgaspar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 966d321  [docker] fix, Dockerfile for frontend builds (#9114)
966d321 is described below

commit 966d321703480c5edbccdd17e1b09cd9969e0264
Author: David Aaron Suddjian <18...@users.noreply.github.com>
AuthorDate: Wed Feb 12 07:48:24 2020 -0800

    [docker] fix, Dockerfile for frontend builds (#9114)
    
    * fix dockerfile for frontend builds
    
    * fix paths
    
    * empty commit for CI
    
    * adjust version_info.json
    
    * making version_info work
    
    * rat
    
    * fixing docker-compose node service
    
    * address feedback
---
 .gitignore               | 4 ++--
 .rat-excludes            | 1 +
 Dockerfile               | 2 ++
 docker-compose.yml       | 1 +
 setup.py                 | 2 +-
 superset/config.py       | 5 ++---
 superset/static/.gitkeep | 0
 7 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 1b12d0c..b1d505a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,8 +61,8 @@ npm-debug.log*
 superset-frontend/coverage/*
 superset-frontend/cypress/screenshots
 superset-frontend/cypress/videos
-superset-frontend/version_info.json
-superset/static
+superset/static/assets
+superset/static/version_info.json
 yarn-error.log
 
 # IntelliJ
diff --git a/.rat-excludes b/.rat-excludes
index 83bdd69..8cd9d57 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -1,5 +1,6 @@
 .gitignore
 .gitattributes
+.gitkeep
 .coverage
 .coveragerc
 .codecov.yml
diff --git a/Dockerfile b/Dockerfile
index 19ec06d..33be492 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -43,6 +43,7 @@ FROM node:10-jessie AS superset-node
 
 # NPM ci first, as to NOT invalidate previous steps except for when package.json changes
 RUN mkdir -p /app/superset-frontend
+RUN mkdir -p /app/superset/assets
 COPY ./superset-frontend/package* /app/superset-frontend/
 RUN cd /app/superset-frontend \
         && npm ci
@@ -81,6 +82,7 @@ RUN useradd --user-group --no-create-home --no-log-init --shell /bin/bash supers
 COPY --from=superset-py /usr/local/lib/python3.6/site-packages/ /usr/local/lib/python3.6/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 --from=superset-node /app/superset/static/assets /app/superset/static/assets
 COPY --from=superset-node /app/superset-frontend /app/superset-frontend
 
 ## Lastly, let's install superset itself
diff --git a/docker-compose.yml b/docker-compose.yml
index 3adee4e..16deb6a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -26,6 +26,7 @@ x-superset-volumes: &superset-volumes
   - ./docker/docker-init.sh:/app/docker-init.sh
   - ./docker/pythonpath_dev:/app/pythonpath
   - ./superset:/app/superset
+  - ./superset-frontend:/app/superset-frontend
   - superset_home:/app/superset_home
 
 version: "3.7"
diff --git a/setup.py b/setup.py
index 4eb8d0a..6daa124 100644
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,7 @@ print("VERSION: " + version_string)
 print("GIT SHA: " + GIT_SHA)
 print("-==-" * 15)
 
-VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset-frontend", "version_info.json")
+VERSION_INFO_FILE = os.path.join(BASE_DIR, "superset", "static", "version_info.json")
 
 with open(VERSION_INFO_FILE, "w") as version_file:
     json.dump(version_info, version_file)
diff --git a/superset/config.py b/superset/config.py
index 1ff7463..1e4756f 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -57,9 +57,8 @@ else:
 # ---------------------------------------------------------
 # Superset specific config
 # ---------------------------------------------------------
-PACKAGE_DIR = os.path.join(BASE_DIR, "static", "assets")
-VERSION_INFO_FILE = os.path.join(PACKAGE_DIR, "version_info.json")
-PACKAGE_JSON_FILE = os.path.join(BASE_DIR, "assets", "package.json")
+VERSION_INFO_FILE = os.path.join(BASE_DIR, "static", "version_info.json")
+PACKAGE_JSON_FILE = os.path.join(BASE_DIR, "static", "assets", "package.json")
 
 # Multiple favicons can be specified here. The "href" property
 # is mandatory, but "sizes," "type," and "rel" are optional.
diff --git a/superset/static/.gitkeep b/superset/static/.gitkeep
new file mode 100644
index 0000000..e69de29