apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
60.5k stars 13.07k forks source link

ARM (linux/arm64) dev images include x86 Firefox/geckodriver libraries #29087

Open isharamet opened 1 month ago

isharamet commented 1 month ago

Bug description

Official dev-images built for linux/arm64 include x86 Firefox/geckodriver libraries. When deployed on ARM-machines it generates following error on run:

OSError: [Errno 8] Exec format error: 'geckodriver'

In the last release version (4.0.1) as well as current master Dockerfile always installs linux64/linux-x86_64 versions of geckodriver and Firefox.

How to reproduce the bug

  1. Deploy 4.0.1-dev image on machine with ARM processor.
  2. Create alert/report with chart/dashboard image attachment and schedule delivery via email/Slack (although, alert/report creation via UI and Slack delivery is broken in 4.0.1 because of the following issues: 28712, 28353).
  3. Alert/report delivery should fail with the following error:
    OSError: [Errno 8] Exec format error: 'geckodriver'

Screenshots/recordings

No response

Superset version

4.0.1

Python version

3.9

Node version

16

Browser

Not applicable

Additional context

No response

Checklist

dosubot[bot] commented 1 month ago

Hey there, @isharamet! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's squash those bugs together! 🐞

To resolve the issue of OSError: [Errno 8] Exec format error: 'geckodriver' when deploying the 4.0.1-dev image on an ARM machine due to the inclusion of x86 Firefox/geckodriver libraries, you need to ensure that the correct ARM-compatible versions of Firefox and geckodriver are installed.

Here is how you can modify the Dockerfile to download and install the ARM versions of these libraries:

# Install GeckoDriver WebDriver
ARG GECKODRIVER_VERSION=v0.34.0 \
    FIREFOX_VERSION=125.0.3

# Detect the architecture and set the appropriate download URLs
RUN apt-get update -qq \
    && apt-get install -yqq --no-install-recommends wget bzip2 \
    && case "$(uname -m)" in \
        x86_64) ARCH=linux64 ;; \
        aarch64) ARCH=linux-aarch64 ;; \
       esac \
    && wget -q https://github.com/mozilla/geckodriver/releases/download/${GECKODRIVER_VERSION}/geckodriver-${GECKODRIVER_VERSION}-${ARCH}.tar.gz -O - | tar xfz - -C /usr/local/bin \
    && wget -q https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/${ARCH}/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 -O - | tar xfj - -C /opt \
    && ln -s /opt/firefox/firefox /usr/local/bin/firefox \
    && apt-get autoremove -yqq --purge wget bzip2 && rm -rf /var/[log,tmp]/* /tmp/* /var/lib/apt/lists/*

This modification uses a case statement to check the machine architecture and downloads the appropriate version of geckodriver and Firefox for either x86_64 or ARM (aarch64) [1][2].

To continue talking to Dosu, mention @dosu.

mistercrunch commented 4 weeks ago

Wondering if we could use playwright install in place of this big glob. Not sure how playwright plays with different cpu arch.

rusackas commented 4 weeks ago

cc @kgabryje in case he knows the deal there.