Skip to content

Commit 8f20b9f

Browse files
authored
feat: slim down the zip ddtrace package (#753)
Remove more things from the ddtrace package Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com> simplify appsec removal Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com> Merge branch 'main' into juanjux/remove-ddtrace-stuff simplify appsec removal Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com> Merge branch 'juanjux/remove-ddtrace-stuff' of https://github.com/juanjux/datadog-lambda-python into juanjux/remove-ddtrace-stuff Add more extensions to delete Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com> Merge branch 'main' into juanjux/remove-ddtrace-stuff simplify appsec removal Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com> Merge branch 'juanjux/remove-ddtrace-stuff' of https://github.com/juanjux/datadog-lambda-python into juanjux/remove-ddtrace-stuff Also delete .pyi Signed-off-by: Juanjo Alvarez <juanjo.alvarezmartinez@datadoghq.com> Co-authored-by: juanjo.alvarezmartinez <juanjo.alvarezmartinez@datadoghq.com>
1 parent 91d2486 commit 8f20b9f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ RUN pip install --no-cache-dir . -t ./python/lib/$runtime/site-packages
3333
RUN rm -rf ./python/lib/$runtime/site-packages/botocore*
3434
RUN rm -rf ./python/lib/$runtime/site-packages/setuptools
3535
RUN rm -rf ./python/lib/$runtime/site-packages/jsonschema/tests
36-
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_ast/iastpatch*.so
37-
RUN rm -rf ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/_vendor
38-
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_taint_tracking/*.so
39-
RUN rm -f ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast/_stacktrace*.so
36+
RUN rm -rf ./python/lib/$runtime/site-packages/ddtrace/appsec/_iast
37+
RUN rm -rf ./python/lib/$runtime/site-packages/ddtrace/internal/test_visibility
38+
# Dogshell
39+
RUN rm -rf ./python/lib/$runtime/site-packages/datadog/dogshell
40+
RUN rm -rf ./python/lib/$runtime/site-packages/bin/dog*
41+
4042
# remove *.dist-info directories except any entry_points.txt files and METADATA files required for Appsec Software Composition Analysis
4143
RUN find ./python/lib/$runtime/site-packages/*.dist-info \
4244
-type f \
@@ -50,7 +52,8 @@ RUN rm -rf \
5052
./python/lib/$runtime/site-packages/urllib3* \
5153
./python/lib/$runtime/site-packages/certifi* \
5254
./python/lib/$runtime/site-packages/idna* \
53-
./python/lib/$runtime/site-packages/charset_normalizer*
55+
./python/lib/$runtime/site-packages/charset_normalizer* \
56+
./python/lib/$runtime/site-packages/*__mypyc*.so # from charset_normalizer
5457

5558
# Precompile all .pyc files and remove .py files. This speeds up load time.
5659
# Compile with optimization level 2 (-OO) and PYTHONNODEBUGRANGES=1 to redtce
@@ -73,6 +76,7 @@ RUN find ./python/lib/$runtime/site-packages/ddtrace -name \*.cc -delete
7376
RUN find ./python/lib/$runtime/site-packages/ddtrace -name \*.h -delete
7477
RUN find ./python/lib/$runtime/site-packages/ddtrace -name \*.hpp -delete
7578
RUN find ./python/lib/$runtime/site-packages/ddtrace -name \*.pyx -delete
79+
RUN find ./python/lib/$runtime/site-packages/ddtrace -name \*.pyi -delete
7680

7781
# Strip debug symbols and symbols that are not needed for relocation
7882
# processing using strip --strip-unneeded for all .so files. This is to

0 commit comments

Comments
 (0)