Skip to content

Commit f6d4351

Browse files
atoulmepjanotti
andauthored
[chore] add build for arm64 msi (#7207)
* [chore] add build for arm64 msi * fix gitlab build * add windows arm to msi-test * Ensure that msi-test runs on correct Windows ARCH --------- Co-authored-by: Paulo Janotti <pjanotti@splunk.com>
1 parent 250c38b commit f6d4351

File tree

15 files changed

+90
-45
lines changed

15 files changed

+90
-45
lines changed

.github/workflows/ansible.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
uses: ./.github/workflows/reusable-msi-custom-actions.yml
7676
with:
7777
OS: ${{ matrix.OS }}
78+
ARCH: "x64"
7879

7980
msi-build:
8081
needs: [ cross-compile, agent-bundle-windows, msi-custom-actions ]
@@ -84,6 +85,7 @@ jobs:
8485
uses: ./.github/workflows/reusable-msi-build.yml
8586
with:
8687
OS: ${{ matrix.OS }}
88+
ARCH: "amd64"
8789

8890
lint:
8991
name: Lint

.github/workflows/chef-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
uses: ./.github/workflows/reusable-msi-custom-actions.yml
7474
with:
7575
OS: ${{ matrix.OS }}
76+
ARCH: "x64"
7677

7778
msi-build:
7879
needs: [ cross-compile, agent-bundle-windows, msi-custom-actions ]
@@ -82,6 +83,7 @@ jobs:
8283
uses: ./.github/workflows/reusable-msi-build.yml
8384
with:
8485
OS: ${{ matrix.OS }}
86+
ARCH: "amd64"
8587

8688
chef-lint-spec-test:
8789
name: chef-lint-spec-test

.github/workflows/puppet-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ jobs:
236236
uses: ./.github/workflows/reusable-msi-custom-actions.yml
237237
with:
238238
OS: windows-2022
239+
ARCH: x64
239240

240241
# Use reusable workflow for MSI build
241242
puppet-build-windows-msi-local-package:
@@ -246,6 +247,7 @@ jobs:
246247
- puppet-build-windows-msi-custom-actions
247248
with:
248249
OS: windows-2022
250+
ARCH: amd64
249251

250252
puppet-test-windows:
251253
name: puppet-test-windows

.github/workflows/reusable-agent-bundle-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
path: ${{ env.PIP_CACHE_DIR }}
2222
key: agent-bundle-windows-pip-${{ hashFiles('packaging/bundle/collectd-plugins.yaml', 'packaging/bundle/scripts/requirements.txt') }}
2323

24-
- run: ./packaging/bundle/scripts/windows/make.ps1 bundle
24+
- run: ./packaging/bundle/scripts/windows/make.ps1 bundle "${{ inputs.OS }}"
2525

2626
- uses: actions/upload-artifact@v6
2727
with:
28-
name: agent-bundle-windows-${{ inputs.OS }}
29-
path: ./dist/agent-bundle_windows_amd64.zip
28+
name: agent-bundle-${{ inputs.OS }}
29+
path: ./dist/agent-bundle-${{ inputs.OS }}.zip

.github/workflows/reusable-msi-build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
OS:
77
required: true
88
type: string
9+
ARCH:
10+
required: true
11+
type: string
912
outputs:
1013
version:
1114
description: "The MSI version"
@@ -41,22 +44,22 @@ jobs:
4144
- name: Install Wix
4245
run: dotnet tool restore
4346

44-
- name: Downloading binaries-windows_amd64
47+
- name: Downloading binaries-windows_${{ inputs.ARCH }}
4548
uses: actions/download-artifact@v7
4649
with:
47-
name: binaries-windows_amd64
50+
name: binaries-windows_${{ inputs.ARCH }}
4851
path: ./bin
4952

5053
- name: Downloading agent-bundle-windows
5154
uses: actions/download-artifact@v7
5255
with:
53-
name: agent-bundle-windows-${{ inputs.OS }}
56+
name: agent-bundle-${{ inputs.OS }}
5457
path: ./dist
5558

5659
- name: Downloading msi-custom-actions
5760
uses: actions/download-artifact@v7
5861
with:
59-
name: msi-custom-actions
62+
name: msi-custom-actions-${{ inputs.OS }}
6063
path: ./packaging/msi/SplunkCustomActions/bin/Release
6164

6265
- name: Build MSI
@@ -66,7 +69,7 @@ jobs:
6669
VERSION="${{ steps.get-version.outputs.version }}"
6770
JMX_METRIC_GATHERER_RELEASE=$(cat packaging/jmx-metric-gatherer-release.txt)
6871
69-
./packaging/msi/build.sh "$VERSION" "$JMX_METRIC_GATHERER_RELEASE"
72+
./packaging/msi/build.sh "$VERSION" "$JMX_METRIC_GATHERER_RELEASE" "${{ inputs.OS }}"
7073
7174
- name: Uploading msi build artifacts
7275
uses: actions/upload-artifact@v6

.github/workflows/reusable-msi-custom-actions.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
OS:
77
required: true
88
type: string
9-
9+
ARCH:
10+
required: true
11+
type: string
1012
jobs:
1113
msi-custom-actions:
1214
runs-on: ${{ inputs.OS }}
@@ -18,11 +20,11 @@ jobs:
1820
working-directory: packaging/msi/SplunkCustomActions
1921
run: |
2022
dotnet test ./test/SplunkCustomActionsTests.csproj -c Release
21-
dotnet build ./src/SplunkCustomActions.csproj -c Release -p:Platform=x64 -o ./bin/Release
23+
dotnet build ./src/SplunkCustomActions.csproj -c Release -p:Platform=${{ inputs.ARCH }} -o ./bin/Release
2224
mkdir "${{ github.workspace }}/dist"
23-
cp ./bin/Release/SplunkCustomActions.CA.dll "${{ github.workspace }}/dist/SplunkCustomActions.CA.dll"
25+
cp ./bin/Release/SplunkCustomActions.CA.dll "${{ github.workspace }}/dist/SplunkCustomActions-${{ inputs.ARCH }}.CA.dll"
2426
2527
- uses: actions/upload-artifact@v6
2628
with:
27-
name: msi-custom-actions
28-
path: ./dist/SplunkCustomActions.CA.dll
29+
name: msi-custom-actions-${{ inputs.OS }}
30+
path: ./dist/SplunkCustomActions-${{ inputs.ARCH }}.CA.dll

.github/workflows/vuln-scans.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ jobs:
164164
with:
165165
path: ${{ env.PIP_CACHE_DIR }}
166166
key: agent-bundle-windows-pip-${{ hashFiles('packaging/bundle/collectd-plugins.yaml', 'packaging/bundle/scripts/requirements.txt') }}
167-
- run: ./packaging/bundle/scripts/windows/make.ps1 bundle
167+
- run: ./packaging/bundle/scripts/windows/make.ps1 bundle "${{ matrix.OS }}"
168168
- name: Build docker image
169169
run: |
170170
$ErrorActionPreference = 'Stop'
171171
Copy-Item .\bin\otelcol_windows_amd64.exe .\cmd\otelcol\otelcol.exe
172-
Copy-Item .\dist\agent-bundle_windows_amd64.zip .\cmd\otelcol\agent-bundle_windows_amd64.zip
172+
Copy-Item .\dist\agent-bundle-${{ matrix.OS }}.zip .\cmd\otelcol\agent-bundle_windows_amd64.zip
173173
if ("${{ matrix.OS }}" -eq "windows-2025") {
174174
$base_image = "mcr.microsoft.com/windows/servercore:ltsc2025"
175175
} else {

.github/workflows/win-package-test.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,37 @@ jobs:
3030
cross-compile:
3131
strategy:
3232
matrix:
33-
SYS_BINARIES: [ "binaries-windows_amd64" ]
33+
SYS_BINARIES: [ "binaries-windows_amd64", "binaries-windows_arm64" ]
3434
uses: ./.github/workflows/reusable-compile.yml
3535
with:
3636
SYS_BINARY: ${{ matrix.SYS_BINARIES }}
3737

3838
agent-bundle-windows:
3939
strategy:
4040
matrix:
41-
OS: [ "windows-2022", "windows-2025" ]
41+
OS: [ {"runner": "windows-2022", "arch": "amd64"}, {"runner": "windows-2025", "arch": "amd64"}, {"runner": "windows-11-arm", "arch": "arm64"} ]
4242
uses: ./.github/workflows/reusable-agent-bundle-windows.yml
4343
with:
44-
OS: ${{ matrix.OS }}
44+
OS: ${{ matrix.OS.runner }}
4545

4646
msi-custom-actions:
4747
strategy:
4848
matrix:
49-
OS: [ "windows-2022" ]
49+
OS: [ {"runner": "windows-2022", "arch": "x64"}, {"runner": "windows-2025", "arch": "x64"}, {"runner": "windows-11-arm", "arch": "arm64"} ]
5050
uses: ./.github/workflows/reusable-msi-custom-actions.yml
5151
with:
52-
OS: ${{ matrix.OS }}
52+
OS: ${{ matrix.OS.runner }}
53+
ARCH: ${{ matrix.OS.arch }}
5354

5455
msi-build:
5556
strategy:
5657
matrix:
57-
OS: [ "windows-2022", "windows-2025" ]
58+
OS: [ {"runner": "windows-2022", "arch": "amd64"}, {"runner": "windows-2025", "arch": "amd64"}, {"runner": "windows-11-arm", "arch": "arm64"} ]
5859
needs: [cross-compile, agent-bundle-windows, msi-custom-actions]
5960
uses: ./.github/workflows/reusable-msi-build.yml
6061
with:
61-
OS: ${{ matrix.OS }}
62+
OS: ${{ matrix.OS.runner }}
63+
ARCH: ${{ matrix.OS.arch }}
6264

6365
dotnet-zeroconfig-e2e-test:
6466
runs-on: windows-2022 # windows-2022 comes preloaded with the Docker image used in the test
@@ -112,8 +114,8 @@ jobs:
112114
msi-test:
113115
strategy:
114116
matrix:
115-
OS: [ "windows-2022" ]
116-
runs-on: otel-windows
117+
OS: [ "windows-2022", "windows-11-arm" ]
118+
runs-on: ${{ matrix.OS }}
117119
needs: [msi-build]
118120
timeout-minutes: 40
119121
steps:
@@ -144,7 +146,7 @@ jobs:
144146
strategy:
145147
max-parallel: 2
146148
matrix:
147-
OS: [ "windows-2022", "windows-2025" ]
149+
OS: [ "windows-2022", "windows-2025", "windows-11-arm" ]
148150
MODE: [ "agent", "gateway" ]
149151
steps:
150152
- name: Check out the codebase.
@@ -378,7 +380,7 @@ jobs:
378380

379381
- uses: actions/download-artifact@v7
380382
with:
381-
name: agent-bundle-windows-${{ matrix.OS }}
383+
name: agent-bundle-${{ matrix.OS }}
382384
path: ./dist
383385

384386
- uses: ./.github/actions/win-wait-for-docker
@@ -387,7 +389,7 @@ jobs:
387389
run: |
388390
$ErrorActionPreference = 'Stop'
389391
Copy-Item .\bin\otelcol_windows_amd64.exe .\cmd\otelcol\otelcol.exe
390-
Copy-Item .\dist\agent-bundle_windows_amd64.zip .\cmd\otelcol\agent-bundle_windows_amd64.zip
392+
Copy-Item .\dist\agent-bundle-${{ matrix.OS }}.zip .\cmd\otelcol\agent-bundle_windows_amd64.zip
391393
docker build -t otelcol-windows --build-arg BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022 --build-arg JMX_METRIC_GATHERER_RELEASE=$(Get-Content packaging\jmx-metric-gatherer-release.txt) -f .\cmd\otelcol\Dockerfile.windows .\cmd\otelcol\
392394
Remove-Item .\cmd\otelcol\otelcol.exe
393395
Remove-Item .\cmd\otelcol\agent-bundle_windows_amd64.zip

.gitlab-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,10 @@ agent-bundle-windows:
517517
paths:
518518
- .cache/pip
519519
script:
520-
- ./packaging/bundle/scripts/windows/make.ps1 bundle
520+
- ./packaging/bundle/scripts/windows/make.ps1 bundle windows_amd64
521521
artifacts:
522522
paths:
523-
- dist/agent-bundle_windows_amd64.zip
523+
- dist/agent-bundle-windows_amd64.zip
524524

525525
.collector-ta-trigger:
526526
rules:
@@ -809,7 +809,7 @@ build-msi:
809809
$VERSION_TAG = ""
810810
}
811811
- |
812-
& 'C:\Program Files\Git\bin\bash.exe' -c "./packaging/msi/build.sh $VERSION_TAG $(Get-Content ./packaging/jmx-metric-gatherer-release.txt)"
812+
& 'C:\Program Files\Git\bin\bash.exe' -c "./packaging/msi/build.sh $VERSION_TAG $(Get-Content ./packaging/jmx-metric-gatherer-release.txt)" windows_amd64
813813
artifacts:
814814
paths:
815815
- dist/*.msi

packaging/bundle/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ Run the following Powershell commands to build the bundle for Windows (requires
9191
```sh
9292
PS> git clone https://github.com/signalfx/splunk-otel-collector
9393
PS> cd splunk-otel-collector
94-
PS> ./packaging/bundle/scripts/windows/make.ps1 bundle
94+
PS> ./packaging/bundle/scripts/windows/make.ps1 bundle windows_amd64
9595
```
96-
The bundle will be saved to `dist/agent-bundl_windows_amd64.zip`.
96+
The bundle will be saved to `dist/agent-bundle-windows_amd64.zip`.

0 commit comments

Comments
 (0)