From 33d08522b263dacddc985fb91be7bf83180fd225 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Dec 2022 11:17:20 +0100 Subject: [PATCH 01/11] Add ARM64 build --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e68964d3c..f6174b7370 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,6 +89,34 @@ jobs: git diff [[ -z "$(git status --porcelain)" ]] + build-arm64: + strategy: + fail-fast: false + runs-on: ubuntu-20.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v3.2.0 + - uses: uraimo/run-on-arch-action@v2.5.0 + with: + arch: aarch64 + distro: bullseye + run: | + apt-get update + apt-get upgrade + apt-get install wget -y + wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb + dpkg -i packages-microsoft-prod.deb + rm packages-microsoft-prod.deb + apt-get update && apt-get install -y dotnet-sdk-6.0 && apt-get install -y dotnet-sdk-7.0 + ./build.sh Workflow --containers linux + - name: Publish ARM64 build + uses: actions/upload-artifact@v3.1.1 + with: + name: bin-arm64 + path: bin/tracer-home + if: (${{ job.status }} != 'cancelled') + continue-on-error: true + build-container: strategy: fail-fast: false @@ -150,6 +178,12 @@ jobs: name: bin-macos-11 path: nuget/bin-macos + - name: Download ARM64 Artifacts from build job + uses: actions/download-artifact@v3.0.1 + with: + name: bin-arm64 + path: nuget/bin-arm64 + - name: Build NuGet package run: nuget pack OpenTelemetry.AutoInstrumentation.nuspec -Properties NoWarn=NU5100,NU5123,NU5128 working-directory: nuget From d1c7b4b15918d56fd6ebef1daae549ccfed30f3f Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Dec 2022 11:28:14 +0100 Subject: [PATCH 02/11] Fix indentation --- .github/workflows/ci.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6174b7370..f04f3b0565 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,19 +96,20 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v3.2.0 - - uses: uraimo/run-on-arch-action@v2.5.0 - with: - arch: aarch64 - distro: bullseye - run: | - apt-get update - apt-get upgrade - apt-get install wget -y - wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb - dpkg -i packages-microsoft-prod.deb - rm packages-microsoft-prod.deb - apt-get update && apt-get install -y dotnet-sdk-6.0 && apt-get install -y dotnet-sdk-7.0 - ./build.sh Workflow --containers linux + - name: Build ARM64 + uses: uraimo/run-on-arch-action@v2.5.0 + with: + arch: aarch64 + distro: bullseye + run: | + apt-get update + apt-get upgrade + apt-get install wget -y + wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb + dpkg -i packages-microsoft-prod.deb + rm packages-microsoft-prod.deb + apt-get update && apt-get install -y dotnet-sdk-6.0 && apt-get install -y dotnet-sdk-7.0 + ./build.sh Workflow --containers linux - name: Publish ARM64 build uses: actions/upload-artifact@v3.1.1 with: From 1115d2ef1a78c099253db77b38800001e5ff7a2e Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Wed, 28 Dec 2022 13:01:12 +0100 Subject: [PATCH 03/11] Install dotent via script --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f04f3b0565..d0d019696c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,11 +104,11 @@ jobs: run: | apt-get update apt-get upgrade - apt-get install wget -y - wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb - dpkg -i packages-microsoft-prod.deb - rm packages-microsoft-prod.deb - apt-get update && apt-get install -y dotnet-sdk-6.0 && apt-get install -y dotnet-sdk-7.0 + apt-get install -y curl clang cmake make protobuf-compiler + curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh + chmod +x ./dotnet-install.sh + ./dotnet-install.sh -c 6.0 --install-dir /usr/share/dotnet --no-path + rm dotnet-install.sh ./build.sh Workflow --containers linux - name: Publish ARM64 build uses: actions/upload-artifact@v3.1.1 From f2a58d6619cb1f926963bf8c0ac0e2e9b4dd673f Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Thu, 29 Dec 2022 11:21:22 +0100 Subject: [PATCH 04/11] Build in the container --- .github/workflows/ci.yml | 39 +++++++-------------------------------- docker/debian.dockerfile | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 32 deletions(-) create mode 100644 docker/debian.dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0d019696c..77753f3aca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,40 +89,15 @@ jobs: git diff [[ -z "$(git status --porcelain)" ]] - build-arm64: - strategy: - fail-fast: false - runs-on: ubuntu-20.04 - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3.2.0 - - name: Build ARM64 - uses: uraimo/run-on-arch-action@v2.5.0 - with: - arch: aarch64 - distro: bullseye - run: | - apt-get update - apt-get upgrade - apt-get install -y curl clang cmake make protobuf-compiler - curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh - chmod +x ./dotnet-install.sh - ./dotnet-install.sh -c 6.0 --install-dir /usr/share/dotnet --no-path - rm dotnet-install.sh - ./build.sh Workflow --containers linux - - name: Publish ARM64 build - uses: actions/upload-artifact@v3.1.1 - with: - name: bin-arm64 - path: bin/tracer-home - if: (${{ job.status }} != 'cancelled') - continue-on-error: true - build-container: strategy: fail-fast: false matrix: - base-image: [ alpine ] + include: + - base-image: alpine + platform: linux/amd64 + - base-image: debian + platform: linux/arm64 runs-on: ubuntu-20.04 timeout-minutes: 60 steps: @@ -131,13 +106,13 @@ jobs: run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \ + docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform {{ matrix.base-platform }} mybuildimage \ ./build.sh Workflow --containers none - name: Test the Shell scripts from README.md in Docker container run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c ' + docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform {{ matrix.base-platform }} --rm mybuildimage /bin/sh -c ' set -e dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home" diff --git a/docker/debian.dockerfile b/docker/debian.dockerfile new file mode 100644 index 0000000000..b2aa06293b --- /dev/null +++ b/docker/debian.dockerfile @@ -0,0 +1,29 @@ +FROM mcr.microsoft.com/dotnet/sdk:7.0.101-bullseye-slim-arm64v8 + +RUN echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list + +RUN apt-get update \ + && apt-get upgrade \ + && apt-get install -y \ + curl \ + clang \ + cmake \ + make \ + protobuf-compiler + +RUN apt-get install -y -t stretch-backports \ + libgrpc++-dev \ + libgrpc++1 \ + libgrpc6 \ + libgrpc-dev \ + protobuf-compiler-grpc + +ENV PROTOBUF_PROTOC=/usr/bin/protoc +ENV gRPC_PluginFullPath=/usr/bin/grpc_csharp_plugin + +RUN curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \ + && chmod +x ./dotnet-install.sh \ + && ./dotnet-install.sh -c 6.0 --install-dir /usr/share/dotnet --no-path \ + && rm dotnet-install.sh + +WORKDIR /project From 0205687d9228ff58e22464e30571186811a8e2d4 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Thu, 29 Dec 2022 11:24:26 +0100 Subject: [PATCH 05/11] Fix passing variables --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77753f3aca..89b39f7eb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,13 +106,13 @@ jobs: run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform {{ matrix.base-platform }} mybuildimage \ + docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.base-platform }} mybuildimage \ ./build.sh Workflow --containers none - name: Test the Shell scripts from README.md in Docker container run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform {{ matrix.base-platform }} --rm mybuildimage /bin/sh -c ' + docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.base-platform }} --rm mybuildimage /bin/sh -c ' set -e dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home" From dcbc6c7c93161d11b3e1d336b677c1989554c3c8 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Thu, 29 Dec 2022 11:24:56 +0100 Subject: [PATCH 06/11] Fix passing variables --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89b39f7eb1..c92ec975e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,13 +106,13 @@ jobs: run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.base-platform }} mybuildimage \ + docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.platform }} mybuildimage \ ./build.sh Workflow --containers none - name: Test the Shell scripts from README.md in Docker container run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.base-platform }} --rm mybuildimage /bin/sh -c ' + docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.platform }} --rm mybuildimage /bin/sh -c ' set -e dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home" From 6e58d00f1522117631e7b2698f63bc4ad1907bd4 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Thu, 29 Dec 2022 11:39:01 +0100 Subject: [PATCH 07/11] Separate file creation --- docker/debian.dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/debian.dockerfile b/docker/debian.dockerfile index b2aa06293b..285607a16c 100644 --- a/docker/debian.dockerfile +++ b/docker/debian.dockerfile @@ -1,6 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0.101-bullseye-slim-arm64v8 -RUN echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list +RUN touch /etc/apt/sources.list.d/backports.list +RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list RUN apt-get update \ && apt-get upgrade \ From b85e6af99b4238b5203ff8c0c01b08996b8f9081 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Mon, 2 Jan 2023 08:58:16 +0100 Subject: [PATCH 08/11] Revreate build-arm64 step with package download --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++------- docker/debian.dockerfile | 30 ---------------------------- 2 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 docker/debian.dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c92ec975e3..15cc44fe4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,15 +89,44 @@ jobs: git diff [[ -z "$(git status --porcelain)" ]] + build-arm64: + strategy: + fail-fast: false + runs-on: ubuntu-20.04 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v3.2.0 + - name: Build ARM64 + uses: uraimo/run-on-arch-action@v2.5.0 + with: + arch: aarch64 + distro: bullseye + run: | + touch /etc/apt/sources.list.d/backports.list + echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list + apt-get update + apt-get upgrade + apt-get install -y curl clang cmake make protobuf-compiler + apt-get install -y -t stretch-backports libgrpc++-dev libgrpc++1 libgrpc6 libgrpc-dev protobuf-compiler-grpc + curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh + chmod +x ./dotnet-install.sh + ./dotnet-install.sh -c 6.0 --install-dir /usr/share/dotnet --no-path + ./dotnet-install.sh -c 7.0 --install-dir /usr/share/dotnet --no-path + rm dotnet-install.sh + ./build.sh Workflow --containers linux + - name: Publish ARM64 build + uses: actions/upload-artifact@v3.1.1 + with: + name: bin-arm64 + path: bin/tracer-home + if: (${{ job.status }} != 'cancelled') + continue-on-error: true + build-container: strategy: fail-fast: false matrix: - include: - - base-image: alpine - platform: linux/amd64 - - base-image: debian - platform: linux/arm64 + base-image: [ alpine ] runs-on: ubuntu-20.04 timeout-minutes: 60 steps: @@ -106,13 +135,13 @@ jobs: run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.platform }} mybuildimage \ + docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \ ./build.sh Workflow --containers none - name: Test the Shell scripts from README.md in Docker container run: | set -e docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . - docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --platform ${{ matrix.platform }} --rm mybuildimage /bin/sh -c ' + docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c ' set -e dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home" diff --git a/docker/debian.dockerfile b/docker/debian.dockerfile deleted file mode 100644 index 285607a16c..0000000000 --- a/docker/debian.dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0.101-bullseye-slim-arm64v8 - -RUN touch /etc/apt/sources.list.d/backports.list -RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list - -RUN apt-get update \ - && apt-get upgrade \ - && apt-get install -y \ - curl \ - clang \ - cmake \ - make \ - protobuf-compiler - -RUN apt-get install -y -t stretch-backports \ - libgrpc++-dev \ - libgrpc++1 \ - libgrpc6 \ - libgrpc-dev \ - protobuf-compiler-grpc - -ENV PROTOBUF_PROTOC=/usr/bin/protoc -ENV gRPC_PluginFullPath=/usr/bin/grpc_csharp_plugin - -RUN curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh \ - && chmod +x ./dotnet-install.sh \ - && ./dotnet-install.sh -c 6.0 --install-dir /usr/share/dotnet --no-path \ - && rm dotnet-install.sh - -WORKDIR /project From d43fd2cd5f70192d1a626b6cdb830a2db9bfe775 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Tue, 3 Jan 2023 09:23:07 +0100 Subject: [PATCH 09/11] Add dotent to path on installation --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15cc44fe4a..ecb3242185 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,8 +110,8 @@ jobs: apt-get install -y -t stretch-backports libgrpc++-dev libgrpc++1 libgrpc6 libgrpc-dev protobuf-compiler-grpc curl -sSL https://dot.net/v1/dotnet-install.sh --output dotnet-install.sh chmod +x ./dotnet-install.sh - ./dotnet-install.sh -c 6.0 --install-dir /usr/share/dotnet --no-path - ./dotnet-install.sh -c 7.0 --install-dir /usr/share/dotnet --no-path + ./dotnet-install.sh --channel 6.0.1xx --install-dir /usr/share/dotnet + ./dotnet-install.sh --channel 7.0.1xx --install-dir /usr/share/dotnet rm dotnet-install.sh ./build.sh Workflow --containers linux - name: Publish ARM64 build From d99dbfa34420812df656fe0fd2b94674e48d809e Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Tue, 3 Jan 2023 10:18:36 +0100 Subject: [PATCH 10/11] Remove arm from pack --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecb3242185..b3b79f2fc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,12 +183,6 @@ jobs: name: bin-macos-11 path: nuget/bin-macos - - name: Download ARM64 Artifacts from build job - uses: actions/download-artifact@v3.0.1 - with: - name: bin-arm64 - path: nuget/bin-arm64 - - name: Build NuGet package run: nuget pack OpenTelemetry.AutoInstrumentation.nuspec -Properties NoWarn=NU5100,NU5123,NU5128 working-directory: nuget From 39ab6d5f275f818117416120dc4626d9c2070587 Mon Sep 17 00:00:00 2001 From: dszmigielski Date: Tue, 3 Jan 2023 12:29:00 +0100 Subject: [PATCH 11/11] Change containers to none --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3b79f2fc2..c6d2411b58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: ./dotnet-install.sh --channel 6.0.1xx --install-dir /usr/share/dotnet ./dotnet-install.sh --channel 7.0.1xx --install-dir /usr/share/dotnet rm dotnet-install.sh - ./build.sh Workflow --containers linux + ./build.sh Workflow --containers none - name: Publish ARM64 build uses: actions/upload-artifact@v3.1.1 with: