@@ -54,11 +54,31 @@ jobs:
54
54
name : agent-bundle-linux-${{ matrix.ARCH }}
55
55
path : ./dist/agent-bundle_linux_${{ matrix.ARCH }}.tar.gz
56
56
57
+ otelcol :
58
+ runs-on : ubuntu-20.04
59
+ strategy :
60
+ matrix :
61
+ ARCH : [ "amd64", "arm64", "ppc64le" ]
62
+ steps :
63
+ - uses : actions/checkout@v4
64
+ with :
65
+ fetch-depth : 0
66
+ - uses : actions/setup-go@v5
67
+ with :
68
+ go-version : ${{ env.GO_VERSION }}
69
+ cache-dependency-path : ' **/go.sum'
70
+ - run : make binaries-linux_${{ matrix.ARCH }}
71
+ - uses : actions/upload-artifact@v4
72
+ with :
73
+ name : otelcol-${{ matrix.ARCH }}
74
+ path : |
75
+ ./bin/*
76
+
57
77
docker-otelcol :
58
78
name : docker-otelcol
59
79
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
60
80
runs-on : ubuntu-20.04
61
- needs : agent-bundle-linux
81
+ needs : [ " agent-bundle-linux", "otelcol" ]
62
82
services :
63
83
# Start a local registry for pushing the multiarch manifest and images
64
84
registry :
@@ -77,12 +97,14 @@ jobs:
77
97
cache-dependency-path : ' **/go.sum'
78
98
- uses : actions/download-artifact@v4
79
99
with :
80
- name : agent-bundle-linux-amd64
100
+ pattern : agent-bundle-linux-*
101
+ merge-multiple : true
81
102
path : ./dist
82
103
- uses : actions/download-artifact@v4
83
104
with :
84
- name : agent-bundle-linux-arm64
85
- path : ./dist
105
+ pattern : otelcol-*
106
+ merge-multiple : true
107
+ path : ./bin
86
108
- uses : docker/setup-qemu-action@v3
87
109
with :
88
110
platforms : arm64,ppc64le
92
114
with :
93
115
driver : docker-container # Create a builder with the docker-container driver required for multiarch builds
94
116
driver-opts : network=host # Required for the builder to push to the local registry service
95
- - run : make docker-otelcol SKIP_BUNDLE=true ARCH=amd64,arm64,ppc64le IMAGE_NAME=localhost:5000/otelcol IMAGE_TAG=latest PUSH=true
117
+ - run : make docker-otelcol SKIP_COMPILE=true SKIP_BUNDLE=true ARCH=amd64,arm64,ppc64le IMAGE_NAME=localhost:5000/otelcol IMAGE_TAG=latest PUSH=true
96
118
env :
97
119
MULTIARCH_OTELCOL_BUILDER : ${{ steps.multiarch-otelcol-builder.outputs.name }} # Use the builder created by the docker/setup-buildx-action step
98
120
- name : Save image archive for each platform to be loaded by downstream jobs
@@ -104,10 +126,6 @@ jobs:
104
126
docker save -o ./docker-otelcol/${arch}/image.tar otelcol:latest
105
127
docker rmi -f localhost:5000/otelcol:latest otelcol:latest
106
128
done
107
- - uses : actions/upload-artifact@v4
108
- with :
109
- name : otelcol
110
- path : ./bin
111
129
- uses : actions/upload-artifact@v4
112
130
with :
113
131
name : docker-otelcol-amd64
@@ -129,7 +147,7 @@ jobs:
129
147
matrix :
130
148
ARCH : [ "amd64", "arm64" ]
131
149
fail-fast : false
132
- needs : [docker-otelcol]
150
+ needs : [ " docker-otelcol", "otelcol" ]
133
151
steps :
134
152
- uses : actions/checkout@v4
135
153
with :
@@ -140,7 +158,7 @@ jobs:
140
158
cache-dependency-path : ' **/go.sum'
141
159
- uses : actions/download-artifact@v4
142
160
with :
143
- name : otelcol
161
+ name : otelcol-${{ matrix.ARCH }}
144
162
path : ./bin
145
163
- uses : actions/download-artifact@v4
146
164
with :
@@ -158,25 +176,26 @@ jobs:
158
176
env :
159
177
SPLUNK_OTEL_COLLECTOR_IMAGE : ' otelcol:latest'
160
178
161
- integration-test :
162
- name : integration-test
179
+ integration-test-docker :
163
180
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
164
181
runs-on : ubuntu-20.04
165
- needs : [docker-otelcol]
182
+ needs : [ " docker-otelcol", "otelcol" ]
166
183
strategy :
167
184
matrix :
168
185
ARCH : [ "amd64", "arm64" ]
169
186
PROFILE : [ "integration", "smartagent" ]
170
187
fail-fast : false
188
+ env :
189
+ TEST_OUTPUT : ${{ github.job }}-${{ matrix.PROFILE }}-${{ matrix.ARCH }}.out
171
190
steps :
172
191
- uses : actions/checkout@v4
173
192
with :
174
193
fetch-depth : 0
175
194
- name : Build ${{ matrix.PROFILE }} service images
176
195
run : |
177
- images=$(yq '.services[] | select(.profiles[] | contains( "${{ matrix.PROFILE }}") ) | .image' docker/docker-compose.yml | grep "quay.io/splunko11ytest/" | sort -u)
196
+ images=$(yq '.services[] | select(.profiles[] | . == "${{ matrix.PROFILE }}") | .image' docker/docker-compose.yml | grep "quay.io/splunko11ytest/" | sort -u)
178
197
for image in $images; do
179
- service=$(echo $image | sed 's|quay.io/splunko11ytest/\(.*\):latest|\1|' )
198
+ service=$(basename " $image" | cut -d ':' -f1 )
180
199
if [[ -f docker/${service}/Dockerfile ]]; then
181
200
docker build --cache-from=quay.io/splunko11ytest/${service}:latest -t quay.io/splunko11ytest/${service}:latest docker/${service}
182
201
fi
@@ -191,7 +210,7 @@ jobs:
191
210
cache-dependency-path : ' **/go.sum'
192
211
- uses : actions/download-artifact@v4
193
212
with :
194
- name : otelcol
213
+ name : otelcol-${{ matrix.ARCH }}
195
214
path : ./bin
196
215
- uses : actions/download-artifact@v4
197
216
with :
@@ -221,7 +240,7 @@ jobs:
221
240
if [[ "${{ matrix.PROFILE }}" = "smartagent" ]]; then
222
241
target="smartagent-integration-test"
223
242
fi
224
- make $target 2>&1 | tee ${{ matrix.PROFILE }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
243
+ make $target 2>&1 | tee $TEST_OUTPUT
225
244
exit_status=${PIPESTATUS[0]}
226
245
echo "Exit status: $exit_status"
227
246
exit $exit_status
@@ -232,8 +251,85 @@ jobs:
232
251
uses : actions/upload-artifact@v4
233
252
if : always()
234
253
with :
235
- name : ${{ matrix.PROFILE }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
236
- path : ${{ matrix.PROFILE }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
254
+ name : ${{ env.TEST_OUTPUT }}
255
+ path : ${{ env.TEST_OUTPUT }}
256
+ retention-days : 5
257
+
258
+ integration-test-binary :
259
+ runs-on : ${{ matrix.RUNNER }}
260
+ needs : [ "agent-bundle-linux", "otelcol" ]
261
+ strategy :
262
+ matrix :
263
+ RUNNER : [ "ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04" ]
264
+ PROFILE : [ "integration", "smartagent" ]
265
+ fail-fast : false
266
+ env :
267
+ TEST_OUTPUT : ${{ github.job }}-${{ matrix.PROFILE }}-${{ matrix.RUNNER }}.out
268
+ steps :
269
+ - uses : actions/checkout@v4
270
+ with :
271
+ fetch-depth : 0
272
+ - name : Build ${{ matrix.PROFILE }} service images
273
+ run : |
274
+ images=$(yq '.services[] | select(.profiles[] | . == "${{ matrix.PROFILE }}") | .image' docker/docker-compose.yml | grep "quay.io/splunko11ytest/" | sort -u)
275
+ for image in $images; do
276
+ service=$(basename "$image" | cut -d ':' -f1)
277
+ if [[ -f docker/${service}/Dockerfile ]]; then
278
+ docker build --cache-from=quay.io/splunko11ytest/${service}:latest -t quay.io/splunko11ytest/${service}:latest docker/${service}
279
+ fi
280
+ done
281
+ docker system prune -f
282
+ docker builder prune -f
283
+ docker images
284
+ - run : docker compose -f docker/docker-compose.yml --profile ${{ matrix.PROFILE }} up -d --quiet-pull
285
+ - uses : actions/setup-go@v5
286
+ with :
287
+ go-version : ${{ env.GO_VERSION }}
288
+ cache-dependency-path : ' **/go.sum'
289
+ - uses : actions/download-artifact@v4
290
+ with :
291
+ pattern : agent-bundle-linux-amd64
292
+ merge-multiple : true
293
+ path : ./dist
294
+ - run : sudo mkdir -p /usr/lib/splunk-otel-collector
295
+ - run : sudo tar -xzf dist/agent-bundle_linux_amd64.tar.gz -C /usr/lib/splunk-otel-collector
296
+ - run : sudo chown -R $USER /usr/lib/splunk-otel-collector
297
+ - run : /usr/lib/splunk-otel-collector/agent-bundle/bin/patch-interpreter /usr/lib/splunk-otel-collector/agent-bundle
298
+ - uses : actions/download-artifact@v4
299
+ with :
300
+ name : otelcol-amd64
301
+ path : ./bin
302
+ - run : ln -sf otelcol_linux_amd64 ./bin/otelcol
303
+ - run : chmod a+x ./bin/*
304
+ - uses : shogo82148/actions-setup-redis@v1
305
+ if : matrix.PROFILE == 'integration'
306
+ with :
307
+ auto-start : false
308
+ redis-port : " 6379"
309
+ - run : redis-cli ping
310
+ if : matrix.PROFILE == 'integration'
311
+ - run : redis-cli set tempkey tempvalue
312
+ if : matrix.PROFILE == 'integration'
313
+ - name : Run Integration Test
314
+ run : |
315
+ set -o pipefail
316
+ target="integration-test"
317
+ if [[ "${{ matrix.PROFILE }}" = "smartagent" ]]; then
318
+ target="smartagent-integration-test"
319
+ fi
320
+ make $target 2>&1 | tee $TEST_OUTPUT
321
+ exit_status=${PIPESTATUS[0]}
322
+ echo "Exit status: $exit_status"
323
+ exit $exit_status
324
+ env :
325
+ SPLUNK_OTEL_COLLECTOR_IMAGE : " "
326
+ # The Integration Test output is extremely large so we upload it as an artifact
327
+ - name : Upload Integration Test Output as Artifact
328
+ uses : actions/upload-artifact@v4
329
+ if : always()
330
+ with :
331
+ name : ${{ env.TEST_OUTPUT }}
332
+ path : ${{ env.TEST_OUTPUT }}
237
333
retention-days : 5
238
334
239
335
integration-test-mongodb-discovery :
@@ -258,7 +354,7 @@ jobs:
258
354
cache-dependency-path : ' **/go.sum'
259
355
- uses : actions/download-artifact@v4
260
356
with :
261
- name : otelcol
357
+ name : otelcol-${{ matrix.ARCH }}
262
358
path : ./bin
263
359
- uses : actions/download-artifact@v4
264
360
with :
@@ -282,6 +378,7 @@ jobs:
282
378
exit $exit_status
283
379
env :
284
380
SPLUNK_OTEL_COLLECTOR_IMAGE : ' otelcol:latest'
381
+
285
382
integration-test-kafkametrics-discovery :
286
383
name : integration-test-kafkametrics-discovery
287
384
runs-on : ubuntu-22.04
@@ -301,7 +398,7 @@ jobs:
301
398
cache-dependency-path : ' **/go.sum'
302
399
- uses : actions/download-artifact@v4
303
400
with :
304
- name : otelcol
401
+ name : otelcol-${{ matrix.ARCH }}
305
402
path : ./bin
306
403
- uses : actions/download-artifact@v4
307
404
with :
0 commit comments