dd-trace-php icon indicating copy to clipboard operation
dd-trace-php copied to clipboard

[Feature] Support arm architecture

Open jippi opened this issue 4 years ago • 22 comments

Is your feature request related to a problem? Please describe.

I want to be able to build my Docker images which depend on Datadog PHP extension on my m1 Mac laptop as well as AWS Graviton CPUs (using Ubuntu image)

Describe the solution you'd like

A published deb file for arm architecture I can install

Describe alternatives you've considered

N/A

Additional context

N/A

jippi avatar Jun 08 '21 12:06 jippi

Hey @jippi, we are looking into arm builds but unfortunately, at the moment, I cannot share a precise ETA for it.

labbati avatar Jun 10 '21 08:06 labbati

@labbati Thanks for the update! It's not urgent, we just used platform: linux/amd64 for our image in question (docker-compose) and moved on for now :) but great to know its on the roadmap somewhere

jippi avatar Jun 10 '21 14:06 jippi

We need this too. Is there any long-shot alternative at the present date?

sankalpsans avatar Sep 27 '21 19:09 sankalpsans

I need an update on this, please. We're trying to upgrade our EC2 instances to Graviton and upgrade all of our engineers laptops to use Apple Silicon.

elijahchancey avatar Sep 28 '21 20:09 elijahchancey

Hello. As I said previously, we will support arm in the future, but the work has not been scheduled, yet.

In the meantime, let me share examples of Dockerfiles that show you how to build from scratch and install our extension. I will also add it to our docs for future reference. We had reports of users running our tracer on arm64 in production. In principle, everything should be smooth.

Ubuntu example

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

# required dependencies
RUN apt update; \
    apt install -y build-essential git libcurl4-openssl-dev php7.4-cli php7.4-fpm php7.4-dev

# install composer (https://getcomposer.org/download/)
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
    php composer-setup.php --install-dir=/usr/bin --filename=composer

ENV DD_TRACE_VERSION 0.65.1

# clone dd-tr   ace-php repo (https://github.com/DataDog/dd-trace-php)
WORKDIR /tmp
RUN git clone --single-branch --branch=${DD_TRACE_VERSION} --depth 1 https://github.com/DataDog/dd-trace-php.git
WORKDIR /tmp/dd-trace-php

# build
RUN make all CFLAGS="-std=gnu11 -O2 -g -Wall -Wextra" ECHO_ARG="-e"
RUN make generate

# install
# 1) copy the bridge folder to some location
RUN mkdir -p /opt/datadog/dd-trace-php && \
    cp -r bridge/ /opt/datadog/dd-trace-php/

# 2) copy ./tmp/build_extension/modules/ddtrace.so to your extension directory.
#    You can find your extension directory running:
#       - for `php` --> `php -i | grep -i extension_dir`
#       - for `php-fpm` --> `php-fpm7.4 -i | grep -i extension_dir`
#    in this specific example it results to be /usr/lib/php/20190902
RUN cp ./tmp/build_extension/modules/ddtrace.so /usr/lib/php/20190902/

# 3) add the following lines to 98-ddtrace.ini in your ini settings directory.
#    You can find your ini settings directory running:
#       - for `php` --> `php -i | grep -i 'Scan this dir for additional .ini files'`
#       - for `php-fpm` --> `php-fpm7.4 -i | grep -i 'Scan this dir for additional .ini files'`
#    in this specific example it results to be /etc/php/7.4/cli/conf.d and /etc/php/7.4/fpm/conf.d respectively
RUN echo "extension=ddtrace.so" >> /etc/php/7.4/cli/conf.d/98-ddtrace.ini
RUN echo "datadog.trace.request_init_hook=/opt/datadog/dd-trace-php/bridge/dd_wrap_autoloader.php" >> /etc/php/7.4/cli/conf.d/98-ddtrace.ini
RUN echo "extension=ddtrace.so" >> /etc/php/7.4/fpm/conf.d/98-ddtrace.ini
RUN echo "datadog.trace.request_init_hook=/opt/datadog/dd-trace-php/bridge/dd_wrap_autoloader.php" >> /etc/php/7.4/fpm/conf.d/98-ddtrace.ini

Centos example

FROM centos:8

# required dependencies
RUN yum install -y php php-fpm php-devel php-json git gcc make which curl-devel


# install composer (https://getcomposer.org/download/)
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
    php composer-setup.php --install-dir=/usr/bin --filename=composer

ENV DD_TRACE_VERSION 0.65.1

# clone dd-trace-php repo (https://github.com/DataDog/dd-trace-php)
WORKDIR /tmp
RUN git clone --single-branch --branch=${DD_TRACE_VERSION} --depth 1 https://github.com/DataDog/dd-trace-php.git
WORKDIR /tmp/dd-trace-php

# build
RUN make all CFLAGS="-std=gnu11 -O2 -g -Wall -Wextra" ECHO_ARG="-e"
RUN make generate

# install
# 1) copy the bridge folder to some location
RUN mkdir -p /opt/datadog/dd-trace-php && \
    cp -r bridge/ /opt/datadog/dd-trace-php/

