Skip to content

Commit 7e1fa70

Browse files
authored
feat: Reduce size limits, remove experimental ddtrace bins (#445)
* feat: Reduce size limits, strip unused ddtrace bins * feat: 13m? * feat: Lower zipped * feat: 4mb zipped then * feat: remove urllib3
1 parent 20a2e4e commit 7e1fa70

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ RUN pip install . -t ./python/lib/$runtime/site-packages
1414
# Remove *.pyc files
1515
RUN find ./python/lib/$runtime/site-packages -name \*.pyc -delete
1616

17-
# Strip symbols from ddtrace's binaries.
18-
# TODO (AJ): remove when ddtrace fixes this upstream
19-
RUN find . -name '*.so' -exec strip -g {} \;
20-
2117
# Remove botocore (40MB) to reduce package size. aws-xray-sdk
2218
# installs it, while it's already provided by the Lambda Runtime.
2319
RUN rm -rf ./python/lib/$runtime/site-packages/botocore*
2420
RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
2521
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests
2622
RUN find . -name 'libddwaf.so' -delete
23+
RUN rm -rf ./python/lib/$runtime/site-packages/urllib3
2724
RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so
2825
RUN rm ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
26+
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/libdd_wrapper.so
27+
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/ddup/_ddup.*.so
28+
RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/stack_v2/_stack_v2.*.so
2929

3030
FROM scratch
3131
COPY --from=builder /build/python /

scripts/check_layer_size.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
# 7 mb size limit
1111
set -e
12-
MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 7 \* 1024)
13-
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 24 \* 1024)
12+
MAX_LAYER_COMPRESSED_SIZE_KB=$(expr 4 \* 1024)
13+
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(expr 13 \* 1024)
1414

1515

1616
LAYER_FILES_PREFIX="datadog_lambda_py"

0 commit comments

Comments
 (0)