-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distribution packaging continued (#135)
Continues #133 This now puts all required distributions under `.artifacts/elastic-distribution`. This includes `elastic-*.zip` versions of the auto instrumentation zips. These zips include * our plugin dll (twice for -windows.zip). * `_instrument.sh` a copy of the original `instrument.sh` * `instrument.sh` which sets our plugin var and calls `_instrument.sh` This also includes elastic versions of the installation bash script and the powershell module to instrument and install/update on windows. These files should now upload as part of our release and uploaded as artifacts on each commit in main. Locally to build the distributables call: ``` ./build.sh redistribute ```` To validate the distribution there is now a new dockerfile that validates our install and instrumentation scripts: ```bash docker build -t distribution.autoinstrumentation:latest -f examples/Example.AutoInstrumentation/distribution.Dockerfile . && \ docker run -it --rm -p 5000:8080 --name distri --platform linux/arm64 distribution.autoinstrumentation:latest ``` The latter will also form the basis for more integration tests which i'll follow up with
- Loading branch information
Showing
11 changed files
with
332 additions
and
34 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
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
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,74 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# guess OS_TYPE if not provided | ||
if [ -z "$OS_TYPE" ]; then | ||
case "$(uname -s | tr '[:upper:]' '[:lower:]')" in | ||
cygwin_nt*|mingw*|msys_nt*) | ||
OS_TYPE="windows" | ||
;; | ||
linux*) | ||
if [ "$(ldd /bin/ls | grep -m1 'musl')" ]; then | ||
OS_TYPE="linux-musl" | ||
else | ||
OS_TYPE="linux-glibc" | ||
fi | ||
;; | ||
darwin*) | ||
OS_TYPE="macos" | ||
;; | ||
esac | ||
fi | ||
|
||
case "$OS_TYPE" in | ||
"linux-glibc"|"linux-musl"|"macos"|"windows") | ||
;; | ||
*) | ||
echo "Set the operating system type using the OS_TYPE environment variable. Supported values: linux-glibc, linux-musl, macos, windows." >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# guess OS architecture if not provided | ||
if [ -z "$ARCHITECTURE" ]; then | ||
case $(uname -m) in | ||
x86_64) ARCHITECTURE="x64" ;; | ||
aarch64) ARCHITECTURE="arm64" ;; | ||
esac | ||
fi | ||
|
||
case "$ARCHITECTURE" in | ||
"x64"|"arm64") | ||
;; | ||
*) | ||
echo "Set the architecture type using the ARCHITECTURE environment variable. Supported values: x64, arm64." >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
test -z "$OTEL_DOTNET_AUTO_HOME" && OTEL_DOTNET_AUTO_HOME="$HOME/.otel-dotnet-auto" | ||
test -z "$VERSION" && VERSION="v1.7.0" | ||
|
||
DOWNLOAD_DIR="${DOWNLOAD_DIR:=${TMPDIR:=$(mktemp -d)}}" | ||
|
||
RELEASES_URL="https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases" | ||
ARCHIVE="opentelemetry-dotnet-instrumentation-$OS_TYPE.zip" | ||
|
||
# In case of Linux, use architecture in the download path | ||
if echo "$OS_TYPE" | grep -q "linux"; then | ||
ARCHIVE="opentelemetry-dotnet-instrumentation-$OS_TYPE-$ARCHITECTURE.zip" | ||
fi | ||
|
||
LOCAL_PATH="${LOCAL_PATH:=$DOWNLOAD_DIR/$ARCHIVE}" | ||
if [ ! -f "${LOCAL_PATH}" ]; then | ||
( | ||
cd "$DOWNLOAD_DIR" | ||
echo "Downloading $VERSION for $OS_TYPE ($LOCAL_PATH)..." | ||
curl -sSfLo "$LOCAL_PATH" "$RELEASES_URL/download/$VERSION/$ARCHIVE" | ||
) | ||
else | ||
echo "Using local installation archive: $LOCAL_PATH" | ||
fi | ||
|
||
rm -rf "$OTEL_DOTNET_AUTO_HOME" | ||
unzip -q "$LOCAL_PATH" -d "$OTEL_DOTNET_AUTO_HOME" |
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
Oops, something went wrong.