diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 9786ac36..16acf8cb 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -14,9 +14,22 @@ 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 + push: runs-on: ubuntu-latest - needs: test + needs: [test, smoke-test] permissions: contents: write packages: write @@ -34,19 +47,20 @@ 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 - - name: smoke-test - run: uds run test:smoke - - name: Publish run: | - uds run build:publish-uds-runtime --set REF=nightly-unstable --set DIR=hack/nightly - - - name: Build binary artifacts - run: | - uds run build:all + 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/post-release-tests.yaml b/.github/workflows/post-release-tests.yaml new file mode 100644 index 00000000..948a3841 --- /dev/null +++ b/.github/workflows/post-release-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 against the unicorn and registry1 flavors of the released UDS Runtime packages. +name: Post Release 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/tag-and-release.yaml b/.github/workflows/tag-and-release.yaml index ae48172a..85eeb989 100644 --- a/.github/workflows/tag-and-release.yaml +++ b/.github/workflows/tag-and-release.yaml @@ -12,6 +12,7 @@ permissions: contents: read jobs: + tag-new-version: permissions: write-all runs-on: ubuntu-latest @@ -50,14 +51,19 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: smoke-test - run: uds run test:smoke --set DIR=hack/test + run: uds run test:smoke + + - name: Iron Bank Login + env: + 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 run: | - uds run build:publish-uds-runtime - - - name: Build binary artifacts - run: uds run build:all + 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/hack/flavors/common/zarf.yaml b/hack/flavors/common/zarf.yaml new file mode 100644 index 00000000..fccebde1 --- /dev/null +++ b/hack/flavors/common/zarf.yaml @@ -0,0 +1,26 @@ +# 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/hack/flavors/values/registry1-values.yaml b/hack/flavors/values/registry1-values.yaml new file mode 100644 index 00000000..abc1d6da --- /dev/null +++ b/hack/flavors/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 diff --git a/release-please-config.json b/release-please-config.json index e451f792..eac99705 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 cf6a2226..7483e7c9 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 diff --git a/tasks/test.yaml b/tasks/test.yaml index 690ec695..f2384a9c 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,18 @@ 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-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 zarf package deploy oci://ghcr.io/defenseunicorns/packages/uds/uds-runtime:${REF}-${FLAVOR} --confirm + - task: smoke-tests + + - name: smoke-tests + description: "run smoke tests against nightly runtime" + actions: - description: Validate Runtime Pod wait: cluster: diff --git a/zarf.yaml b/zarf.yaml index 5e33d889..c22933eb 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -16,12 +16,25 @@ variables: components: - name: uds-runtime 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 + - 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: + - hack/flavors/values/registry1-values.yaml