From 22c70e8a586750d71d07d51d35e3e2c11e0bab5f Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Thu, 31 Oct 2024 10:52:59 -0600 Subject: [PATCH 01/12] initial updates --- .github/workflows/nightly-release.yaml | 4 ---- .github/workflows/tag-and-release.yaml | 3 --- zarf.yaml | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 9786ac36c..8244f6ce9 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -44,10 +44,6 @@ jobs: run: | uds run build:publish-uds-runtime --set REF=nightly-unstable --set DIR=hack/nightly - - name: Build binary artifacts - run: | - uds run build:all - - name: Update nightly-unstable tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index ae48172a8..bd22729f5 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -56,9 +56,6 @@ jobs: run: | uds run build:publish-uds-runtime - - name: Build binary artifacts - run: uds run build:all - - name: Tar ui/build for release run: tar -czf build/uds-runtime-ui.tar.gz ui/build diff --git a/zarf.yaml b/zarf.yaml index 5e33d889a..3087ecfb1 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -16,6 +16,8 @@ variables: components: - name: uds-runtime required: true + only: + flavor: unicorn # x-release-please-start-version images: - ghcr.io/defenseunicorns/uds-runtime:0.8.0 @@ -25,3 +27,18 @@ components: localPath: ./chart namespace: uds-runtime version: 0.1.0 + - name: uds-runtime + required: true + only: + flavor: registry1 + cluster: + architecture: amd64 + # x-release-please-start-version + images: + - registry1.dso.mil/ironbank/opensource/defenseunicorns/uds/runtime:v0.8.0 + # x-release-please-end + charts: + - name: uds-runtime + localPath: ./chart + namespace: uds-runtime + version: 0.1.0 From f6d404b10819deb7181ec7cbca878ca91b7cd2b6 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Thu, 31 Oct 2024 13:51:07 -0600 Subject: [PATCH 02/12] release registry1 and unicorn flavors of runtime --- .github/workflows/nightly-release.yaml | 3 ++- .github/workflows/tag-and-release.yaml | 3 ++- tasks/build.yaml | 17 ++++++++++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 8244f6ce9..d57576d68 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -42,7 +42,8 @@ jobs: - name: Publish run: | - uds run build:publish-uds-runtime --set REF=nightly-unstable --set DIR=hack/nightly + uds run build:publish-uds-runtime --set REF=nightly-unstable --set FLAVOR=unicorn --set DIR=hack/nightly + uds run build:publish-uds-runtime --set REF=nightly-unstable --set FLAVOR=registry1 --set DIR=hack/nightly - name: Update nightly-unstable tag env: diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index bd22729f5..1d522ae2c 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -54,7 +54,8 @@ jobs: - name: Publish run: | - uds run build:publish-uds-runtime + uds run build:publish-uds-runtime --set FLAVOR=unicorn + uds run build:publish-uds-runtime --set FLAVOR=registry1 - name: Tar ui/build for release run: tar -czf build/uds-runtime-ui.tar.gz ui/build diff --git a/tasks/build.yaml b/tasks/build.yaml index cf6a22265..7483e7c92 100644 --- a/tasks/build.yaml +++ b/tasks/build.yaml @@ -10,6 +10,8 @@ variables: - name: DIR description: "directory of the zarf.yaml" default: . + - name: FLAVOR + default: unicorn tasks: - name: all @@ -79,17 +81,26 @@ tasks: - name: build-zarf-packages description: "build the uds runtime zarf packages (multi-arch)" actions: - - cmd: ./uds zarf p create --set REF=${REF} -a amd64 -o build --confirm + - cmd: ./uds zarf p create --set REF=${REF} -a amd64 --flavor ${FLAVOR} -o build --confirm dir: ${DIR} - - cmd: ./uds zarf p create --set REF=${REF} -a arm64 -o build --confirm + - cmd: | + # dont build arm64 for registry1 since IB images are only amd64 + if [ "${FLAVOR}" != "registry1" ]; then + ./uds zarf p create --set REF=${REF} -a arm64 --flavor ${FLAVOR} -o build --confirm + fi dir: ${DIR} + - name: publish-zarf-packages description: "publish uds runtime zarf packages (multi-arch)" actions: - cmd: ./uds zarf p publish build/zarf-package-uds-runtime-amd64-${REF}.tar.zst oci://ghcr.io/defenseunicorns/packages/uds dir: ${DIR} - - cmd: ./uds zarf p publish build/zarf-package-uds-runtime-arm64-${REF}.tar.zst oci://ghcr.io/defenseunicorns/packages/uds + - cmd: | + # dont publish arm64 for registry1 since IB images are only amd64 + if [ "${FLAVOR}" != "registry1" ]; then + ./uds zarf p publish build/zarf-package-uds-runtime-arm64-${REF}.tar.zst oci://ghcr.io/defenseunicorns/packages/uds + fi dir: ${DIR} - name: smoke-img-pkg-amd From 1732104271fa9591efdd22a7e0c50d85b052dd92 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Thu, 31 Oct 2024 14:25:10 -0600 Subject: [PATCH 03/12] add ironbank login --- .github/workflows/nightly-release.yaml | 7 +++++++ .github/workflows/tag-and-release.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index d57576d68..96d62e966 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -34,6 +34,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Iron Bank Login + env: + REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil + shell: bash + - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) uses: ./.github/actions/setup diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index 1d522ae2c..38d2d4611 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -49,6 +49,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Iron Bank Login + env: + REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil + shell: bash + - name: smoke-test run: uds run test:smoke --set DIR=hack/test From a069cbb7117092a9d4c96da8daad875a8dfbce43 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Thu, 31 Oct 2024 15:31:47 -0600 Subject: [PATCH 04/12] add registry1 values --- zarf.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zarf.yaml b/zarf.yaml index 3087ecfb1..b4603bd94 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -42,3 +42,5 @@ components: localPath: ./chart namespace: uds-runtime version: 0.1.0 + valuesFiles: + - values/registry1-values.yaml From e06d06ba63f36b8d8151b2d08d5f20299e841ba6 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Thu, 31 Oct 2024 15:33:15 -0600 Subject: [PATCH 05/12] add registry1 values --- values/registry1-values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 values/registry1-values.yaml diff --git a/values/registry1-values.yaml b/values/registry1-values.yaml new file mode 100644 index 000000000..abc1d6dad --- /dev/null +++ b/values/registry1-values.yaml @@ -0,0 +1,6 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + +image: + repository: registry1.dso.mil/ironbank/opensource/defenseunicorns/uds/runtime + tag: v0.8.0 From f20541d36941a90a551e213ea3cebc96c676f7d7 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Thu, 31 Oct 2024 15:39:25 -0600 Subject: [PATCH 06/12] remove unused release please tag --- zarf.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/zarf.yaml b/zarf.yaml index b4603bd94..d4be958af 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -33,10 +33,8 @@ components: flavor: registry1 cluster: architecture: amd64 - # x-release-please-start-version images: - registry1.dso.mil/ironbank/opensource/defenseunicorns/uds/runtime:v0.8.0 - # x-release-please-end charts: - name: uds-runtime localPath: ./chart From 585bec3a82e56c24eec8bb43ffa9c5d4a8b795b4 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Fri, 1 Nov 2024 13:03:04 -0600 Subject: [PATCH 07/12] add flavor smoke tests --- .github/workflows/nightly-release.yaml | 4 +++- .github/workflows/tag-and-release.yaml | 4 +++- release-please-config.json | 1 + tasks/build.yaml | 5 ++++ tasks/test.yaml | 32 ++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 96d62e966..dff689a48 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -45,7 +45,9 @@ jobs: uses: ./.github/actions/setup - name: smoke-test - run: uds run test:smoke + run: | + uds run test:smoke + uds run test:smoke-flavors - name: Publish run: | diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index 38d2d4611..6adaa596a 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -57,7 +57,9 @@ jobs: shell: bash - name: smoke-test - run: uds run test:smoke --set DIR=hack/test + run: | + uds run test:smoke + uds run test:smoke-flavors - name: Publish run: | diff --git a/release-please-config.json b/release-please-config.json index e451f792b..eac99705a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -14,6 +14,7 @@ "zarf.yaml", "tasks.yaml", "tasks/build.yaml", + "tasks/test.yaml", "chart/values.yaml" ] } diff --git a/tasks/build.yaml b/tasks/build.yaml index 7483e7c92..f2cdb99e5 100644 --- a/tasks/build.yaml +++ b/tasks/build.yaml @@ -129,3 +129,8 @@ tasks: - cmd: docker build --build-arg TARGETARCH=$UDS_ARCH -t uds-runtime:test -f ./Dockerfile . - cmd: uds zarf package create -o build/e2e --confirm dir: hack/test + + - name: nightly-flavor-package + description: "build flavored package for nightly testing" + actions: + - cmd: uds zarf package create -o hack/test/build/nightly --flavor ${FLAVOR} --confirm diff --git a/tasks/test.yaml b/tasks/test.yaml index 690ec6956..1a898e02b 100644 --- a/tasks/test.yaml +++ b/tasks/test.yaml @@ -7,6 +7,15 @@ includes: - core-utils: https://raw.githubusercontent.com/defenseunicorns/uds-core/refs/tags/v0.29.1/tasks/utils.yaml - common-setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/refs/tags/v0.13.1/tasks/setup.yaml +variables: + - name: REF + description: "reference for the runtime image and zarf package" + # x-release-please-start-version + default: 0.8.0 + # x-release-please-end + - name: FLAVOR + default: unicorn + tasks: - name: deploy-runtime-cluster description: deploy cluster specifically for testing UDS Runtime @@ -141,6 +150,22 @@ tasks: - task: setup:slim-cluster - cmd: uds zarf package deploy build/smoke/zarf-package-uds-runtime-amd64-test.tar.zst --confirm dir: hack/test + - task: smoke-tests + + - name: smoke-flavors + description: "run smoke tests against runtime flavors in the cluster (only runs with amd64 arch due to registry1 limitations)" + actions: + - task: setup:slim-cluster + - cmd: uds run -f tasks/test.yaml install-flavored-runtime-in-cluster --set FLAVOR=unicorn + - task: smoke-tests + - cmd: uds zarf package remove uds-runtime --confirm + - cmd: uds zarf tools kubectl delete ns uds-runtime + - cmd: uds run -f tasks/test.yaml install-flavored-runtime-in-cluster --set FLAVOR=registry1 + - task: smoke-tests + + - name: smoke-tests + description: "run smoke tests against nightly runtime" + actions: - description: Validate Runtime Pod wait: cluster: @@ -180,6 +205,13 @@ tasks: - cmd: uds zarf package deploy build/e2e/zarf-package-uds-runtime-$UDS_ARCH-test.tar.zst --confirm dir: hack/test + - name: install-flavored-runtime-in-cluster + description: "Install uds-runtime flavor in the cluster" + actions: + - cmd: uds run -f tasks/build.yaml nightly-flavor-package --set FLAVOR=${FLAVOR} + - cmd: uds zarf package deploy build/nightly/zarf-package-uds-runtime-$UDS_ARCH-$REF.tar.zst --confirm + dir: hack/test + - name: create-test-keycloak-user description: creates a doug user in keycloak actions: From a79696e69d861629082851c46a742477d63ce7ce Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Fri, 1 Nov 2024 15:38:46 -0600 Subject: [PATCH 08/12] smoke-flavor smoke test refactor --set cleanup --- .github/workflows/nightly-release.yaml | 43 ++++++++++++++++++++++---- .github/workflows/tag-and-release.yaml | 42 ++++++++++++++++++++++--- tasks/test.yaml | 10 ++---- 3 files changed, 77 insertions(+), 18 deletions(-) diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index dff689a48..2d63c3699 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -14,9 +14,45 @@ jobs: test: uses: ./.github/workflows/pr-tests.yaml + smoke-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + + - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) + uses: ./.github/actions/setup + + - name: smoke-test + run: | + uds run test:smoke + + smoke-test-flavors: + runs-on: ubuntu-latest + strategy: + matrix: + flavor: [registry1, unicorn] + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + + - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) + uses: ./.github/actions/setup + + - name: Iron Bank Login + env: + REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil + shell: bash + + - name: smoke-test + run: | + uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} + push: runs-on: ubuntu-latest - needs: test + needs: [test, smoke-test, smoke-test-flavors] permissions: contents: write packages: write @@ -44,11 +80,6 @@ jobs: - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) uses: ./.github/actions/setup - - name: smoke-test - run: | - uds run test:smoke - uds run test:smoke-flavors - - name: Publish run: | uds run build:publish-uds-runtime --set REF=nightly-unstable --set FLAVOR=unicorn --set DIR=hack/nightly diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index 6adaa596a..f6c23bea4 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -12,9 +12,46 @@ permissions: contents: read jobs: + smoke-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + + - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) + uses: ./.github/actions/setup + + - name: smoke-test + run: | + uds run test:smoke + + smoke-test-flavors: + runs-on: ubuntu-latest + strategy: + matrix: + flavor: [registry1, unicorn] + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + + - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) + uses: ./.github/actions/setup + + - name: Iron Bank Login + env: + REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil + shell: bash + + - name: smoke-test + run: | + uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} + tag-new-version: permissions: write-all runs-on: ubuntu-latest + needs: [smoke-test, smoke-test-flavors] outputs: release_created: ${{ steps.release-flag.outputs.release_created }} release_tag: ${{ steps.release-tag.outputs.release_tag }} @@ -56,11 +93,6 @@ jobs: run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil shell: bash - - name: smoke-test - run: | - uds run test:smoke - uds run test:smoke-flavors - - name: Publish run: | uds run build:publish-uds-runtime --set FLAVOR=unicorn diff --git a/tasks/test.yaml b/tasks/test.yaml index 1a898e02b..395bb4a26 100644 --- a/tasks/test.yaml +++ b/tasks/test.yaml @@ -152,15 +152,11 @@ tasks: dir: hack/test - task: smoke-tests - - name: smoke-flavors + - name: smoke-flavor description: "run smoke tests against runtime flavors in the cluster (only runs with amd64 arch due to registry1 limitations)" actions: - task: setup:slim-cluster - - cmd: uds run -f tasks/test.yaml install-flavored-runtime-in-cluster --set FLAVOR=unicorn - - task: smoke-tests - - cmd: uds zarf package remove uds-runtime --confirm - - cmd: uds zarf tools kubectl delete ns uds-runtime - - cmd: uds run -f tasks/test.yaml install-flavored-runtime-in-cluster --set FLAVOR=registry1 + - task: install-flavored-runtime-in-cluster - task: smoke-tests - name: smoke-tests @@ -208,7 +204,7 @@ tasks: - name: install-flavored-runtime-in-cluster description: "Install uds-runtime flavor in the cluster" actions: - - cmd: uds run -f tasks/build.yaml nightly-flavor-package --set FLAVOR=${FLAVOR} + - task: build:nightly-flavor-package - cmd: uds zarf package deploy build/nightly/zarf-package-uds-runtime-$UDS_ARCH-$REF.tar.zst --confirm dir: hack/test From 149a9fb3a9981376b137e32aae9e9390ae1bd02b Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Mon, 4 Nov 2024 11:35:46 -0700 Subject: [PATCH 09/12] add separate work flow and dry up package setup --- .github/workflows/flavor-tests.yaml | 36 +++++++++++++++ .github/workflows/nightly-release.yaml | 25 +---------- .github/workflows/tag-and-release.yaml | 45 +++---------------- hack/flavors/common/zarf.yaml | 25 +++++++++++ .../flavors/values}/registry1-values.yaml | 0 zarf.yaml | 14 +++--- 6 files changed, 73 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/flavor-tests.yaml create mode 100644 hack/flavors/common/zarf.yaml rename {values => hack/flavors/values}/registry1-values.yaml (100%) diff --git a/.github/workflows/flavor-tests.yaml b/.github/workflows/flavor-tests.yaml new file mode 100644 index 000000000..8847e9545 --- /dev/null +++ b/.github/workflows/flavor-tests.yaml @@ -0,0 +1,36 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + +# This workflow runs smoke tests for the unicorn and registry1 flavors of UDS Runtime. +name: Flavor Tests +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * 1" # Runs Mondays at 9:00 AM UTC, which is 3:00 AM MT during Daylight Saving Time + +permissions: + contents: read + +jobs: + smoke-test-flavors: + runs-on: ubuntu-latest + strategy: + matrix: + flavor: [registry1, unicorn] + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + + - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) + uses: ./.github/actions/setup + + - name: Iron Bank Login + env: + REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil + shell: bash + + - name: smoke-test + run: | + uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 2d63c3699..16acf8cb7 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -27,32 +27,9 @@ jobs: run: | uds run test:smoke - smoke-test-flavors: - runs-on: ubuntu-latest - strategy: - matrix: - flavor: [registry1, unicorn] - steps: - - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) - uses: ./.github/actions/setup - - - name: Iron Bank Login - env: - REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} - run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil - shell: bash - - - name: smoke-test - run: | - uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} - push: runs-on: ubuntu-latest - needs: [test, smoke-test, smoke-test-flavors] + needs: [test, smoke-test] permissions: contents: write packages: write diff --git a/.github/workflows/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index f6c23bea4..85eeb989e 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -12,46 +12,10 @@ permissions: contents: read jobs: - smoke-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) - uses: ./.github/actions/setup - - - name: smoke-test - run: | - uds run test:smoke - - smoke-test-flavors: - runs-on: ubuntu-latest - strategy: - matrix: - flavor: [registry1, unicorn] - steps: - - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - - - name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d) - uses: ./.github/actions/setup - - - name: Iron Bank Login - env: - REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} - run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil - shell: bash - - - name: smoke-test - run: | - uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} tag-new-version: permissions: write-all runs-on: ubuntu-latest - needs: [smoke-test, smoke-test-flavors] outputs: release_created: ${{ steps.release-flag.outputs.release_created }} release_tag: ${{ steps.release-tag.outputs.release_tag }} @@ -86,11 +50,14 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: smoke-test + run: uds run test:smoke + - name: Iron Bank Login env: - REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} - run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil + REGISTRY1_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY1_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + run: echo "${{ env.REGISTRY1_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY1_USERNAME }}" --password-stdin registry1.dso.mil shell: bash - name: Publish diff --git a/hack/flavors/common/zarf.yaml b/hack/flavors/common/zarf.yaml new file mode 100644 index 000000000..1fe3e100d --- /dev/null +++ b/hack/flavors/common/zarf.yaml @@ -0,0 +1,25 @@ +# Copyright 2024 Defense Unicorns +# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial +kind: ZarfPackageConfig +metadata: + name: uds-common-runtime + description: "UDS Common Runtime" +components: + - name: uds-runtime + required: true + charts: + - name: uds-runtime + localPath: ../../../chart + namespace: uds-runtime + version: 0.1.0 + actions: + onDeploy: + after: + - description: Validate Runtime Package + maxTotalSeconds: 300 + wait: + cluster: + kind: packages.uds.dev + name: uds-runtime + namespace: uds-runtime + condition: "'{.status.phase}'=Ready" diff --git a/values/registry1-values.yaml b/hack/flavors/values/registry1-values.yaml similarity index 100% rename from values/registry1-values.yaml rename to hack/flavors/values/registry1-values.yaml diff --git a/zarf.yaml b/zarf.yaml index d4be958af..c22933eb4 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -18,27 +18,23 @@ components: required: true only: flavor: unicorn + import: + path: hack/flavors/common # x-release-please-start-version images: - ghcr.io/defenseunicorns/uds-runtime:0.8.0 # x-release-please-end - charts: - - name: uds-runtime - localPath: ./chart - namespace: uds-runtime - version: 0.1.0 - name: uds-runtime required: true only: flavor: registry1 cluster: architecture: amd64 + import: + path: hack/flavors/common images: - registry1.dso.mil/ironbank/opensource/defenseunicorns/uds/runtime:v0.8.0 charts: - name: uds-runtime - localPath: ./chart - namespace: uds-runtime - version: 0.1.0 valuesFiles: - - values/registry1-values.yaml + - hack/flavors/values/registry1-values.yaml From 171e02790fb18636a97da50c98f6a4d28341a955 Mon Sep 17 00:00:00 2001 From: decleaver <85503726+decleaver@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:01:30 -0700 Subject: [PATCH 10/12] Update hack/flavors/common/zarf.yaml Co-authored-by: UncleGedd <42304551+UncleGedd@users.noreply.github.com> --- hack/flavors/common/zarf.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/flavors/common/zarf.yaml b/hack/flavors/common/zarf.yaml index 1fe3e100d..fccebde14 100644 --- a/hack/flavors/common/zarf.yaml +++ b/hack/flavors/common/zarf.yaml @@ -1,5 +1,6 @@ # Copyright 2024 Defense Unicorns # SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial + kind: ZarfPackageConfig metadata: name: uds-common-runtime From e12b8072bceb23b130dd3652cba9d4d83c4b7e53 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Mon, 4 Nov 2024 13:10:56 -0700 Subject: [PATCH 11/12] workflow rename and lint fix --- .../{flavor-tests.yaml => post-release-tests.yaml} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{flavor-tests.yaml => post-release-tests.yaml} (72%) diff --git a/.github/workflows/flavor-tests.yaml b/.github/workflows/post-release-tests.yaml similarity index 72% rename from .github/workflows/flavor-tests.yaml rename to .github/workflows/post-release-tests.yaml index 8847e9545..948a3841c 100644 --- a/.github/workflows/flavor-tests.yaml +++ b/.github/workflows/post-release-tests.yaml @@ -1,8 +1,8 @@ # Copyright 2024 Defense Unicorns # SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial -# This workflow runs smoke tests for the unicorn and registry1 flavors of UDS Runtime. -name: Flavor Tests +# This workflow runs smoke tests against the unicorn and registry1 flavors of the released UDS Runtime packages. +name: Post Release Tests on: workflow_dispatch: schedule: @@ -26,11 +26,11 @@ jobs: - name: Iron Bank Login env: - REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + REGISTRY_USERNAME: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} run: echo "${{ env.REGISTRY_PASSWORD }}" | uds zarf tools registry login -u "${{ env.REGISTRY_USERNAME }}" --password-stdin registry1.dso.mil shell: bash - name: smoke-test run: | - uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} + uds run test:smoke-flavor --set FLAVOR=${{ matrix.flavor }} From 8011a1aa741e0b828d831e755fa223e54bd2b992 Mon Sep 17 00:00:00 2001 From: Darcy Cleaver Date: Mon, 4 Nov 2024 16:17:32 -0700 Subject: [PATCH 12/12] clean up tasks --- tasks/build.yaml | 5 ----- tasks/test.yaml | 9 +-------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/tasks/build.yaml b/tasks/build.yaml index f2cdb99e5..7483e7c92 100644 --- a/tasks/build.yaml +++ b/tasks/build.yaml @@ -129,8 +129,3 @@ tasks: - cmd: docker build --build-arg TARGETARCH=$UDS_ARCH -t uds-runtime:test -f ./Dockerfile . - cmd: uds zarf package create -o build/e2e --confirm dir: hack/test - - - name: nightly-flavor-package - description: "build flavored package for nightly testing" - actions: - - cmd: uds zarf package create -o hack/test/build/nightly --flavor ${FLAVOR} --confirm diff --git a/tasks/test.yaml b/tasks/test.yaml index 395bb4a26..f2384a9c1 100644 --- a/tasks/test.yaml +++ b/tasks/test.yaml @@ -156,7 +156,7 @@ tasks: description: "run smoke tests against runtime flavors in the cluster (only runs with amd64 arch due to registry1 limitations)" actions: - task: setup:slim-cluster - - task: install-flavored-runtime-in-cluster + - cmd: uds zarf package deploy oci://ghcr.io/defenseunicorns/packages/uds/uds-runtime:${REF}-${FLAVOR} --confirm - task: smoke-tests - name: smoke-tests @@ -201,13 +201,6 @@ tasks: - cmd: uds zarf package deploy build/e2e/zarf-package-uds-runtime-$UDS_ARCH-test.tar.zst --confirm dir: hack/test - - name: install-flavored-runtime-in-cluster - description: "Install uds-runtime flavor in the cluster" - actions: - - task: build:nightly-flavor-package - - cmd: uds zarf package deploy build/nightly/zarf-package-uds-runtime-$UDS_ARCH-$REF.tar.zst --confirm - dir: hack/test - - name: create-test-keycloak-user description: creates a doug user in keycloak actions: