Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: publish unicorn and registry1 flavors of runtime #519

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/post-release-tests.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
16 changes: 11 additions & 5 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
contents: read

jobs:

tag-new-version:
permissions: write-all
runs-on: ubuntu-latest
Expand Down Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions hack/flavors/common/zarf.yaml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 6 additions & 0 deletions hack/flavors/values/registry1-values.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"zarf.yaml",
"tasks.yaml",
"tasks/build.yaml",
"tasks/test.yaml",
"chart/values.yaml"
]
}
Expand Down
17 changes: 14 additions & 3 deletions tasks/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ variables:
- name: DIR
description: "directory of the zarf.yaml"
default: .
- name: FLAVOR
default: unicorn

tasks:
- name: all
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 16 additions & 3 deletions zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading