Skip to content

Commit

Permalink
Merge branch 'main' into gnufede/add-ci-step-to-notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon committed Jun 12, 2024
2 parents 0def3eb + ab58ce4 commit c27729e
Show file tree
Hide file tree
Showing 132 changed files with 4,549 additions and 605 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ddtrace/internal/codeowners.py @DataDog/apm-core-python @datadog/ci-app-lib
ddtrace/internal/coverage @DataDog/apm-core-python @datadog/ci-app-libraries @Datadog/debugger-python
tests/internal/test_codeowners.py @datadog/ci-app-libraries
tests/ci_visibility @DataDog/ci-app-libraries
tests/coverage @DataDog/apm-core-python @DataDog/ci-app-libraries @Datadog/debugger-python
tests/tracer/test_ci.py @DataDog/ci-app-libraries
ddtrace/ext/git.py @DataDog/ci-app-libraries @DataDog/apm-core-python

Expand Down Expand Up @@ -88,11 +89,13 @@ ddtrace/llmobs/ @DataDog/ml-observability
ddtrace/contrib/openai @DataDog/ml-observability
ddtrace/contrib/langchain @DataDog/ml-observability
ddtrace/contrib/botocore/services/bedrock.py @DataDog/ml-observability
ddtrace/contrib/anthropic @DataDog/ml-observability
tests/llmobs @DataDog/ml-observability
tests/contrib/openai @DataDog/ml-observability
tests/contrib/langchain @DataDog/ml-observability
tests/contrib/botocore/test_bedrock.py @DataDog/ml-observability
tests/contrib/botocore/bedrock_cassettes @DataDog/ml-observability
tests/contrib/anthropic @DataDog/ml-observability

# Remote Config
ddtrace/internal/remoteconfig @DataDog/remote-config @DataDog/apm-core-python
Expand Down
59 changes: 55 additions & 4 deletions .github/workflows/lib-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
repository: 'DataDog/system-tests'

- name: Install runner
uses: ./.github/actions/install_runner
uses: ./.github/actions/install_runner

