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

feat: Reduce size limits, remove experimental ddtrace bins #445

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ RUN pip install . -t ./python/lib/$runtime/site-packages
# Remove *.pyc files
RUN find ./python/lib/$runtime/site-packages -name \*.pyc -delete

# Strip symbols from ddtrace's binaries.
# TODO (AJ): remove when ddtrace fixes this upstream
RUN find . -name '*.so' -exec strip -g {} \;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this now happens in ddtrace


# Remove botocore (40MB) to reduce package size. aws-xray-sdk
# installs it, while it's already provided by the Lambda Runtime.
RUN rm -rf ./python/lib/$runtime/site-packages/botocore*
RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests
RUN find . -name 'libddwaf.so' -delete
RUN rm -rf ./python/lib/$runtime/site-packages/urllib3
RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so
RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/libdd_wrapper.so
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/ddup/_ddup.*.so
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so

FROM scratch
COPY --from=builder /build/python /
4 changes: 2 additions & 2 deletions scripts/check_layer_size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# 7 mb size limit
set -e
MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 7 \* 1024)
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 24 \* 1024)
MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 4 \* 1024)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Baller

MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 13 \* 1024)


LAYER_FILES_PREFIX="datadog_lambda_py"
Expand Down