forked from open-telemetry/opentelemetry-lambda
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract python building to a bash script
- Loading branch information
1 parent
535cab5
commit 00eb5b7
Showing
2 changed files
with
40 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "${OPENTELEMETRY_PYTHON_CONTRIB_PATH:-}" ]; then | ||
echo "OPENTELEMETRY_PYTHON_CONTRIB_PATH is not set" | ||
exit 1 | ||
fi | ||
OPENTELEMETRY_PYTHON_CONTRIB_PATH=$(realpath $OPENTELEMETRY_PYTHON_CONTRIB_PATH) | ||
|
||
CWD=$(pwd) | ||
|
||
echo OPENTELEMETRY_PYTHON_CONTRIB_PATH=$OPENTELEMETRY_PYTHON_CONTRIB_PATH | ||
echo CWD=$CWD | ||
|
||
# Build build opentelemetry-instrumentation-aws-lambda | ||
pushd ./python/sample-apps/otel | ||
pip3 wheel -e $OPENTELEMETRY_PYTHON_CONTRIB_PATH/instrumentation/opentelemetry-instrumentation-aws-lambda | ||
pip3 wheel -e $OPENTELEMETRY_PYTHON_CONTRIB_PATH/instrumentation/opentelemetry-instrumentation-botocore | ||
mkdir -p ./build | ||
python3 -m pip install -r ./otel_sdk/requirements.txt -t ./build/python | ||
python3 -m pip install -r ./otel_sdk/requirements-nodeps.txt -t ./build/tmp --no-deps | ||
cp -r ./build/tmp/* ./build/python/ | ||
rm -rf ./build/tmp | ||
cp ./otel_sdk/otel-instrument ./build/otel-instrument | ||
chmod 755 ./build/otel-instrument | ||
cp ./otel_sdk/otel-instrument ./build/otel-handler | ||
chmod 755 ./build/otel-handler | ||
cp ./otel_sdk/otel_wrapper.py ./build/python/ | ||
rm -rf ./build/python/boto* | ||
rm -rf ./build/python/urllib3* | ||
popd > /dev/null | ||
|
||
pushd ./python/sample-apps/otel/build | ||
zip -r layer.zip * | ||
popd > /dev/null |