Skip to content

Fix broken Tanzu docs links (#4972) #8643

Fix broken Tanzu docs links (#4972)

Fix broken Tanzu docs links (#4972) #8643

name: "Integration Test"
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/integration-test.yml'
- 'cmd/**'
- 'docker/**'
- 'internal/**'
- 'pkg/**'
- 'tests/**'
- 'Makefile'
- 'Makefile.Common'
- 'go.mod'
- 'go.sum'
- '!**.md'
- '!internal/buildscripts/**'
concurrency:
group: integration-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GO_VERSION: "1.21.11"
jobs:
agent-bundle-linux:
runs-on: ubuntu-20.04
strategy:
matrix:
ARCH: [ "amd64", "arm64" ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: bundle-cache
with:
path: .cache/buildx/agent-bundle-${{ matrix.ARCH }}
key: agent-bundle-buildx-${{ matrix.ARCH }}-${{ hashFiles('internal/signalfx-agent/bundle/**') }}
restore-keys: |
agent-bundle-buildx-${{ matrix.ARCH }}-
- uses: docker/setup-qemu-action@v3
if: ${{ matrix.ARCH != 'amd64' }}
with:
platforms: ${{ matrix.ARCH }}
image: tonistiigi/binfmt:qemu-v7.0.0
- run: make -C internal/signalfx-agent/bundle agent-bundle-linux ARCH=${{ matrix.ARCH }}
env:
BUNDLE_CACHE_HIT: "${{ steps.bundle-cache.outputs.cache-hit }}"
- uses: actions/upload-artifact@v4
with:
name: agent-bundle-linux-${{ matrix.ARCH }}
path: ./dist/agent-bundle_linux_${{ matrix.ARCH }}.tar.gz
docker-otelcol:
name: docker-otelcol
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
needs: agent-bundle-linux
services:
# Start a local registry for pushing the multiarch manifest and images
registry:
image: registry:2
ports:
- 5000:5000
steps:
# Multiarch images require more disk space
- uses: jlumbroso/[email protected]
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- uses: actions/download-artifact@v4
with:
name: agent-bundle-linux-amd64
path: ./dist
- uses: actions/download-artifact@v4
with:
name: agent-bundle-linux-arm64
path: ./dist
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64,ppc64le
image: tonistiigi/binfmt:qemu-v7.0.0
- uses: docker/setup-buildx-action@v3
id: multiarch-otelcol-builder
with:
driver: docker-container # Create a builder with the docker-container driver required for multiarch builds
driver-opts: network=host # Required for the builder to push to the local registry service
- run: make docker-otelcol SKIP_BUNDLE=true ARCH=amd64,arm64,ppc64le IMAGE_NAME=localhost:5000/otelcol IMAGE_TAG=latest PUSH=true
env:
MULTIARCH_OTELCOL_BUILDER: ${{ steps.multiarch-otelcol-builder.outputs.name }} # Use the builder created by the docker/setup-buildx-action step
- name: Save image archive for each platform to be loaded by downstream jobs
run: |
for arch in "amd64" "arm64" "ppc64le"; do
mkdir -p docker-otelcol/${arch}
docker pull --platform=linux/${arch} localhost:5000/otelcol:latest
docker tag localhost:5000/otelcol:latest otelcol:latest
docker save -o ./docker-otelcol/${arch}/image.tar otelcol:latest
docker rmi -f localhost:5000/otelcol:latest otelcol:latest
done
- uses: actions/upload-artifact@v4
with:
name: otelcol
path: ./bin
- uses: actions/upload-artifact@v4
with:
name: docker-otelcol-amd64
path: ./docker-otelcol/amd64
- uses: actions/upload-artifact@v4
with:
name: docker-otelcol-arm64
path: ./docker-otelcol/arm64
- uses: actions/upload-artifact@v4
with:
name: docker-otelcol-ppc64le
path: ./docker-otelcol/ppc64le
integration-vet:
name: integration-vet
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
strategy:
matrix:
ARCH: [ "amd64", "arm64" ]
fail-fast: false
needs: [docker-otelcol]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- uses: actions/download-artifact@v4
with:
name: otelcol
path: ./bin
- uses: actions/download-artifact@v4
with:
name: docker-otelcol-${{ matrix.ARCH }}
path: ./docker-otelcol/${{ matrix.ARCH }}
- uses: docker/setup-qemu-action@v3
if: ${{ matrix.ARCH != 'amd64' }}
with:
platforms: ${{ matrix.ARCH }}
image: tonistiigi/binfmt:qemu-v7.0.0
- run: docker load -i ./docker-otelcol/${{ matrix.ARCH }}/image.tar
- run: ln -sf otelcol_linux_${{ matrix.ARCH }} ./bin/otelcol
- run: chmod a+x ./bin/*
- run: make integration-vet
env:
SPLUNK_OTEL_COLLECTOR_IMAGE: 'otelcol:latest'
integration-test:
name: integration-test
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
needs: [docker-otelcol]
strategy:
matrix:
ARCH: [ "amd64", "arm64" ]
PROFILE: [ "integration", "smartagent" ]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build ${{ matrix.PROFILE }} service images
run: |
images=$(yq '.services[] | select(.profiles[] | contains("${{ matrix.PROFILE }}")) | .image' docker/docker-compose.yml | grep "quay.io/splunko11ytest/" | sort -u)
for image in $images; do
service=$(echo $image | sed 's|quay.io/splunko11ytest/\(.*\):latest|\1|')
if [[ -f docker/${service}/Dockerfile ]]; then
docker build --cache-from=quay.io/splunko11ytest/${service}:latest -t quay.io/splunko11ytest/${service}:latest docker/${service}
fi
done
docker system prune -f
docker builder prune -f
docker images
- run: docker compose -f docker/docker-compose.yml --profile ${{ matrix.PROFILE }} up -d --quiet-pull
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- uses: actions/download-artifact@v4
with:
name: otelcol
path: ./bin
- uses: actions/download-artifact@v4
with:
name: docker-otelcol-${{ matrix.ARCH }}
path: ./docker-otelcol/${{ matrix.ARCH }}
- uses: docker/setup-qemu-action@v3
if: ${{ matrix.ARCH != 'amd64' }}
with:
platforms: ${{ matrix.ARCH }}
image: tonistiigi/binfmt:qemu-v7.0.0
- run: docker load -i ./docker-otelcol/${{ matrix.ARCH }}/image.tar
- run: ln -sf otelcol_linux_${{ matrix.ARCH }} ./bin/otelcol
- run: chmod a+x ./bin/*
- uses: shogo82148/actions-setup-redis@v1
if: matrix.PROFILE == 'integration'
with:
auto-start: false
redis-port: "6379"
- run: redis-cli ping
if: matrix.PROFILE == 'integration'
- run: redis-cli set tempkey tempvalue
if: matrix.PROFILE == 'integration'
- name: Run Integration Test
run: |
set -o pipefail
target="integration-test"
if [[ "${{ matrix.PROFILE }}" = "smartagent" ]]; then
target="smartagent-integration-test"
fi
make $target 2>&1 | tee ${{ matrix.PROFILE }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
exit_status=${PIPESTATUS[0]}
echo "Exit status: $exit_status"
exit $exit_status
env:
SPLUNK_OTEL_COLLECTOR_IMAGE: 'otelcol:latest'
# The Integration Test output is extremely large so we upload it as an artifact
- name: Upload Integration Test Output as Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.PROFILE }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
path: ${{ matrix.PROFILE }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
retention-days: 5
integration-test-mongodb-discovery:
name: integration-test-mongodb-discovery
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
runs-on: ubuntu-20.04
needs: [docker-otelcol]
strategy:
matrix:
ARCH: [ "amd64", "arm64" ]
MONGODB_VERSION: [ "4.0", "4.4", "5.0" ]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: echo "MONGODB_VERSION=${{ matrix.MONGODB_VERSION }}" > docker/.env
- run: docker compose -f docker/docker-compose.yml --profile integration-test-mongodb-discovery up -d --quiet-pull
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: '**/go.sum'
- uses: actions/download-artifact@v4
with:
name: otelcol
path: ./bin
- uses: actions/download-artifact@v4
with:
name: docker-otelcol-${{ matrix.ARCH }}
path: ./docker-otelcol/${{ matrix.ARCH }}
- uses: docker/setup-qemu-action@v3
if: ${{ matrix.ARCH != 'amd64' }}
with:
platforms: ${{ matrix.ARCH }}
image: tonistiigi/binfmt:qemu-v7.0.0
- run: docker load -i ./docker-otelcol/${{ matrix.ARCH }}/image.tar
- run: ln -sf otelcol_linux_${{ matrix.ARCH }} ./bin/otelcol
- run: chmod a+x ./bin/*
- name: Run Discovery Integration Test
run: |
set -o pipefail
target="integration-test-mongodb-discovery"
make $target 2>&1 | tee mongodb-${{ matrix.MONGODB_VERSION }}-${{ github.run_id }}-${{ matrix.ARCH }}.out
exit_status=${PIPESTATUS[0]}
echo "Exit status: $exit_status"
exit $exit_status
env:
SPLUNK_OTEL_COLLECTOR_IMAGE: 'otelcol:latest'