Skip to content

Commit 53d140d

Browse files
authored
Add Windows/arm64 support for Agent (#9751)
* Save current work * add a platformpackage for windows/arm64 * Trying new image in observability-ci namespace * Updating packages spec * Package windows/arm64 * Update windows step keys * Change host image for windows/arm64 packaging * Update test and switch image settings for windows/arm * machineType -> instanceType * trigger a new build after container update * trigger a new build after container update * add go build -x * trigger a new build after container update * Bump version of winperfcounters to support arm * less noise please * set cgo_enabled for windows * trigger a new build after container update * trigger a new build after container update * trigger a new build after container update * trigger a new build after container update * Add arm64 to allowed archs for Zip * go mod tidy * Build elastic-agent-archive-root for windows/arm64 * Cleaning up comments and debug logs * Cleaning up * Cleaning up and setting agentbeat to all platforms * Agentbeat not yet in DRA for windows/arm64 * Beats DRA now published, so try agentbeat w/ all platforms * Cleaning up and linting * Temp trying new .package-version w/ windows/arm beats * Cleaning up code * Cleaning up log messages * Restoring previous comment * Adding in support for windows/arm in spec file for Endpoint * fixing spacing
1 parent 3c3de26 commit 53d140d

15 files changed

+70
-35
lines changed

.buildkite/bk.integration.pipeline.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ steps:
9898
steps:
9999
- label: "Windows:2022:amd64:sudo"
100100
depends_on:
101-
- packaging-windows
101+
- packaging-windows-amd64
102102
env:
103103
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/leak"
104104
command: |
105-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
105+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
106106
.buildkite/scripts/steps/integration_tests_tf.ps1 fleet true
107107
artifact_paths:
108108
- build/**
@@ -119,11 +119,11 @@ steps:
119119

120120
- label: "Windows:2025:amd64:sudo"
121121
depends_on:
122-
- packaging-windows
122+
- packaging-windows-amd64
123123
env:
124124
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/leak"
125125
command: |
126-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
126+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
127127
.buildkite/scripts/steps/integration_tests_tf.ps1 fleet true
128128
artifact_paths:
129129
- build/**
@@ -168,11 +168,11 @@ steps:
168168
steps:
169169
- label: "Win2022:sudo:{{matrix}}"
170170
depends_on:
171-
- packaging-windows
171+
- packaging-windows-amd64
172172
env:
173173
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/ess"
174174
command: |
175-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
175+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
176176
.buildkite/scripts/steps/integration_tests_tf.ps1 {{matrix}} true
177177
artifact_paths:
178178
- build/**
@@ -198,11 +198,11 @@ steps:
198198

199199
- label: "Win2022:non-sudo:{{matrix}}"
200200
depends_on:
201-
- packaging-windows
201+
- packaging-windows-amd64
202202
env:
203203
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/ess"
204204
command: |
205-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
205+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
206206
.buildkite/scripts/steps/integration_tests_tf.ps1 {{matrix}} false
207207
artifact_paths:
208208
- build/**
@@ -221,11 +221,11 @@ steps:
221221

222222
- label: "Win2025:sudo:{{matrix}}"
223223
depends_on:
224-
- packaging-windows
224+
- packaging-windows-amd64
225225
env:
226226
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/ess"
227227
command: |
228-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
228+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
229229
.buildkite/scripts/steps/integration_tests_tf.ps1 {{matrix}} true
230230
artifact_paths:
231231
- build/**
@@ -251,11 +251,11 @@ steps:
251251

252252
- label: "Win2025:non-sudo:{{matrix}}"
253253
depends_on:
254-
- packaging-windows
254+
- packaging-windows-amd64
255255
env:
256256
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/ess"
257257
command: |
258-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
258+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
259259
.buildkite/scripts/steps/integration_tests_tf.ps1 {{matrix}} false
260260
artifact_paths:
261261
- build/**
@@ -555,11 +555,11 @@ steps:
555555
steps:
556556
- label: "Windows:2022:amd64:sudo"
557557
depends_on:
558-
- packaging-windows
558+
- packaging-windows-amd64
559559
env:
560560
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/serverless"
561561
command: |
562-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
562+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
563563
.buildkite/scripts/buildkite-integration-tests.ps1 fleet true
564564
artifact_paths:
565565
- build/**
@@ -577,11 +577,11 @@ steps:
577577

578578
- label: "Windows:2025:amd64:sudo"
579579
depends_on:
580-
- packaging-windows
580+
- packaging-windows-amd64
581581
env:
582582
TEST_PACKAGE: "github.com/elastic/elastic-agent/testing/integration/serverless"
583583
command: |
584-
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
584+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows-amd64'
585585
.buildkite/scripts/buildkite-integration-tests.ps1 fleet true
586586
artifact_paths:
587587
- build/**

.buildkite/integration.pipeline.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ steps:
9191
image: "${IMAGE_UBUNTU_2204_ARM_64}"
9292

9393
- label: "Packaging: windows/amd64 zip"
94-
key: packaging-windows
94+
key: packaging-windows-amd64
9595
env:
9696
PACKAGES: "zip"
9797
PLATFORMS: "windows/amd64"
@@ -106,6 +106,22 @@ steps:
106106
machineType: "n2-standard-8"
107107
image: "${IMAGE_UBUNTU_2204_X86_64}"
108108

109+
- label: "Packaging: windows/arm64 zip"
110+
key: packaging-windows-arm64
111+
env:
112+
PACKAGES: "zip"
113+
PLATFORMS: "windows/arm64"
114+
command: ".buildkite/scripts/steps/integration-package.sh"
115+
artifact_paths:
116+
- build/distributions/**
117+
retry:
118+
automatic:
119+
limit: 1
120+
agents:
121+
provider: "aws"
122+
instanceType: "c6g.4xlarge"
123+
image: "${IMAGE_UBUNTU_2204_ARM_64}"
124+
109125
- label: "Packaging: Containers linux/amd64"
110126
key: packaging-containers-x86-64
111127
env:

.buildkite/pipeline.elastic-agent-binary-dra.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ steps:
4747
PLATFORMS: "linux/amd64"
4848
FIPS: "true"
4949

50-
- label: ":package: linux/arm64 darwin/arm64 Elastic-Agent Core Snapshot"
50+
- label: ":package: linux/arm64 darwin/arm64 windows/arm64 Elastic-Agent Core Snapshot"
5151
commands:
5252
- .buildkite/scripts/steps/build-agent-core.sh
5353
key: "build-dra-snapshot-arm"
@@ -59,7 +59,7 @@ steps:
5959
imagePrefix: "core-ubuntu-2204-aarch64"
6060
env:
6161
DRA_WORKFLOW: "snapshot"
62-
PLATFORMS: "linux/arm64 darwin/arm64"
62+
PLATFORMS: "linux/arm64 darwin/arm64 windows/arm64"
6363

6464
- label: ":package: linux/arm64 FIPS Elastic-Agent Core Snapshot"
6565
commands:

.buildkite/pipeline.elastic-agent-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ steps:
9393
imagePrefix: "core-ubuntu-2204-aarch64"
9494
diskSizeGb: 400
9595
env:
96-
PLATFORMS: "linux/arm64 darwin/arm64"
97-
PACKAGES: "docker,tar.gz,deb,rpm"
96+
PLATFORMS: "linux/arm64 darwin/arm64 windows/arm64"
97+
PACKAGES: "docker,tar.gz,deb,rpm,zip"
9898
FIPS: "{{matrix.fips}}"
9999
command: |
100100
echo "Add support for multiarch"

dev-tools/mage/crossbuild.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ func CrossBuildImage(platform string) (string, error) {
242242
tagSuffix = "s390x-debian11"
243243
case strings.HasPrefix(platform, "linux"):
244244
tagSuffix = "main-debian11"
245+
case platform == "windows/arm64":
246+
tagSuffix = "windows-arm64-debian12"
245247
}
246248

247249
goVersion, err := GoVersion()

dev-tools/mage/manifest/manifest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ var PlatformPackages = map[string]string{
9393
"linux/amd64": "linux-x86_64.tar.gz",
9494
"linux/arm64": "linux-arm64.tar.gz",
9595
"windows/amd64": "windows-x86_64.zip",
96+
"windows/arm64": "windows-arm64.zip",
9697
}
9798

9899
// DownloadManifest is going to download the given manifest file and return the ManifestResponse

dev-tools/mage/pkgtypes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ var OSArchNames = map[string]map[PackageType]map[string]string{
146146
Zip: {
147147
"386": "x86",
148148
"amd64": "x86_64",
149+
"arm64": "arm64",
149150
},
150151
},
151152
"darwin": {

dev-tools/mage/platforms.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ var BuildPlatforms = BuildPlatformList{
5454
{"solaris/amd64", CGOSupported},
5555
{"windows/386", CGOSupported | CrossBuildSupported | Default},
5656
{"windows/amd64", CGOSupported | CrossBuildSupported | Default},
57+
{"windows/arm64", CGOSupported | CrossBuildSupported | Default},
5758
}
5859

5960
// PlatformFeature specifies features that are supported for a platform.
@@ -244,6 +245,7 @@ func (list BuildPlatformList) Remove(name string) BuildPlatformList {
244245
}
245246

246247
return list.filter(func(bp BuildPlatform) bool {
248+
//nolint:staticcheck // leaving as-is since some find it easier to read
247249
return !(bp.GOOS() == attrs.GOOS && bp.Arch() == attrs.Arch)
248250
})
249251
}

dev-tools/mage/platforms_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ func TestBuildPlatformsListFilter(t *testing.T) {
9797
assert.Len(t, BuildPlatforms.Filter("solaris"), 1)
9898
assert.Len(t, BuildPlatforms.Defaults().Filter("solaris"), 0)
9999

100-
assert.Len(t, BuildPlatforms.Filter("windows"), 2)
100+
assert.Len(t, BuildPlatforms.Filter("windows"), 3)
101101
assert.Len(t, BuildPlatforms.Filter("windows/386"), 1)
102+
assert.Len(t, BuildPlatforms.Filter("windows/arm64"), 1)
102103
assert.Len(t, BuildPlatforms.Filter("!defaults"), len(BuildPlatforms)-len(BuildPlatforms.Defaults()))
103104

104105
defaults := BuildPlatforms.Defaults()

dev-tools/packaging/packages.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ platforms: &all-platforms
1313
- &windows-amd64
1414
os: windows
1515
arch: x86_64
16+
- &windows-arm64
17+
os: windows
18+
arch: arm64
1619
- &darwin-amd64
1720
os: darwin
1821
arch: x86_64
@@ -68,6 +71,7 @@ components:
6871
binaryName: agentbeat
6972
fips: false
7073
platforms: *all-platforms
74+
7175
packageTypes: *all-package-types
7276
- &comp-apm_server
7377
projectName: apm-server
@@ -120,7 +124,12 @@ components:
120124
rootDir: fleet-server-{{.Version}}-{{.Platform}}
121125
binaryName: fleet-server
122126
fips: false
123-
platforms: *all-platforms
127+
platforms:
128+
- *linux-amd64
129+
- *linux-arm64
130+
- *windows-amd64
131+
- *darwin-amd64
132+
- *darwin-arm64
124133
packageTypes: *all-package-types
125134
- &comp-pf-elastic-collector
126135
projectName: prodfiler

0 commit comments

Comments
 (0)