- name: Run K8s Lib Injection Tests
run: ./run.sh K8S_LIB_INJECTION_BASIC
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
'dd-lib-python-init-test-django-uvicorn',
'dd-lib-python-init-test-django-no-perms',
'dd-lib-python-init-test-django-pre-installed',
'dd-lib-python-init-test-django-unsupported-python',
'dd-lib-python-init-test-django-unsupported-package-force',
]
fail-fast: false
steps:
Expand Down Expand Up @@ -115,13 +115,64 @@ jobs:
run: |
curl http://localhost:18080
sleep 1 # wait for traces to be sent
- name: Check mocked telemetry
run: |
cd lib-injection
docker exec lib-injection-app_local-1 sh -c "cd .. && [ ! -f src/validate_telemetry.py ] || cat src/mock-telemetry.out | python src/validate_telemetry.py"
- name: Print traces
run: curl http://localhost:8126/test/traces
- name: Check test agent received a trace
run: |
N=$(curl http://localhost:8126/test/traces | jq -r -e 'length')
[[ $N == "1" ]]
- name: Output app logs (LOOK HERE IF THE JOB FAILS)
if: success() || failure()
test_unit_no_instrumentation:
runs-on: ubuntu-latest
strategy:
matrix:
variant: [
'dd-lib-python-init-test-django-unsupported-python',
'dd-lib-python-init-test-django-unsupported-package',
]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Build and run the app
run: |
SRC="$(pwd)"
cd lib-injection
export DDTRACE_PYTHON_VERSION="v2.6.3"
export APP_CONTEXT="${SRC}/tests/lib-injection/${{matrix.variant}}"
export TEMP_DIR="${SRC}/tmp/ddtrace"
mkdir -p "${TEMP_DIR}"
# Give the temp dir permissions, by default the docker user doesn't have permissions
# to write to the filesystem.
chmod 777 $TEMP_DIR
# Start the lib_inject to get the files copied. This avoids a race condition with the startup of the
# application.
docker compose up --build lib_inject
docker compose up --build -d
# Wait for the app to start
sleep 60
docker compose logs
- name: Check Permissions on ddtrace pkgs
run: |
cd lib-injection
# Ensure /datadog-lib/ddtrace_pkgs is a valid directory that is not empty
docker compose run lib_inject find /datadog-init/ddtrace_pkgs -maxdepth 0 -empty | wc -l && if [ $? -ne 0 ]; then exit 1; fi
# Ensure files are not world writeable
docker compose run lib_inject find /datadog-init/ddtrace_pkgs ! -perm /o+w | wc -l && if [ $? -ne 0 ]; then exit 1; fi
# Ensure all users have read and execute permissions to files stored in /datadog-lib/ddtrace_pkgs
docker compose run lib_inject find /datadog-init/ddtrace_pkgs ! -perm u=rwx,o=rx | wc -l && if [ $? -ne 0 ]; then exit 1; fi
- name: Test the app
run: |
curl http://localhost:18080
sleep 1 # wait for traces to be sent
- name: Check mocked telemetry
run: |
cd lib-injection
docker exec lib-injection-app_local-1 sh -c "cd .. && [ ! -f src/validate_telemetry.py ] || cat src/mock-telemetry.out | python src/validate_telemetry.py"
- name: Check test agent received no trace
run: |
N=$(curl http://localhost:8126/test/traces | jq -r -e 'length')
[[ $N == "0" ]]
2 changes: 2 additions & 0 deletions .gitlab/build-oci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ fi
echo -n $PYTHON_PACKAGE_VERSION > auto_inject-python.version
cp ../lib-injection/sitecustomize.py $BUILD_DIR/
cp auto_inject-python.version $BUILD_DIR/version
cp ../min_compatible_versions.csv $BUILD_DIR/
cp ../lib-injection/telemetry-forwarder.sh $BUILD_DIR/
chmod -R o-w $BUILD_DIR
chmod -R g-w $BUILD_DIR

Expand Down
34 changes: 34 additions & 0 deletions .riot/requirements/13f2bea.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/13f2bea.in
#
astunparse==1.6.3
attrs==23.2.0
blinker==1.8.2
certifi==2024.6.2
charset-normalizer==3.3.2
click==8.1.7
coverage[toml]==7.5.3
flask==3.0.3
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
itsdangerous==2.2.0
jinja2==3.1.4
markupsafe==2.1.5
mock==5.1.0
opentracing==2.4.0
packaging==24.0
pluggy==1.5.0
pytest==8.2.2
pytest-cov==5.0.0
pytest-mock==3.14.0
requests==2.32.3
six==1.16.0
sortedcontainers==2.4.0
urllib3==2.2.1
virtualenv-clone==0.5.7
werkzeug==3.0.3
wheel==0.43.0
30 changes: 0 additions & 30 deletions .riot/requirements/181d5c9.txt

This file was deleted.

6 changes: 3 additions & 3 deletions .riot/requirements/18695ab.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#
astunparse==1.6.3
attrs==23.2.0
certifi==2024.2.2
certifi==2024.6.2
cffi==1.15.1
charset-normalizer==3.3.2
coverage[toml]==7.2.7
cryptography==42.0.5
cryptography==42.0.7
exceptiongroup==1.2.1
googleapis-common-protos==1.63.0
googleapis-common-protos==1.63.1
greenlet==3.0.3
grpcio==1.62.2
hypothesis==6.45.0
Expand Down
18 changes: 9 additions & 9 deletions .riot/requirements/1aedbda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
#
astunparse==1.6.3
attrs==23.2.0
certifi==2024.2.2
certifi==2024.6.2
cffi==1.16.0
charset-normalizer==3.3.2
coverage[toml]==7.5.0
cryptography==42.0.5
coverage[toml]==7.5.3
cryptography==42.0.7
exceptiongroup==1.2.1
googleapis-common-protos==1.63.0
googleapis-common-protos==1.63.1
greenlet==3.0.3
grpcio==1.63.0
grpcio==1.64.1
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==24.0
pluggy==1.5.0
protobuf==4.25.3
protobuf==5.27.0
psycopg2-binary==2.9.9
pycparser==2.22
pycryptodome==3.20.0
pytest==8.2.0
pytest==8.2.2
pytest-cov==5.0.0
pytest-mock==3.14.0
requests==2.31.0
requests==2.32.3
simplejson==3.19.2
six==1.16.0
sortedcontainers==2.4.0
sqlalchemy==2.0.22
tomli==2.0.1
typing-extensions==4.11.0
typing-extensions==4.12.1
urllib3==2.2.1
wheel==0.43.0
34 changes: 0 additions & 34 deletions .riot/requirements/1b13449.txt

This file was deleted.

38 changes: 38 additions & 0 deletions .riot/requirements/1cc4eb6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/1cc4eb6.in
#
astunparse==1.6.3
attrs==23.2.0
blinker==1.8.2
certifi==2024.6.2
charset-normalizer==3.3.2
click==8.1.7
coverage[toml]==7.5.3
exceptiongroup==1.2.1
flask==3.0.3
hypothesis==6.45.0
idna==3.7
importlib-metadata==7.1.0
iniconfig==2.0.0
itsdangerous==2.2.0
jinja2==3.1.4
markupsafe==2.1.5
mock==5.1.0
opentracing==2.4.0
packaging==24.0
pluggy==1.5.0
pytest==8.2.2
pytest-cov==5.0.0
pytest-mock==3.14.0
requests==2.32.3
six==1.16.0
sortedcontainers==2.4.0
tomli==2.0.1
urllib3==2.2.1
virtualenv-clone==0.5.7
werkzeug==3.0.3
wheel==0.43.0
zipp==3.19.1
32 changes: 0 additions & 32 deletions .riot/requirements/1e69c0e.txt

This file was deleted.

38 changes: 38 additions & 0 deletions .riot/requirements/1ef581b.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1ef581b.in
#
astunparse==1.6.3
attrs==23.2.0
blinker==1.8.2
certifi==2024.6.2
charset-normalizer==3.3.2
click==8.1.7
coverage[toml]==7.5.3
exceptiongroup==1.2.1
flask==3.0.3
hypothesis==6.45.0
idna==3.7
importlib-metadata==7.1.0
iniconfig==2.0.0
itsdangerous==2.2.0
jinja2==3.1.4
markupsafe==2.1.5
mock==5.1.0
opentracing==2.4.0
packaging==24.0
pluggy==1.5.0
pytest==8.2.2
pytest-cov==5.0.0
pytest-mock==3.14.0
requests==2.32.3
six==1.16.0
sortedcontainers==2.4.0
tomli==2.0.1
urllib3==2.2.1
virtualenv-clone==0.5.7
werkzeug==3.0.3
wheel==0.43.0
zipp==3.19.1
Loading

0 comments on commit c27729e

Please sign in to comment.