Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM64 Support #3277

Merged
merged 49 commits into from Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
32be8e8
arm64 initial commit
RassK Feb 16, 2024
d7a5509
Fix conditional
RassK Feb 16, 2024
b4cb346
Update build workflow
RassK Feb 16, 2024
e2761a7
Merge branch 'main' into arm64
RassK Feb 16, 2024
aee061b
reorganize build.yml
RassK Feb 16, 2024
c686a5f
Fix arm64 setup
RassK Feb 16, 2024
0cb1c0d
fix rights
RassK Feb 16, 2024
c885f1d
update test build
RassK Feb 16, 2024
7126d1b
Update ci.yml
RassK Feb 16, 2024
01c4a33
Add native dependencies setup for tests
RassK Feb 16, 2024
827a169
update distribution tests for linux
RassK Feb 16, 2024
fcb26ba
update alpine linux distribution tests
RassK Feb 16, 2024
3f875a0
fix wrong platform for arm
RassK Feb 16, 2024
d315da4
change current architecture as default platform
RassK Feb 16, 2024
4e04596
format fix ordering
RassK Feb 16, 2024
9ab83a7
fix native profiler dir name
RassK Feb 17, 2024
052c10a
use OS specific RID if alpine for EF tests
RassK Feb 19, 2024
16a7838
Revert "use OS specific RID if alpine for EF tests"
RassK Feb 19, 2024
bf08ac9
Narrow output platforms for AdditionalDeps
RassK Feb 19, 2024
e1338ce
fix store output platforms
RassK Feb 19, 2024
f60c1c5
Merge branch 'main' into arm64
RassK Feb 19, 2024
12d6f3c
fix distribution tests
RassK Feb 19, 2024
92f1db9
Merge branch 'main' into arm64
RassK Feb 20, 2024
11fc374
Add x64 preprocessor constant to filter integration tests
RassK Feb 22, 2024
2ed6a76
fix native dir location
RassK Feb 22, 2024
df24582
fix platform directory
RassK Feb 22, 2024
1e1fba3
fix Kafka tests
RassK Feb 23, 2024
b06d119
Merge branch 'main' into arm64
RassK Feb 23, 2024
f6bc60a
update ci
RassK Feb 23, 2024
ab7ba66
test-build-container
RassK Feb 23, 2024
6372db7
update container builds
RassK Feb 23, 2024
68a76b6
fix broken path
RassK Feb 23, 2024
855e050
add arm64 nuget tests
RassK Feb 23, 2024
4d26715
fix wrong platform
RassK Feb 23, 2024
0c4f429
Merge branch 'main' into arm64
RassK Feb 26, 2024
b76fa7d
Merge branch 'main' into arm64
RassK Feb 27, 2024
245a8aa
Merge branch 'main' into arm64
RassK Feb 29, 2024
65b7908
Add arm64 debian container tests
RassK Feb 29, 2024
5b6763b
Cleanup & Docs
RassK Feb 29, 2024
d352b4f
Merge branch 'main' into arm64
RassK Mar 4, 2024
2cbc492
update runner label
RassK Mar 4, 2024
33c5bf2
Add experimental notes
RassK Mar 4, 2024
7a453a8
Merge branch 'main' into arm64
RassK Mar 4, 2024
b0c00f3
Merge branch 'main' into arm64
pjanotti Mar 5, 2024
7e7e299
Update .markdownlint.yaml
RassK Mar 6, 2024
bd28f00
Update docs/README.md
RassK Mar 6, 2024
6e33531
Merge branch 'main' into arm64
Kielek Mar 6, 2024
4ef2f93
Merge branch 'main' into arm64
pellared Mar 6, 2024
dfe9a35
Merge branch 'main' into arm64
Kielek Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build-centos-native-container.yml
Expand Up @@ -14,9 +14,12 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4.1.1

- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version

