9
9
- ' .github/workflows/linux-package-test.yml'
10
10
- ' cmd/otelcol/**'
11
11
- ' internal/buildscripts/packaging/collect-libs.sh'
12
+ - ' internal/buildscripts/packaging/docker-otelcol.sh'
12
13
- ' internal/buildscripts/packaging/fpm/**'
13
14
- ' internal/buildscripts/packaging/installer/install.sh'
14
15
- ' internal/buildscripts/packaging/jmx-metric-gatherer-release.txt'
@@ -255,52 +256,117 @@ jobs:
255
256
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
256
257
runs-on : ubuntu-20.04
257
258
needs : [cross-compile, agent-bundle-linux]
258
- strategy :
259
- matrix :
260
- ARCH : [ "amd64", "arm64", "ppc64le" ]
261
- fail-fast : false
262
259
steps :
260
+ # Multiarch images require more disk space
261
+ -
uses :
jlumbroso/[email protected]
262
+
263
263
- name : Check out the codebase.
264
264
uses : actions/checkout@v4
265
265
266
+ # Required to export a multiarch manifest and images to the local image store
267
+ - name : Set up containerd image store
268
+ uses : crazy-max/ghaction-setup-docker@v3
269
+ with :
270
+ daemon-config : |
271
+ {
272
+ "features": {
273
+ "containerd-snapshotter": true
274
+ }
275
+ }
276
+
266
277
- name : Set up Go
267
278
uses : actions/setup-go@v5
268
279
with :
269
280
go-version : ${{ env.GO_VERSION }}
270
281
cache-dependency-path : ' **/go.sum'
271
282
272
283
- name : Set up QEMU
273
- if : ${{ matrix.ARCH != 'amd64' }}
274
284
uses : docker/setup-qemu-action@v3
275
285
with :
276
- platforms : ${{ matrix.ARCH }}
286
+ platforms : arm64,ppc64le
277
287
image : tonistiigi/binfmt:qemu-v7.0.0
278
288
279
- - name : Downloading binaries-linux_${{ matrix.ARCH }}
289
+ - name : Downloading binaries-linux_amd64
280
290
uses : actions/download-artifact@v4
281
291
with :
282
- name : binaries-linux_${{ matrix.ARCH }}
292
+ name : binaries-linux_amd64
293
+ path : ./bin
294
+
295
+ - name : Downloading binaries-linux_arm64
296
+ uses : actions/download-artifact@v4
297
+ with :
298
+ name : binaries-linux_arm64
299
+ path : ./bin
300
+
301
+ - name : Downloading binaries-linux_ppc64le
302
+ uses : actions/download-artifact@v4
303
+ with :
304
+ name : binaries-linux_ppc64le
283
305
path : ./bin
284
306
285
307
- uses : actions/download-artifact@v4
286
- if : ${{ matrix.ARCH != 'ppc64le' }}
287
308
with :
288
- name : agent-bundle-linux-${{ matrix.ARCH }}
309
+ name : agent-bundle-linux-amd64
289
310
path : ./dist
290
311
291
- - name : Build ${{ matrix.ARCH }} docker image
292
- run : |
293
- make docker-otelcol SKIP_COMPILE=true SKIP_BUNDLE=true ARCH=${{ matrix.ARCH }}
312
+ - uses : actions/download-artifact@v4
313
+ with :
314
+ name : agent-bundle-linux-arm64
315
+ path : ./dist
294
316
295
- - name : Check image arch
296
- run : |
297
- # ensure that the arch in the image manifest is correct
298
- [ "$( docker inspect --format='{{.Architecture}}' otelcol:${{ matrix.ARCH }} )" = "${{ matrix.ARCH }}" ] || exit 1
317
+ - name : Build the multiarch docker image
318
+ run : make docker-otelcol SKIP_COMPILE=true SKIP_BUNDLE=true ARCH=amd64,arm64,ppc64le
319
+
320
+ - name : Save the multiarch image archive to be loaded by downstream jobs
321
+ run : mkdir -p docker-otelcol && docker save -o ./docker-otelcol/image.tar otelcol:latest
322
+
323
+ - uses : actions/upload-artifact@v4
324
+ with :
325
+ name : otelcol
326
+ path : ./docker-otelcol
327
+
328
+ docker-otelcol-verify :
329
+ # Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
330
+ runs-on : ubuntu-20.04
331
+ needs : [docker-otelcol]
332
+ strategy :
333
+ matrix :
334
+ ARCH : [ "amd64", "arm64", "ppc64le" ]
335
+ fail-fast : false
336
+ steps :
337
+ - name : Check out the codebase.
338
+ uses : actions/checkout@v4
339
+
340
+ # Required to load a multiarch archive to the local image store
341
+ - name : Set up containerd image store
342
+ uses : crazy-max/ghaction-setup-docker@v3
343
+ with :
344
+ daemon-config : |
345
+ {
346
+ "features": {
347
+ "containerd-snapshotter": true
348
+ }
349
+ }
350
+
351
+ - name : Set up QEMU
352
+ if : ${{ matrix.ARCH != 'amd64' }}
353
+ uses : docker/setup-qemu-action@v3
354
+ with :
355
+ platforms : ${{ matrix.ARCH }}
356
+ image : tonistiigi/binfmt:qemu-v7.0.0
357
+
358
+ - uses : actions/download-artifact@v4
359
+ with :
360
+ name : otelcol
361
+ path : ./docker-otelcol
362
+
363
+ - name : Load multiarch docker image
364
+ run : docker load -i ./docker-otelcol/image.tar
299
365
300
366
- name : Run docker image
301
367
run : |
302
368
# ensure the collector can start with the default config file
303
- docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:${{ matrix.ARCH }}
369
+ docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:latest
304
370
sleep 10
305
371
if [ -z "$( docker ps --filter=status=running --filter=name=otelcol -q )" ]; then
306
372
docker logs otelcol
@@ -320,7 +386,7 @@ jobs:
320
386
exit 1
321
387
fi
322
388
for config in $configs; do
323
- docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_CONFIG=/etc/otel/collector/${config} -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:${{ matrix.ARCH }}
389
+ docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_CONFIG=/etc/otel/collector/${config} -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:latest
324
390
sleep 10
325
391
if [ -z "$( docker ps --filter=status=running --filter=name=otelcol -q )" ]; then
326
392
docker logs otelcol
@@ -333,15 +399,15 @@ jobs:
333
399
- name : Check journalctl
334
400
run : |
335
401
# ensure journalctl can run with the collected libraries
336
- docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:${{ matrix.ARCH }}
402
+ docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:latest
337
403
docker exec otelcol /bin/journalctl
338
404
docker rm -f otelcol
339
405
340
406
- name : Check python and java
341
407
if : ${{ matrix.ARCH != 'ppc64le' }}
342
408
run : |
343
409
# ensure python and java can run with the collected libraries
344
- docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:${{ matrix.ARCH }}
410
+ docker run --platform linux/${{ matrix.ARCH }} -d -e SPLUNK_ACCESS_TOKEN=12345 -e SPLUNK_REALM=fake-realm --name otelcol otelcol:latest
345
411
docker exec otelcol /usr/lib/splunk-otel-collector/agent-bundle/bin/python --version
346
412
docker exec otelcol /usr/lib/splunk-otel-collector/agent-bundle/jre/bin/java -version
347
413
# ensure collectd-python plugins were installed
0 commit comments