dd-trace-php
dd-trace-php copied to clipboard
[Feature] Support arm architecture
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
Hey @jippi, we are looking into arm builds but unfortunately, at the moment, I cannot share a precise ETA for it.
@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
We need this too. Is there any long-shot alternative at the present date?
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.
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
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 :-)
Any news on that feature? A lot of devs now switch to M1 Macs
We also use Mac M1 (ARM) and ARM based infrastructure on AWS.
Do Datadog has a roadmap for this support ?
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...)
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
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.
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
We would absolutely love php 8.0 / arm64 support!
Another vote for PHP 8.1 and ARM64 support.
+1 for arm support
+1 for arm support
+1 for arm support
+1 for arm support (cant use datadog without it)
@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 :(
Seem to be some work going on here https://github.com/DataDog/dd-trace-php/tree/labbati/arm
yes but nothing has happened since 23 June, I've been monitoring the commits on his tree since march :p
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.
This is very, very exciting!
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!
Another bump for arm64 and php 8.1 support please, would be awesome !
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.
Arm64 releases are now available with 0.78.0.