- name: Build native library in Docker container
run: |
set -e
Expand All @@ -25,9 +28,9 @@ jobs:
/bin/sh -c 'git config --global --add safe.directory /project && ./build.sh BuildNativeWorkflow'

- name: Publish native library Linux build
if: (${{ job.status }} != 'cancelled')
uses: actions/upload-artifact@v4.3.1
with:
name: bin-centos-native
path: bin/tracer-home
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
21 changes: 16 additions & 5 deletions .github/workflows/build-container.yml
Expand Up @@ -13,20 +13,30 @@ jobs:
fail-fast: false
matrix:
include:
- base-image: alpine
- machine: ubuntu-20.04
base-image: alpine
os-type: linux-musl
runs-on: ubuntu-20.04
architecture: x64
- machine: actuated-arm64-4cpu-8gb
base-image: alpine
os-type: linux-musl
architecture: arm64
runs-on: ${{ matrix.machine }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4.1.1

- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version

- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" ./docker
docker run -e OS_TYPE=${{ matrix.os-type }} --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && ./build.sh BuildWorkflow'

- name: Test the Shell scripts from README.md in Docker container
run: |
set -e
Expand All @@ -39,10 +49,11 @@ jobs:
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/publish/TestApplication.Smoke
test "$(ls -A /var/log/opentelemetry/dotnet )"
'

- name: Publish Linux build
if: (${{ job.status }} != 'cancelled')
uses: actions/upload-artifact@v4.3.1
with:
name: bin-${{ matrix.base-image }}
name: bin-${{ matrix.base-image }}-${{ matrix.architecture }}
path: bin/tracer-home
if: (${{ job.status }} != 'cancelled')
continue-on-error: true
20 changes: 16 additions & 4 deletions .github/workflows/build-nuget-packages.yml
Expand Up @@ -46,17 +46,29 @@ jobs:
name: bin-windows-2022
path: bin/ci-artifacts/bin-windows-2022

- name: Download Ubuntu Artifacts from build job
- name: Download Ubuntu x64 Artifacts from build job
uses: actions/download-artifact@v4.1.4
with:
name: bin-ubuntu-20.04
path: bin/ci-artifacts/bin-ubuntu-20.04

- name: Download Alpine Artifacts from build job
- name: Download Ubuntu arm64 Artifacts from build job
uses: actions/download-artifact@v4.1.4
with:
name: bin-alpine
path: bin/ci-artifacts/bin-alpine
name: bin-actuated-arm64-4cpu-8gb
path: bin/ci-artifacts/bin-actuated-arm64-4cpu-8gb

- name: Download Alpine x64 Artifacts from build job
uses: actions/download-artifact@v4.1.4
with:
name: bin-alpine-x64
path: bin/ci-artifacts/bin-alpine-x64

- name: Download Alpine arm64 Artifacts from build job
uses: actions/download-artifact@v4.1.4
with:
name: bin-alpine-arm64
path: bin/ci-artifacts/bin-alpine-arm64

- name: Download Mac-OS Artifacts from build job
uses: actions/download-artifact@v4.1.4
Expand Down
64 changes: 51 additions & 13 deletions .github/workflows/build.yml
Expand Up @@ -19,52 +19,85 @@ jobs:
log-dir: "/var/log/opentelemetry/dotnet"
- machine: macos-11
log-dir: "/var/log/opentelemetry/dotnet"
- machine: actuated-arm64-4cpu-8gb
log-dir: "/var/log/opentelemetry/dotnet"
runs-on: ${{ matrix.machine }}
steps:
- uses: actions/checkout@v4.1.1

- name: ARM64 Runner Info
if: ${{ matrix.machine == 'actuated-arm64-4cpu-8gb' }}
run: cat /etc/os-release

- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- uses: actions/setup-dotnet@v4.0.0

- name: Setup ARM64 Environment Variables
if: ${{ matrix.machine == 'actuated-arm64-4cpu-8gb' }}
run: |
echo "DOTNET_INSTALL_DIR=~/.dotnet" >> $GITHUB_ENV
pjanotti marked this conversation as resolved.
Show resolved Hide resolved

- name: Setup .NET
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: |
6.0.419
7.0.406
8.0.201

- name: Check for NuGet packages cache
uses: actions/cache@v4.0.1
id: nuget-cache
with:
key: ${{ hashFiles('**/Directory.packages.props', './build/LibraryVersions.g.cs', '**/packages.config' ) }}
path: ${{ env.NUGET_PACKAGES }}
- if: ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}
name: Restore NuGet packages

