Skip to content

Commit

Permalink
Add php kubernetes lib injection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
randomanderson committed Sep 25, 2024
1 parent cfc7637 commit 4ab45b4
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-lib-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
"golang": [],
"java": [{"name":"dd-lib-java-init-test-app","supported":"true"},{"name":"jdk7-app","supported":"false"}],
"nodejs": [{"name":"sample-app","supported":"true"},{"name":"sample-app-node13","supported":"false"}],
"php": [],
"php": [{"name":"dd-lib-php-init-test-83","supported":"true"},{"name":"dd-lib-php-init-test-alpine","supported":"true"}],
"python": [{"name":"dd-lib-python-init-test-django","supported":"true"}, {"name":"dd-lib-python-init-test-django-gunicorn", "supported":"true"}, {"name":"dd-lib-python-init-test-django-uvicorn","supported":"true"}],
"ruby": [{"name":"dd-lib-ruby-init-test-rails","supported":"true"}, {"name":"dd-lib-ruby-init-test-rails-explicit","supported":"true"}, {"name":"dd-lib-ruby-init-test-rails-gemsrb","supported":"true"}]
}
Expand All @@ -53,7 +53,7 @@ jobs:
"golang": [],
"java": ["gcr.io/datadoghq/dd-lib-java-init:latest"],
"nodejs": ["gcr.io/datadoghq/dd-lib-js-init:latest"],
"php": [],
"php": ["gcr.io/datadoghq/dd-lib-php-init:latest"],
"python": ["gcr.io/datadoghq/dd-lib-python-init:latest"],
"ruby": ["gcr.io/datadoghq/dd-lib-ruby-init:latest"],
}
Expand All @@ -64,7 +64,7 @@ jobs:
"golang": [],
"java": ["ghcr.io/datadog/dd-trace-java/dd-lib-java-init:latest_snapshot"],
"nodejs": ["ghcr.io/datadog/dd-trace-js/dd-lib-js-init:latest_snapshot"],
"php": [],
"php": ["ghcr.io/datadog/dd-trace-php/dd-lib-php-init:latest_snapshot"],
"python": ["ghcr.io/datadog/dd-trace-py/dd-lib-python-init:latest_snapshot"],
"ruby": ["ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:latest_snapshot"],
}
Expand Down
2 changes: 2 additions & 0 deletions lib-injection/build/build_lib_injection_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ variants=(["dd-lib-dotnet-init-test-app"]="dotnet"
["dd-lib-ruby-init-test-rails-explicit"]="ruby"
["dd-lib-ruby-init-test-rails-gemsrb"]="ruby"
["dd-lib-java-init-test-app"]="java"
["dd-lib-php-init-test-83"]="php"
["dd-lib-php-init-test-alpine"]="php"
)
docker buildx create --name multiarch --driver docker-container --use

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM public.ecr.aws/docker/library/php:8.3

RUN mkdir /app
WORKDIR /app

COPY index.php /app

CMD ["php", "-S", "0.0.0.0:18080"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ -z "${BUILDX_PLATFORMS}" ] ; then
BUILDX_PLATFORMS=`docker buildx imagetools inspect --raw python:3.12 | jq -r 'reduce (.manifests[] | [ .platform.os, .platform.architecture, .platform.variant ] | join("/") | sub("\\/$"; "")) as $item (""; . + "," + $item)' | sed 's/,//'`
fi
echo "Build for platforms: ${BUILDX_PLATFORMS}"
docker buildx build --platform ${BUILDX_PLATFORMS} --tag ${LIBRARY_INJECTION_TEST_APP_IMAGE} --push .
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

echo 'Hello!';
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM public.ecr.aws/docker/library/alpine:3.20

RUN apk add --update php83 libgcc libcurl bash

RUN mkdir /app
WORKDIR /app

COPY index.php /app

ENV DD_TRACE_DEBUG 1

CMD ["php","-S","0.0.0.0:18080"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ -z "${BUILDX_PLATFORMS}" ] ; then
BUILDX_PLATFORMS=`docker buildx imagetools inspect --raw python:3.12 | jq -r 'reduce (.manifests[] | [ .platform.os, .platform.architecture, .platform.variant ] | join("/") | sub("\\/$"; "")) as $item (""; . + "," + $item)' | sed 's/,//'`
fi
echo "Build for platforms: ${BUILDX_PLATFORMS}"
docker buildx build --platform ${BUILDX_PLATFORMS} --tag ${LIBRARY_INJECTION_TEST_APP_IMAGE} --push .
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

echo 'Hello!';

0 comments on commit 4ab45b4

Please sign in to comment.