eschutho opened a new pull request, #35294:
URL: https://github.com/apache/superset/pull/35294

   ## Summary
   
   This PR fixes an issue where the `LOAD_EXAMPLES_DUCKDB` build argument was 
being ignored during multi-stage Docker builds, causing showtime ephemeral 
environments to fail loading examples.
   
   ## The Problem
   
   When showtime builds Docker images with `--build-arg 
LOAD_EXAMPLES_DUCKDB=true --target showtime`, the build argument was being 
ignored because:
   
   1. The `ARG LOAD_EXAMPLES_DUCKDB` was declared **inside** the 
`python-common` stage
   2. Docker build args passed via CLI are only available to stages that 
explicitly declare them
   3. The showtime target inherits from lean → python-common but never received 
the ARG value
   4. Result: The DuckDB examples file was never downloaded, causing examples 
to fail loading
   
   ## The Solution
   
   Following Docker's multi-stage build ARG scope rules:
   1. **Move** `ARG LOAD_EXAMPLES_DUCKDB="false"` to global scope (before any 
FROM statement)
   2. **Re-declare** it in the `python-common` stage where it's used (without 
default value)
   3. Now the build argument is properly passed through the build chain
   
   ## Before/After
   
   **Before**: 
   - `docker buildx build --build-arg LOAD_EXAMPLES_DUCKDB=true --target 
showtime` ignored the ARG
   - DuckDB file not downloaded → examples fail to load in showtime environments
   
   **After**:
   - Build argument properly received in python-common stage
   - DuckDB examples file downloaded when `LOAD_EXAMPLES_DUCKDB=true`
   - Showtime environments can successfully load examples
   
   ## Testing Instructions
   
   1. Build a Docker image with the showtime target:
      ```bash
      docker buildx build --build-arg LOAD_EXAMPLES_DUCKDB=true --target 
showtime -t test-showtime .
      ```
   2. Verify the build output shows "Downloading pre-built examples.duckdb..."
   3. Run container and check that `/app/data/examples.duckdb` exists
   4. Deploy a showtime environment and verify examples load correctly
   
   ## Additional Context
   
   This issue was discovered while debugging why showtime ephemeral 
environments weren't loading examples despite having the correct runtime 
configuration. The root cause was that the DuckDB file wasn't being downloaded 
during the build due to this ARG scope issue.
   
   ## Additional Information
   
   - [x] Fixes showtime ephemeral environments example loading
   - [ ] Has associated issue:
   - [ ] Required feature flags: None
   - [ ] Changes UI: No
   - [ ] Includes DB Migration: No
   - [ ] Introduces new feature or API: No
   - [ ] Removes existing feature or API: No
   
   🤖 Generated with [Claude Code](https://claude.ai/code)


-- 
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