jtcurlin opened a new issue, #29462:
URL: https://github.com/apache/superset/issues/29462

   ### Bug description
   
   To preface, I am very inexperienced with docker & npm and apologize for any 
potential oversight. 
   
   I am attempting a straightforward build via ``` docker compose up ``` on a 
MBP M1 16gb. 
   
   My initial attempts failed with 8gb allocated to docker with the following 
output.
   
   ```
    => ERROR [superset-worker superset-node  7/12] RUN npm run build            
                                                                                
                                                                                
                         100.5s
   ------
    > [superset-worker superset-node  7/12] RUN npm run build:
   0.439 
   0.439 > [email protected] build
   0.439 > cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production 
BABEL_ENV="${BABEL_ENV:=production}" webpack --mode=production --color
   0.439 
   1.778 [Superset Plugin] Use symlink source for @superset-ui/chart-controls @ 
./packages/superset-ui-chart-controls
   1.779 [Superset Plugin] Use symlink source for @superset-ui/core @ 
./packages/superset-ui-core
   
   ...
   99.65 \ Processing: 
src/features/databases/UploadDataModel/StyledFormItemWithTip.tsx 
   99.71 | Processing: 
src/features/databases/UploadDataModel/UploadDataModal.test.tsx 
   ------
   failed to solve: process "/bin/sh -c npm run ${BUILD_CMD}" did not complete 
successfully: exit code: 1
   `docker-compose` process finished with exit code 17
   ```
   <br>
   <p>I eventually managed a successful build by upping my docker allocation to 
11gb. </p>
   
   
   Upon attempting to build the frontend on-host in order to minimize docker's 
memory consumption on my machine, I followed [the documentation's guidance on 
this 
issue](https://github.com/apache/superset/blob/master/docs/docs/installation/docker-compose.mdx),
 which states: 
   
   > By default, we mount the local superset-frontend folder here and run npm 
install as well as npm run dev which triggers webpack to compile/bundle the 
frontend code. Depending on your local setup, especially if you have less than 
16GB of memory, it may be very slow to perform those operations. In this case, 
we recommend you set the env var BUILD_SUPERSET_FRONTEND_IN_DOCKER to false, 
and to run this locally instead in a terminal. Simply trigger npm i && npm run 
dev, this should be MUCH faster.
   
   While this envvar does seem to conditionally trigger a call to ``` npm run 
dev ``` at 
[docker-frontend.sh:32](https://github.com/apache/superset/blob/ba405bacbfa0bbd9bfd8089147ecaddd9a2ec962/docker/docker-frontend.sh),
 as best I can tell, it has no effect on the call of ``` npm run build ``` made 
at 
[Dockerfile:50](https://github.com/apache/superset/blob/ba405bacbfa0bbd9bfd8089147ecaddd9a2ec962/Dockerfile).
   
   
   Additionally, with the addition of [additional steps such as 
translations](https://github.com/apache/superset/commit/8d57a35531cbe5546bb2022fa58220873a06634e)
 into the Dockerfile's build process, it seems as though building of the 
frontend on-host is further infeasible at this time. 
   
   
   
   ### How to reproduce the bug
   
   1. Set BUILD_SUPERSET_FRONTEND_IN_DOCKER to 'false' within 
[.env](https://github.com/apache/superset/blob/ba405bacbfa0bbd9bfd8089147ecaddd9a2ec962/docker/.env).
 
   2. Execute ``` docker compose up ```. 
   3. ``` npm run build ``` and the resulting webpack build process occurs 
regardless.
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to