Skip to content

Commit 1c39ec9

Browse files
committed
Add lambda-proxy to build image job
1 parent f900dbc commit 1c39ec9

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }}
9292
build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }}
9393
build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }}
94+
build_lambda_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-lambda-proxy-image') }}
9495
build_lib_injection_app_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-lib-injection-app-images') }}
9596
parametric_job_count: ${{ matrix.version == 'dev' && 2 || 1 }} # test both use cases
9697
skip_empty_scenarios: true

.github/workflows/run-end-to-end.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ on:
4949
default: false
5050
required: false
5151
type: boolean
52+
build_lambda_proxy_image:
53+
description: "Shall we build lambda proxy image"
54+
default: false
55+
required: false
56+
type: boolean
5257
push_to_feature_parity_dashbaord:
5358
description: "Shall we push results to Feature Parity Dashbaord"
5459
default: false
@@ -104,6 +109,9 @@ jobs:
104109
- name: Build proxy image
105110
if: inputs.build_proxy_image
106111
run: ./build.sh -i proxy
112+
- name: Build lambda proxy image
113+
if: inputs.build_lambda_proxy_image
114+
run: ./build.sh -i lambda-proxy
107115
- name: Pull images
108116
uses: ./.github/actions/pull_images
109117
with:

.github/workflows/system-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ on:
5454
default: false
5555
required: false
5656
type: boolean
57+
build_lambda_proxy_image:
58+
description: "Shall we build lambda proxy image"
59+
default: false
60+
required: false
61+
type: boolean
5762
build_lib_injection_app_images:
5863
description: "Shall we build and push k8s lib injection weblog images"
5964
default: false
@@ -204,6 +209,7 @@ jobs:
204209
scenarios: ${{ toJson(matrix.job.scenarios) }}
205210
build_buddies_images: ${{ inputs.build_buddies_images }}
206211
build_proxy_image: ${{ inputs.build_proxy_image }}
212+
build_lambda_proxy_image: ${{ inputs.build_lambda_proxy_image }}
207213
binaries_artifact: binaries_${{ needs.compute_parameters.outputs.ci_environment }}_${{ inputs.library }}_${{ matrix.job.weblog }}_${{ needs.compute_parameters.outputs.unique_id }}
208214
ci_environment: ${{ needs.compute_parameters.outputs.ci_environment }}
209215
skip_empty_scenarios: ${{ inputs.skip_empty_scenarios }}

utils/build/docker/python/build_lambda_layer.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@ fi
2929
if [[ $SKIP_BUILD -eq 0 ]]; then
3030
if [ -e "dd-trace-py" ]; then
3131
echo "Install from local folder /binaries/dd-trace-py"
32-
sed -i '' 's|^ddtrace =.*$|ddtrace = { path = "./dd-trace-py" }|' datadog-lambda-python/pyproject.toml
32+
if [[ "$OSTYPE" == "darwin"* ]]; then
33+
sed -i '' 's|^ddtrace =.*$|ddtrace = { path = "./dd-trace-py" }|' datadog-lambda-python/pyproject.toml
34+
else
35+
sed -i 's|^ddtrace =.*$|ddtrace = { path = "./dd-trace-py" }|' datadog-lambda-python/pyproject.toml
36+
fi
3337
cp -r dd-trace-py datadog-lambda-python/dd-trace-py
3438
elif [ "$(find . -maxdepth 1 -name "*.whl" | wc -l)" = "1" ]; then
3539
path=$(readlink -f "$(find . -maxdepth 1 -name "*.whl")")
3640
echo "Install ddtrace from ${path}"
37-
sed -i '' "s|^ddtrace =.*$|ddtrace = { path = \"file://${path}\" }|" datadog-lambda-python/pyproject.toml
41+
if [[ "$OSTYPE" == "darwin"* ]]; then
42+
sed -i '' "s|^ddtrace =.*$|ddtrace = { path = \"file://${path}\" }|" datadog-lambda-python/pyproject.toml
43+
else
44+
sed -i "s|^ddtrace =.*$|ddtrace = { path = \"file://${path}\" }|" datadog-lambda-python/pyproject.toml
45+
fi
3846
cp -r ./*.whl datadog-lambda-python/
3947
elif [ "$(find . -maxdepth 1 -name "python-load-from-pip" | wc -l)" = "1" ]; then
4048
echo "Install ddtrace from $(cat python-load-from-pip)"
@@ -44,11 +52,19 @@ if [[ $SKIP_BUILD -eq 0 ]]; then
4452
# Format with revision: ddtrace @ git+https://...@revision
4553
git_url="${BASH_REMATCH[1]}"
4654
git_rev="${BASH_REMATCH[2]}"
47-
sed -i '' "s|^ddtrace =.*$|ddtrace = { git = \"${git_url}\", rev = \"${git_rev}\" }|" datadog-lambda-python/pyproject.toml
55+
if [[ "$OSTYPE" == "darwin"* ]]; then
56+
sed -i '' "s|^ddtrace =.*$|ddtrace = { git = \"${git_url}\", rev = \"${git_rev}\" }|" datadog-lambda-python/pyproject.toml
57+
else
58+
sed -i "s|^ddtrace =.*$|ddtrace = { git = \"${git_url}\", rev = \"${git_rev}\" }|" datadog-lambda-python/pyproject.toml
59+
fi
4860
elif [[ $pip_spec =~ ddtrace\ @\ git\+(.*)$ ]]; then
4961
# Format without revision: ddtrace @ git+https://... (defaults to main)
5062
git_url="${BASH_REMATCH[1]}"
51-
sed -i '' "s|^ddtrace =.*$|ddtrace = { git = \"${git_url}\" }|" datadog-lambda-python/pyproject.toml
63+
if [[ "$OSTYPE" == "darwin"* ]]; then
64+
sed -i '' "s|^ddtrace =.*$|ddtrace = { git = \"${git_url}\" }|" datadog-lambda-python/pyproject.toml
65+
else
66+
sed -i "s|^ddtrace =.*$|ddtrace = { git = \"${git_url}\" }|" datadog-lambda-python/pyproject.toml
67+
fi
5268
else
5369
echo "ERROR: Unable to parse git URL from python-load-from-pip format: $pip_spec"
5470
exit 1

0 commit comments

Comments
 (0)