From b6b67ba8db5ca732f4cd8e70dfd6452a634275f7 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 28 Aug 2024 16:23:20 +0200 Subject: [PATCH 01/12] [chore] update package tests with upstream changes Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index bb34830e..ef53dc82 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -52,7 +52,12 @@ trap 'podman rm -fv $container_name >/dev/null 2>&1 || true' EXIT podman build -t "$image_name" --arch "$translated_arch" -f "$SCRIPT_DIR/Dockerfile.test.$pkg_type" "$SCRIPT_DIR" podman rm -fv "$container_name" >/dev/null 2>&1 || true +# test install podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" + +# ensure that the system is up and running by checking if systemctl is running +$container_exec systemctl is-system-running --quiet --wait + podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml install_pkg "$container_name" "$PKG_PATH" From 49fa187a4e734d1977475c6ef6e197577782178e Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 08:18:17 +0200 Subject: [PATCH 02/12] add sleep Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index ef53dc82..f23ee44c 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -56,6 +56,7 @@ podman rm -fv "$container_name" >/dev/null 2>&1 || true podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running +sleep 2 $container_exec systemctl is-system-running --quiet --wait podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml From 4c081f834cb5ae974f75e0f5ad1cf90cdc70056d Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 08:39:40 +0200 Subject: [PATCH 03/12] debugging Signed-off-by: Moritz Wiesinger --- .github/workflows/snapshot.yaml | 1 + internal/testbed/linux-services/package-tests.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml index 88f5dec6..1074095b 100644 --- a/.github/workflows/snapshot.yaml +++ b/.github/workflows/snapshot.yaml @@ -53,6 +53,7 @@ jobs: runs-on: ubuntu-22.04 needs: build strategy: + fail-fast: false matrix: os: ["deb", "rpm"] arch: ["x86_64", "arm64"] diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index f23ee44c..317b1875 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -56,7 +56,7 @@ podman rm -fv "$container_name" >/dev/null 2>&1 || true podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running -sleep 2 +sleep 5 $container_exec systemctl is-system-running --quiet --wait podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml From 099f8bca59c67c3314996cb0540c8d412559828e Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 08:56:01 +0200 Subject: [PATCH 04/12] try better caching Signed-off-by: Moritz Wiesinger --- .github/workflows/snapshot.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml index 1074095b..cfda8047 100644 --- a/.github/workflows/snapshot.yaml +++ b/.github/workflows/snapshot.yaml @@ -16,16 +16,21 @@ jobs: - uses: actions/setup-go@v5 with: go-version: "~1.22.6" + cache: false - uses: docker/setup-qemu-action@v3 with: platforms: arm64 - uses: docker/setup-buildx-action@v3 - uses: anchore/sbom-action/download-syft@v0.17.2 - - name: Cache tools + - run: make generate + - name: Cache uses: actions/cache@v4 with: - path: .tools - key: snapshot-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }} + path: | + .tools + ~/.cache/go-build + ~/go/pkg/mod + key: snapshot-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum', 'build/go.sum') }} - name: Touch tools run: | mkdir -p .tools From bf442057f2c2e4bfe73c665dc500566f9107e1e9 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 09:15:58 +0200 Subject: [PATCH 05/12] more debugging Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index 317b1875..8ec40527 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -63,7 +63,7 @@ podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /et install_pkg "$container_name" "$PKG_PATH" # ensure service has started and still running after 5 seconds -sleep 5 +sleep 4 echo "Checking $SERVICE_NAME service status ..." $container_exec systemctl --no-pager status "$SERVICE_NAME" From 0cfa86f3a84f98d90c623df0110a8278ae1e6668 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 09:34:48 +0200 Subject: [PATCH 06/12] try to improve cache Signed-off-by: Moritz Wiesinger --- .github/workflows/snapshot.yaml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml index cfda8047..af903380 100644 --- a/.github/workflows/snapshot.yaml +++ b/.github/workflows/snapshot.yaml @@ -16,25 +16,32 @@ jobs: - uses: actions/setup-go@v5 with: go-version: "~1.22.6" - cache: false - uses: docker/setup-qemu-action@v3 with: platforms: arm64 - uses: docker/setup-buildx-action@v3 - uses: anchore/sbom-action/download-syft@v0.17.2 - - run: make generate - - name: Cache + - name: Cache tools uses: actions/cache@v4 + id: cache-tools with: - path: | - .tools - ~/.cache/go-build - ~/go/pkg/mod - key: snapshot-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum', 'build/go.sum') }} - - name: Touch tools + path: .tools + key: snapshot-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }} + - name: Install tools + if: steps.cache-tools.outputs.cache-hit != 'true' run: | mkdir -p .tools touch .tools/* + make install-tools + - name: Generate source files + run: make generate + - name: Cache go modules + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: snapshot-mods-${{ runner.os }}-${{ hashFiles('build/go.sum') }} - name: Create Snapshot for Pull Request run: make snapshot - name: Upload Pull Request Preview From 7ad105953f0cddd2c5cb6585665d7a5427db5d65 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 09:52:46 +0200 Subject: [PATCH 07/12] disable setup-go cache Signed-off-by: Moritz Wiesinger --- .github/workflows/snapshot.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml index af903380..df0dac99 100644 --- a/.github/workflows/snapshot.yaml +++ b/.github/workflows/snapshot.yaml @@ -16,6 +16,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: "~1.22.6" + cache: false - uses: docker/setup-qemu-action@v3 with: platforms: arm64 From fe787f4c192b2be4f0b13bbbbad8cd5689c71d54 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 09:55:06 +0200 Subject: [PATCH 08/12] debugging Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index 8ec40527..967f1a66 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -57,7 +57,7 @@ podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running sleep 5 -$container_exec systemctl is-system-running --quiet --wait +$container_exec systemctl is-system-running --wait podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml install_pkg "$container_name" "$PKG_PATH" From d3f8c7ad958ee183c21f23bd1eb983d895892bd7 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 10:10:08 +0200 Subject: [PATCH 09/12] more debugging Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index 967f1a66..1c8bac28 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -58,6 +58,7 @@ podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running sleep 5 $container_exec systemctl is-system-running --wait +$container_exec systemctl --failed podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml install_pkg "$container_name" "$PKG_PATH" From 73263d8babacf2592b7ed22a6abcb49d6c26b9e1 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 10:17:40 +0200 Subject: [PATCH 10/12] more debugging Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index 1c8bac28..4de99269 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -56,9 +56,9 @@ podman rm -fv "$container_name" >/dev/null 2>&1 || true podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running -sleep 5 -$container_exec systemctl is-system-running --wait +sleep 10 $container_exec systemctl --failed +$container_exec systemctl is-system-running --wait podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml install_pkg "$container_name" "$PKG_PATH" From 5baf01e18a6f49a2c42499ba96401f8107b5719a Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 10:28:07 +0200 Subject: [PATCH 11/12] test without health check Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index 4de99269..e623a054 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -56,9 +56,9 @@ podman rm -fv "$container_name" >/dev/null 2>&1 || true podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running -sleep 10 -$container_exec systemctl --failed -$container_exec systemctl is-system-running --wait +#sleep 10 +#$container_exec systemctl --failed +#$container_exec systemctl is-system-running --wait podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml install_pkg "$container_name" "$PKG_PATH" From 383c10575a143f66821b450c5361417d2b06d38d Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 29 Aug 2024 10:50:43 +0200 Subject: [PATCH 12/12] more debugging Signed-off-by: Moritz Wiesinger --- internal/testbed/linux-services/package-tests.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/testbed/linux-services/package-tests.sh b/internal/testbed/linux-services/package-tests.sh index e623a054..d2cf5112 100755 --- a/internal/testbed/linux-services/package-tests.sh +++ b/internal/testbed/linux-services/package-tests.sh @@ -56,9 +56,10 @@ podman rm -fv "$container_name" >/dev/null 2>&1 || true podman run --name "$container_name" --arch "$translated_arch" -d "$image_name" # ensure that the system is up and running by checking if systemctl is running -#sleep 10 -#$container_exec systemctl --failed -#$container_exec systemctl is-system-running --wait +sleep 3 +$container_exec systemctl --failed +$container_exec systemctl --no-pager list-unit-files +$container_exec systemctl is-system-running --wait podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml install_pkg "$container_name" "$PKG_PATH"