-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add OCI packaging (#8932)
We are shifting over to using OCI packaging rather than system packaging. Unlike the existing deb/rpm builds we package only the relevant arch binaries in the package to reduce the final installation size on the system. Once validated and released we will remove the similar deb/rpm packaging. This packaging has been tested in DataDog/auto_inject#185 where we pull in v2.8.2 of the library and inject it into a basic Python app and validate that traces are submitted. The job will run as part of the existing deb/rpm jobs done as part of the release process. No new manual steps are introduced to the release to build and deploy these images.
- Loading branch information
1 parent
1ca90d5
commit fcfe10c
Showing
2 changed files
with
72 additions
and
0 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,55 @@ | ||
#!/bin/bash | ||
|
||
source common_build_functions.sh | ||
|
||
if [ -n "$CI_COMMIT_TAG" ] && [ -z "$PYTHON_PACKAGE_VERSION" ]; then | ||
PYTHON_PACKAGE_VERSION=${CI_COMMIT_TAG##v} | ||
fi | ||
|
||
if [ -z "$ARCH" ]; then | ||
ARCH=amd64 | ||
fi | ||
|
||
|
||
TMP_DIR=$(mktemp --dir) | ||
BUILD_DIR=$TMP_DIR/datadog-python-apm.build | ||
mkdir $TMP_DIR/datadog-python-apm.build | ||
|
||
# Install known compatible pip as default version shipped in Ubuntu (20.0.2) | ||
# does not work. | ||
python3 -m pip install -U "pip>=22.0" | ||
python3 -m pip install packaging | ||
|
||
WHEEL_ARCH="x86_64" | ||
if [ "$ARCH" = "arm64" ]; then | ||
WHEEL_ARCH="aarch64" | ||
fi | ||
|
||
../lib-injection/dl_wheels.py \ | ||
--python-version=3.12 \ | ||
--python-version=3.11 \ | ||
--python-version=3.10 \ | ||
--python-version=3.9 \ | ||
--python-version=3.8 \ | ||
--python-version=3.7 \ | ||
--ddtrace-version=$PYTHON_PACKAGE_VERSION \ | ||
--arch=$WHEEL_ARCH \ | ||
--platform=musllinux_1_1 \ | ||
--platform=manylinux2014 \ | ||
--output-dir=$BUILD_DIR/ddtrace_pkgs \ | ||
--verbose | ||
echo -n $PYTHON_PACKAGE_VERSION > auto_inject-python.version | ||
cp ../lib-injection/sitecustomize.py $BUILD_DIR/ | ||
cp auto_inject-python.version $BUILD_DIR/version | ||
chmod -R o-w $BUILD_DIR | ||
chmod -R g-w $BUILD_DIR | ||
|
||
# Build packages | ||
datadog-package create \ | ||
--version="$PYTHON_PACKAGE_VERSION" \ | ||
--package="datadog-apm-library-python" \ | ||
--archive=true \ | ||
--archive-path="datadog-apm-library-python-$PYTHON_PACKAGE_VERSION-$ARCH.tar" \ | ||
--arch "$ARCH" \ | ||
--os "linux" \ | ||
$BUILD_DIR |