# 2) copy ./tmp/build_extension/modules/ddtrace.so to your extension directory.
#    You can find your extension directory running:
#       - for `php` --> `php -i | grep -i extension_dir`
#       - for `php-fpm` --> `php-fpm -i | grep -i extension_dir`
#    in this specific example it results to be /usr/lib64/php/modules/
RUN cp ./tmp/build_extension/modules/ddtrace.so /usr/lib64/php/modules/

# 3) add the following lines to 98-ddtrace.ini in your ini settings directory.
#    You can find your ini settings directory running:
#       - for `php` --> `php -i | grep -i 'Scan this dir for additional .ini files'`
#       - for `php-fpm` --> `php-fpm -i | grep -i 'Scan this dir for additional .ini files'`
#    in this specific example it results to be /etc/php.d
RUN echo "extension=ddtrace.so" >> /etc/php.d/98-ddtrace.ini
RUN echo "datadog.trace.request_init_hook=/opt/datadog/dd-trace-php/bridge/dd_wrap_autoloader.php" >> /etc/php.d/98-ddtrace.ini

labbati avatar Sep 29 '21 10:09 labbati

Heya @labbati. Just wondering if this has landed on your roadmap (yet)? Given Apple's position on Intel, first-class arm64 support would be very compelling for me - and I suspect a lot of others :-)

unsignedint avatar Nov 03 '21 00:11 unsignedint

Any news on that feature? A lot of devs now switch to M1 Macs

dmitrii-baranov-tg avatar Dec 04 '21 08:12 dmitrii-baranov-tg

We also use Mac M1 (ARM) and ARM based infrastructure on AWS.

Do Datadog has a roadmap for this support ?

tristanbes avatar Mar 15 '22 15:03 tristanbes

We started a PoC this week https://github.com/DataDog/dd-trace-php/tree/labbati/arm. As a first milestone want to achieve a fully working OOTB experience for PHP 7.4. Will post updates as we get closer. Quite a few preliminary work is required (e.g. rebuilding many images etc...)

labbati avatar Mar 15 '22 15:03 labbati

Thanks @labbati Well our production has been on PHP 8.x since few months ago, so If I may ask, how soon the support for PHP8.x and PHP8.1 for ARM ? :D

tristanbes avatar Mar 15 '22 15:03 tristanbes

I understand, but 7.4 is still our most adopted version, and once the changes have been made they will be trivial (unless something crazy comes up) to be ported to 8. Note for who is reading this issue, that arm will not be supported on PHP 5.

labbati avatar Mar 16 '22 09:03 labbati

Thank you for the work on arm64 support.

We'd like to move to Amazon's graviton instances, which are arm64, and would need this to be unblocked.

+1 for PHP 8.0 please

pieterza avatar Mar 22 '22 09:03 pieterza

We would absolutely love php 8.0 / arm64 support!

elijahchancey avatar May 09 '22 22:05 elijahchancey

Another vote for PHP 8.1 and ARM64 support.

jaikdean avatar Jun 21 '22 11:06 jaikdean

+1 for arm support

avionwd avatar Jul 08 '22 15:07 avionwd

+1 for arm support

abdulrehman-sk avatar Jul 21 '22 13:07 abdulrehman-sk

+1 for arm support

dominik-pakosz avatar Aug 03 '22 08:08 dominik-pakosz

+1 for arm support (cant use datadog without it)

tytanick avatar Aug 03 '22 21:08 tytanick

@labbati 🙏 more and more customer needs this.

It is still a blocker for us to upgrade to PHP8.1 which is mandatory to upgrade to Symfony6. Datadog is defacto the only reason we still haven't updated to PHP8.1 & Symfony6 :(

tristanbes avatar Aug 04 '22 12:08 tristanbes

Seem to be some work going on here https://github.com/DataDog/dd-trace-php/tree/labbati/arm

jippi avatar Aug 04 '22 17:08 jippi

yes but nothing has happened since 23 June, I've been monitoring the commits on his tree since march :p

tristanbes avatar Aug 04 '22 17:08 tristanbes

The work resumed this week and it is part of our current quarter focus. Thank you all for the patience. We understand how urgent this is becoming for many of our users.

labbati avatar Aug 04 '22 18:08 labbati

This is very, very exciting!

elijahchancey avatar Aug 16 '22 10:08 elijahchancey

The work resumed this week and it is part of our current quarter focus. Thank you all for the patience. We understand how urgent this is becoming for many of our users.

Looking forward to it!

egonbraun avatar Aug 16 '22 10:08 egonbraun

Another bump for arm64 and php 8.1 support please, would be awesome !

mikecouk avatar Aug 16 '22 13:08 mikecouk

For the record: we are close to getting arm64 support officially ready.

The current state is that we have builds for arm64 now for PHP 7.0+ (https://app.circleci.com/pipelines/github/DataDog/dd-trace-php/8793/workflows/3a94cfcf-f55b-42d6-b3a3-e46b46ed7a41/jobs/1370545/artifacts - most recent pipeline), we are currently in progress of fixing up our testsuite, the next release will definitely have arm64 support.

bwoebi avatar Aug 17 '22 01:08 bwoebi

Arm64 releases are now available with 0.78.0.

bwoebi avatar Aug 24 '22 16:08 bwoebi