Code Monkey home page Code Monkey logo

Comments (2)

dosubot avatar dosubot commented on August 28, 2024 3

Hey there, @jtcurlin! I'm Dosu, a bot here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! ๐Ÿค–

To prevent the frontend build from running in Docker when setting BUILD_SUPERSET_FRONTEND_IN_DOCKER to false within the .env file, you need to ensure that the Dockerfile and related scripts respect this environment variable.

Currently, setting BUILD_SUPERSET_FRONTEND_IN_DOCKER to false only affects the docker/docker-frontend.sh script, which skips the frontend build steps and outputs the message "Skipping frontend build steps - YOU RUN IT MANUALLY ON THE HOST!" [1].

However, the npm run build command in the Dockerfile is not conditional on this environment variable. To address this, you can modify the Dockerfile to conditionally run the frontend build based on the BUILD_SUPERSET_FRONTEND_IN_DOCKER variable. Here is an example of how you can modify the Dockerfile:

# Dockerfile
ARG BUILD_SUPERSET_FRONTEND_IN_DOCKER=true

# Other Dockerfile steps...

# Conditionally run the frontend build
RUN if [ "$BUILD_SUPERSET_FRONTEND_IN_DOCKER" = "true" ]; then npm run build; else echo "Skipping frontend build"; fi

This modification ensures that the frontend build only runs if BUILD_SUPERSET_FRONTEND_IN_DOCKER is set to true.

Additionally, if you have less than 16GB of memory, running the frontend build locally can be much faster. You can do this by navigating to the superset-frontend directory and running:

npm install
npm run dev

This will install the necessary dependencies and start the development server for the frontend, allowing you to see changes in real-time [1].

For more details on the recent changes to the Dockerfile that might affect the frontend build process, you can refer to the specific updates such as the Node version update, NPM build command argument, memory management script, and translation files handling [2].

To continue talking to Dosu, mention @dosu.

from superset.

mistercrunch avatar mistercrunch commented on August 28, 2024 2

hey, this is a bit confusing, but BUILD_SUPERSET_FRONTEND_IN_DOCKER affects a subsequent build step in docker/docker-frontend.sh, that's related to firing up docker-compose. The step you refer to above happens much earlier in the docker build process.

Essentially our dev setup is based on our docker builds, and part of that multi-stage / target docker build that somewhere upstreams builds the frontend bundle, only to throw it away / redo it in the late docker-compose build step as npm run dev, which operates off a mount and removes the need for that upstream build.

It would be nice to make that step optional upstream perhaps, but could create other kind of confusion an conflicts. Wondering if simply adding an ARG in our main dockerfile based on BUILD_SUPERSET_FRONTEND_IN_DOCKER would have any downsides (?)

Also hoping that in many cases you could docker pull and operate from cache instead of locally building that layer.

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.