From 2d6e492277ca8854c6bf40eec1e8c8951a7ed21d Mon Sep 17 00:00:00 2001 From: Justin Oursler Date: Tue, 27 Feb 2024 12:40:26 -0600 Subject: [PATCH 1/6] wip: Adding UDS Core smoke test to release workflow. --- .github/workflows/release.yaml | 31 ++++++++++++++++- src/test/bundles/13-uds-core/uds-bundle.yaml | 36 ++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/test/bundles/13-uds-core/uds-bundle.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0a77ea26..1c623abc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -80,9 +80,38 @@ jobs: if: always() uses: ./.github/actions/save-logs - push: + uds-core-test: runs-on: ubuntu-latest needs: validate + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + + - name: Download build artifacts + uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 + with: + name: build-artifacts + path: build/ + + - name: Make UDS-CLI executable + run: | + chmod +x build/uds + + - name: Create UDS Core bundle + run: build/uds create src/test/bundles/13-uds-core/ --confirm --no-progress + shell: bash + + - name: Deploy UDS Core bundle + run: build/uds deploy src/test-bundles/13-uds-core/uds-bundle*.tar.zst --confirm --no-progress + shell: bash + + push: + runs-on: ubuntu-latest + needs: uds-core-test permissions: contents: write steps: diff --git a/src/test/bundles/13-uds-core/uds-bundle.yaml b/src/test/bundles/13-uds-core/uds-bundle.yaml new file mode 100644 index 00000000..4b1ac52a --- /dev/null +++ b/src/test/bundles/13-uds-core/uds-bundle.yaml @@ -0,0 +1,36 @@ +kind: UDSBundle +metadata: + name: uds-core + description: Bundle with Zarf init and UDS Core + architecture: amd64 + version: 0.0.1 + +packages: + - name: uds-k3d + repository: ghcr.io/defenseunicorns/packages/uds-k3d + # renovate: datasource=github-tags depName=defenseunicorns/uds-k3d versioning=semver + ref: 0.3.1 + overrides: + uds-dev-stack: + minio: + variables: + - name: buckets + description: "Set Minio Buckets" + path: buckets + - name: svcaccts + description: "Minio Service Accounts" + path: svcaccts + - name: users + description: "Minio Users" + path: users + - name: policies + description: "Minio policies" + path: policies + + - name: init + repository: oci://ghcr.io/defenseunicorns/packages/init + ref: v0.32.1 + + - name: core + repository: oci://ghcr.io/defenseunicorns/packages/uds/core + ref: 0.9.1-registry1 From 9846e3faabaff0b741cce7273ae09b1b3ffcc93f Mon Sep 17 00:00:00 2001 From: Justin Oursler Date: Tue, 27 Feb 2024 15:13:24 -0600 Subject: [PATCH 2/6] Add validate for uds core components. --- .github/workflows/release.yaml | 16 ++++++++++++++++ src/test/bundles/13-uds-core/uds-bundle.yaml | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1c623abc..ab6cf64c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -109,6 +109,22 @@ jobs: run: build/uds deploy src/test-bundles/13-uds-core/uds-bundle*.tar.zst --confirm --no-progress shell: bash + - name: Validate UDS Core deployment + run: | + build/uds zarf tools wait-for pod app.kubernetes.io/instance=grafana -n grafana + build/uds zarf tools wait-for gateway admin-gateway -n istio-admin-gateway + build/uds zarf tools wait-for gateway passthrough-gateway -n istio-passthrough-gateway + build/uds zarf tools wait-for gateway tenant-gateway -n istio-tenant-gateway + build/uds zarf tools wait-for pod app.kubernetes.io/name=loki -n loki + build/uds zarf tools wait-for pod app.kubernetes.io/component=gateway -n loki + build/uds zarf tools wait-for deployment metrics-server -n metrics-server + build/uds zarf tools wait-for apiservice v1beta1.metrics.k8s.io available + build/uds zarf tools wait-for pod app.kubernetes.io/name=alertmanager -n monitoring # Prometheus + build/uds zarf tools wait-for pod app.kubernetes.io/name=prometheus -n monitoring # Prometheus + build/uds zarf tools wait-for pod app.kubernetes.io/name=kube-state-metrics -n monitoring # Prometheus + build/uds zarf tools wait-for pod app.kubernetes.io/instance=promtail -n promtail + shell: bash + push: runs-on: ubuntu-latest needs: uds-core-test diff --git a/src/test/bundles/13-uds-core/uds-bundle.yaml b/src/test/bundles/13-uds-core/uds-bundle.yaml index 4b1ac52a..f7666e9d 100644 --- a/src/test/bundles/13-uds-core/uds-bundle.yaml +++ b/src/test/bundles/13-uds-core/uds-bundle.yaml @@ -9,7 +9,7 @@ packages: - name: uds-k3d repository: ghcr.io/defenseunicorns/packages/uds-k3d # renovate: datasource=github-tags depName=defenseunicorns/uds-k3d versioning=semver - ref: 0.3.1 + ref: 0.4.0 overrides: uds-dev-stack: minio: @@ -33,4 +33,4 @@ packages: - name: core repository: oci://ghcr.io/defenseunicorns/packages/uds/core - ref: 0.9.1-registry1 + ref: 0.13.1-registry1 From 2e1ba3cb94b598461fbacf394136320621739249 Mon Sep 17 00:00:00 2001 From: Justin Oursler Date: Tue, 27 Feb 2024 15:21:05 -0600 Subject: [PATCH 3/6] Update renovate tags for uds core and zarf. --- src/test/bundles/13-uds-core/uds-bundle.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/bundles/13-uds-core/uds-bundle.yaml b/src/test/bundles/13-uds-core/uds-bundle.yaml index f7666e9d..8e7315ee 100644 --- a/src/test/bundles/13-uds-core/uds-bundle.yaml +++ b/src/test/bundles/13-uds-core/uds-bundle.yaml @@ -29,8 +29,10 @@ packages: - name: init repository: oci://ghcr.io/defenseunicorns/packages/init + # renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver ref: v0.32.1 - name: core repository: oci://ghcr.io/defenseunicorns/packages/uds/core + # renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver ref: 0.13.1-registry1 From b286742a8c1b79132d75d92a9463990f8e3f0d70 Mon Sep 17 00:00:00 2001 From: Justin Oursler Date: Thu, 29 Feb 2024 14:05:45 -0600 Subject: [PATCH 4/6] Use uds-core istio only bundle to deploy from ghcr. --- .github/workflows/release.yaml | 23 +++--------- src/test/bundles/13-uds-core/uds-bundle.yaml | 38 -------------------- 2 files changed, 5 insertions(+), 56 deletions(-) delete mode 100644 src/test/bundles/13-uds-core/uds-bundle.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ab6cf64c..ff42d356 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,6 @@ on: push: tags: - "v*" - jobs: build: runs-on: ubuntu-latest @@ -101,28 +100,16 @@ jobs: run: | chmod +x build/uds - - name: Create UDS Core bundle - run: build/uds create src/test/bundles/13-uds-core/ --confirm --no-progress - shell: bash - - name: Deploy UDS Core bundle - run: build/uds deploy src/test-bundles/13-uds-core/uds-bundle*.tar.zst --confirm --no-progress + # renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver + run: build/uds deploy ghcr.io/defenseunicorns/packages/uds/bundles/k3d-core-istio-dev:0.13.1 --confirm --no-progress shell: bash - name: Validate UDS Core deployment run: | - build/uds zarf tools wait-for pod app.kubernetes.io/instance=grafana -n grafana - build/uds zarf tools wait-for gateway admin-gateway -n istio-admin-gateway - build/uds zarf tools wait-for gateway passthrough-gateway -n istio-passthrough-gateway - build/uds zarf tools wait-for gateway tenant-gateway -n istio-tenant-gateway - build/uds zarf tools wait-for pod app.kubernetes.io/name=loki -n loki - build/uds zarf tools wait-for pod app.kubernetes.io/component=gateway -n loki - build/uds zarf tools wait-for deployment metrics-server -n metrics-server - build/uds zarf tools wait-for apiservice v1beta1.metrics.k8s.io available - build/uds zarf tools wait-for pod app.kubernetes.io/name=alertmanager -n monitoring # Prometheus - build/uds zarf tools wait-for pod app.kubernetes.io/name=prometheus -n monitoring # Prometheus - build/uds zarf tools wait-for pod app.kubernetes.io/name=kube-state-metrics -n monitoring # Prometheus - build/uds zarf tools wait-for pod app.kubernetes.io/instance=promtail -n promtail + build/uds zarf tools wait-for gateway admin-gateway -n istio-admin-gateway --timeout 10s + build/uds zarf tools wait-for gateway passthrough-gateway -n istio-passthrough-gateway --timeout 10s + build/uds zarf tools wait-for gateway tenant-gateway -n istio-tenant-gateway --timeout 10s shell: bash push: diff --git a/src/test/bundles/13-uds-core/uds-bundle.yaml b/src/test/bundles/13-uds-core/uds-bundle.yaml deleted file mode 100644 index 8e7315ee..00000000 --- a/src/test/bundles/13-uds-core/uds-bundle.yaml +++ /dev/null @@ -1,38 +0,0 @@ -kind: UDSBundle -metadata: - name: uds-core - description: Bundle with Zarf init and UDS Core - architecture: amd64 - version: 0.0.1 - -packages: - - name: uds-k3d - repository: ghcr.io/defenseunicorns/packages/uds-k3d - # renovate: datasource=github-tags depName=defenseunicorns/uds-k3d versioning=semver - ref: 0.4.0 - overrides: - uds-dev-stack: - minio: - variables: - - name: buckets - description: "Set Minio Buckets" - path: buckets - - name: svcaccts - description: "Minio Service Accounts" - path: svcaccts - - name: users - description: "Minio Users" - path: users - - name: policies - description: "Minio policies" - path: policies - - - name: init - repository: oci://ghcr.io/defenseunicorns/packages/init - # renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver - ref: v0.32.1 - - - name: core - repository: oci://ghcr.io/defenseunicorns/packages/uds/core - # renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver - ref: 0.13.1-registry1 From cb1a63a76ccc7371ffb1e4b30f527e0c3d920a76 Mon Sep 17 00:00:00 2001 From: Justin Oursler Date: Thu, 29 Feb 2024 15:02:40 -0600 Subject: [PATCH 5/6] Move UDS smoke test from release to nightly. --- .github/workflows/nightly-uds-core.yaml | 44 +++++++++++++++++++++++++ .github/workflows/release.yaml | 35 +------------------- 2 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/nightly-uds-core.yaml diff --git a/.github/workflows/nightly-uds-core.yaml b/.github/workflows/nightly-uds-core.yaml new file mode 100644 index 00000000..ac41598b --- /dev/null +++ b/.github/workflows/nightly-uds-core.yaml @@ -0,0 +1,44 @@ +name: UDS Core Smoke Test +on: + schedule: + - cron: '0 7 * * *' ## Every day at 0700 UTC + + workflow_dispatch: + +permissions: + contents: read + +# Abort prior jobs in the same workflow / PR +concurrency: + group: uds-core-${{ github.ref }} + cancel-in-progress: true + +jobs: + uds-core-test: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 + + - name: Build UDS-CLI binary + run: make build-cli-linux-amd ARCH=amd64 + + - name: Make UDS-CLI executable + run: | + chmod +x build/uds + + - name: Deploy UDS Core bundle + # renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver + run: build/uds deploy ghcr.io/defenseunicorns/packages/uds/bundles/k3d-core-istio-dev:0.13.1 --confirm --no-progress + shell: bash + + - name: Validate UDS Core deployment + run: | + build/uds zarf tools wait-for gateway admin-gateway -n istio-admin-gateway --timeout 10s + build/uds zarf tools wait-for gateway passthrough-gateway -n istio-passthrough-gateway --timeout 10s + build/uds zarf tools wait-for gateway tenant-gateway -n istio-tenant-gateway --timeout 10s + shell: bash diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ff42d356..8e072862 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -79,42 +79,9 @@ jobs: if: always() uses: ./.github/actions/save-logs - uds-core-test: - runs-on: ubuntu-latest - needs: validate - permissions: - contents: read - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 - - - name: Download build artifacts - uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 - with: - name: build-artifacts - path: build/ - - - name: Make UDS-CLI executable - run: | - chmod +x build/uds - - - name: Deploy UDS Core bundle - # renovate: datasource=github-tags depName=defenseunicorns/uds-core versioning=semver - run: build/uds deploy ghcr.io/defenseunicorns/packages/uds/bundles/k3d-core-istio-dev:0.13.1 --confirm --no-progress - shell: bash - - - name: Validate UDS Core deployment - run: | - build/uds zarf tools wait-for gateway admin-gateway -n istio-admin-gateway --timeout 10s - build/uds zarf tools wait-for gateway passthrough-gateway -n istio-passthrough-gateway --timeout 10s - build/uds zarf tools wait-for gateway tenant-gateway -n istio-tenant-gateway --timeout 10s - shell: bash - push: runs-on: ubuntu-latest - needs: uds-core-test + needs: validate permissions: contents: write steps: From 643d97ed0600cf47f090b1f4c484d238f4fef818 Mon Sep 17 00:00:00 2001 From: Justin Oursler Date: Thu, 29 Feb 2024 15:04:16 -0600 Subject: [PATCH 6/6] whitespace --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8e072862..0a77ea26 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,7 @@ on: push: tags: - "v*" + jobs: build: runs-on: ubuntu-latest