Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-963813: AWS Arm processor support for PDO driver #351

Open
chrispian opened this issue Nov 7, 2023 · 6 comments
Open

SNOW-963813: AWS Arm processor support for PDO driver #351

chrispian opened this issue Nov 7, 2023 · 6 comments
Labels
enhancement The issue is a request for improvement or a new feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@chrispian
Copy link

What is the current behavior?

Currently on Ubuntu on AWS the Arm64 Processors are not supported by the ODBC client. See: #299 (comment)

What is the desired behavior?

The driver should compile correctly on AWS Arm64 Linux machines.

How would this improve pdo_snowflake?

Arm processors are widely used in hosting and on Mac. I know the Mac's have been updated for PDO but ODBC drivers still fail on Apple silicon and AWS Arm processors. ODBC and PDO should both work on both systems. This way testing on local can be as in sync with prod as possible without having to resort to special Docker containers to solve the problem.

What is your Snowflake account identifier, if any?

Happy to provide this privately. I work for Adtran, Inc. Jeremy Lemmon @ Snowflake can confirm our account etc.

I was able to get the ODBC drivers installed on AWS but would much prefer to use the native PDO so that it's the same across all our systems.

Let me know if you need further details.

@github-actions github-actions bot changed the title AWS Arm processor support for PDO driver SNOW-963813: AWS Arm processor support for PDO driver Nov 7, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added the enhancement The issue is a request for improvement or a new feature label Dec 8, 2023
@stephenahiggins
Copy link

stephenahiggins commented Jan 27, 2024

I'm having the same issue with an M3 processor. Is the only workaround to use the OBDC driver? This is very frustrating.

@stephenahiggins
Copy link

stephenahiggins commented Jan 31, 2024

Update: I've managed to get this working in Docker via the Rosetta emulation (adding platform: linux/x86_64 to docker-compose.yaml.

docker-compose:

services:
    php:
        build:
            context: docker/php
            args:
                TIMEZONE: ${TIMEZONE}
        volumes:
            - ./:/var/www/symfony:cached
        networks:
            - my_app
        platform: linux/x86_64

Dockerfile:

FROM php:8.2-fpm-buster
ARG TIMEZONE

COPY php.ini /usr/local/etc/php/conf.d/docker-php-config.ini
ENV PHP_HOME="/usr/local/bin"
# I've no idea why this is needed
RUN pear config-set php_ini "/usr/local/etc/php/conf.d/docker-php-config.ini"

RUN apt-get update && apt-get install -y \
    gnupg \
    g++ \
    procps \
    openssl \
    git \
    unzip \
    zlib1g-dev \
    libzip-dev \
    libfreetype6-dev \
    libpng-dev \
    libjpeg-dev \
    libicu-dev  \
    libonig-dev \
    libxslt1-dev \
    acl \
    cmake \
    && echo 'alias sf="php bin/console"' >> ~/.bashrc

#Postgres PDO driver install and init
RUN apt-get install -y libpq-dev \
        && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
        && docker-php-ext-install pdo pdo_pgsql pgsql

####### SNOWFLAKE CONFIG START #######
# Source: https://devilbox.discourse.group/t/how-to-setup-snowflake-pdo/710
RUN mkdir /tmp/snowflake \
    && git clone https://github.com/snowflakedb/pdo_snowflake.git /tmp/snowflake
RUN export PHP_HOME \
    && bash /tmp/snowflake/scripts/build_pdo_snowflake.sh \
    && cp /tmp/snowflake/libsnowflakeclient/cacert.pem /tmp/snowflake/modules/pdo_snowflake.so /usr/local/lib/php/extensions/no-debug-non-zts-*/ \
    && mkdir /etc/php-snowflake \
    && cp /tmp/snowflake/libsnowflakeclient/cacert.pem /etc/php-snowflake/cacert.pem \
    && rm -rf /tmp/snowflakeindex

# Snowflake is also included in php.ini (see line 5)
####### SNOWFLAKE CONFIG END #######

# Set timezone
RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && echo ${TIMEZONE} > /etc/timezone \
    && printf '[PHP]\ndate.timezone = "%s"\n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini \
    && "date"

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Install xdebug
RUN pecl install xdebug \
      && docker-php-ext-enable xdebug
# Set work directory
WORKDIR /var/www/symfony

@kissifrot
Copy link

Most build problems exists because this repository used prebuilt libraries dependencies instead of letting us build them on our own, which increases quite a bit repository size and prevents this extension to be distributed on distros.

@sfc-gh-dszmolka
Copy link
Contributor

hi and thank you for submitting this issue ! since v2.0.0 of the driver the mac arm64 should be supported, but indeed we do not support linux arm64 yet.

there's now an enhancement request open - and i'll keep this thread posted with the progress if any. Thank you for bearing with us !

@nbennett25
Copy link

nbennett25 commented Mar 6, 2024

@sfc-gh-dszmolka are there any tricks to getting the Mac ARM64 support going? I'm running into the same error as SNOW-979091 (build2.txt) running the install script in a Debian Docker container on a M1 Pro processor system.

@sfc-gh-dszmolka
Copy link
Contributor

hi @nbennett25 so checking this on a M1 Mac, this seems to happen

% uname -m
arm64
% docker run debian:12 uname -m 
aarch64 # <-- linux arm64 is not supported yet
% docker run --platform=linux/amd64 debian:12 uname -m
x86_64

if you run the Debian container without forcing the platform, by default it will run as arm64 as the host M1 Mac OS. But for Linux it's not supported yet in the PHP driver.

I would recommend running it as amd64 with forcing the platform as seen in the above example. Hope it helps.

@sfc-gh-dszmolka sfc-gh-dszmolka removed their assignment Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is a request for improvement or a new feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

5 participants