- name: Restore NuGet packages
if: ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}
continue-on-error: false
run: ./build.cmd Restore
- if: ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}
name: Cache NuGet packages

- name: Cache NuGet packages
if: ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4.0.1
with:
key: ${{ hashFiles('**/Directory.packages.props', './build/LibraryVersions.g.cs', '**/packages.config' ) }}
path: ${{ env.NUGET_PACKAGES }}

- run: ./build.cmd BuildWorkflow --no-restore ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}
- name: Setup ARM64 Machine
if: ${{ matrix.machine == 'actuated-arm64-4cpu-8gb' }}
run: |
sudo apt-get update && \
sudo apt-get install -y \
cmake \
clang \
make

- name: Run BuildWorkflow
run: ./build.cmd BuildWorkflow --no-restore ${{ steps.nuget-cache.outputs.cache-hit != 'true' }}

- name: Download native CentOS Artifacts from build job
if: ${{ matrix.machine == 'ubuntu-20.04' }}
uses: actions/download-artifact@v4.1.4
with:
name: bin-centos-native
path: bin/ci-artifacts/bin-centos-native

- name: Replace Ubuntu native code by Centos artifacts
if: ${{ matrix.machine == 'ubuntu-20.04' }}
run: |
rm ./bin/tracer-home/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
cp ./bin/ci-artifacts/bin-centos-native/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so ./bin/tracer-home/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
if: ${{ matrix.machine == 'ubuntu-20.04' }}
- run: brew install coreutils

- name: Install MacOS CoreUtils
if: ${{ runner.os == 'macOS' }}
run: brew install coreutils

- name: Create test directory
run: sudo mkdir -p ${{ matrix.log-dir }} && sudo chmod a+rwx ${{ matrix.log-dir }} # the instrumented process has no permissions to create log dir
if: ${{ runner.os != 'Windows' }}
run: sudo mkdir -p ${{ matrix.log-dir }} && sudo chmod a+rwx ${{ matrix.log-dir }} # the instrumented process has no permissions to create log dir

- name: Test the Shell scripts from README.md
shell: bash
run: |
Expand All @@ -74,7 +107,8 @@ jobs:
. ./instrument.sh
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/publish/TestApplication.Smoke
test "$(ls -A '${{ matrix.log-dir }}' )"
- name: Test the PowerShell module instructions from README.md

- name: Test the Windows PowerShell module instructions from README.md
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
Expand All @@ -90,21 +124,25 @@ jobs:
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net8.0/TestApplication.Smoke.exe
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" }
if (Test-Path $log_path) { throw "Log file exists. Instrumentation unregister failed." }

- name: Upload binaries
uses: actions/upload-artifact@v4.3.1
if: always()
uses: actions/upload-artifact@v4.3.1
with:
name: bin-${{ matrix.machine }}
path: bin/tracer-home

- name: Upload installation scripts
uses: actions/upload-artifact@v4.3.1
if: always()
uses: actions/upload-artifact@v4.3.1
with:
name: installation-scripts-${{ matrix.machine }}
path: bin/installation-scripts

- name: Regenerate LibraryVersions.g.cs
# Regenerate the library versions file to surface any version changes made to the packages being tested.
run: ./build.cmd GenerateLibraryVersionFiles

- name: Generated files unchanged
shell: bash
run: |
Expand Down