Code Monkey home page Code Monkey logo

Comments (4)

bwoebi avatar bwoebi commented on July 21, 2024 1

Hey @brandonburkett,

We've decided to keep full debug symbols of the rust code to enhance debuggability in case there are issues. However, this comes, as you noticed at the cost of a size increase.

To avoid the particular issue with /tmp space being exceeded, you can specify a different temp directory: php -d sys_temp_dir=/other/path datadog-setup.php --php-bin=all.

I'll keep this issue open so that we invest into splitting the .tar.gz up or using other strategies.

from dd-trace-php.

morrisonlevi avatar morrisonlevi commented on July 21, 2024

I slightly improved the situation in v1.1.0. Here are the sizes for the aarch64-linux-gnu artifacts over time, but there are similarly sized improvements for x86_64-linux-gnu:

dd-library-php-0.98.0-aarch64-linux-gnu.tar.gz  482 MB
dd-library-php-0.99.0-aarch64-linux-gnu.tar.gz  485 MB
dd-library-php-1.0.0-aarch64-linux-gnu.tar.gz   495 MB

dd-library-php-1.1.0-aarch64-linux-gnu.tar.gz   425 MB

It's still over 400 MiB, so we plan to continue working on this.

from dd-trace-php.

awons avatar awons commented on July 21, 2024

We worked around it by copying only the necessary files and using them in our final Docker image with this script:

cd $(mktemp -d)
curl -Lo datadog-php-tracer.apk https://github.com/DataDog/dd-trace-php/releases/download/${DATADOG_TRACER_VERSION}/datadog-php-tracer_${DATADOG_TRACER_VERSION}_$(uname -m).apk
apk add datadog-php-tracer.apk --allow-untrusted
PHP_API=$(php -i | grep "PHP API" | awk '{split($0,a,"=>"); print a[2]}' | xargs)
DD_TRACER_EXTENSION="/opt/datadog-php/extensions/ddtrace-${PHP_API}-alpine.so"
for filename in /opt/datadog-php/extensions/*; do
  [ -e "${filename}" ] || continue
  if [ "${filename}" = "${DD_TRACER_EXTENSION}" ]; then continue; fi
  rm -f "${filename}"
done

mkdir /tmp/ddtracer
for filename in $(apk info -L datadog-php-tracer); do
  [ -e "/${filename}" ] || continue
  cp -p --parents "/${filename}" /tmp/ddtracer
done
cp -p --parents /usr/local/etc/php/conf.d/98-ddtrace.ini /tmp/ddtracer

We use in combination with COPY --from=ddtracer /tmp/ddtracer / but this could easily be adapted for use cases outside of Docker environment.

Our images are down to <70MB.

from dd-trace-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.