CD_Dev #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow test deployment of latest dev release | |
name: CD_Dev | |
permissions: | |
contents: read | |
concurrency: | |
group: cd_dev | |
cancel-in-progress: true | |
on: | |
# push: | |
# branches: [master] | |
# pull_request: | |
# branches: [master] | |
workflow_run: | |
workflows: [Publish] | |
branches: [master] | |
types: [completed] | |
workflow_dispatch: | |
inputs: | |
alt_version: | |
required: false | |
description: Provide expected semver for `installer_check` job. If empty `VERSION+<git commit>` in repo will be used | |
default: '' | |
env: | |
USE_VERSION: ${{ github.event.inputs.alt_version }} | |
K3D_VERSION: v5.4.1 | |
jobs: | |
# Perform E2E sanity checks | |
verify_latest_releases: | |
name: Verify latest run ${{ matrix.run }} (${{ matrix.cluster_type }}) on (${{ matrix.os }}), | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
cluster_type: [local,k8] | |
run: [r1] | |
env: | |
SLEEP: 10 | |
TOPIC: foobar | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up K3d for Ubuntu | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash | |
- name: Set up K8 for ubuntu(kind) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: ./k8-util/cluster/reset-k3d.sh | |
- name: Install Docker for Mac | |
if: ${{ matrix.os == 'macos-12' }} | |
uses: docker-practice/actions-setup-docker@master | |
- name: Set up Kind for Mac | |
if: ${{ matrix.os == 'macos-12' }} | |
run: | | |
brew install kind | |
kind create cluster --config k8-util/cluster/kind.yaml | |
- name: Install Fluvio CLI | |
run: | | |
curl -fsS https://hub.infinyon.cloud/install/install.sh | VERSION=latest FLV_VERSION=latest bash | |
echo "$HOME/.fluvio/bin" >> $GITHUB_PATH | |
- name: Install Local Fluvio cluster | |
timeout-minutes: 3 | |
if: ${{ matrix.cluster_type == 'local' }} | |
run: fluvio cluster start --local | |
- name: Install k8 Fluvio cluster | |
timeout-minutes: 3 | |
if: ${{ matrix.cluster_type == 'k8' }} | |
run: | | |
if [[ ${{ matrix.os }} == 'macos-12' ]]; then | |
export PROXY="--proxy-addr 127.0.0.1" | |
else | |
export PROXY="" | |
fi | |
fluvio cluster start --spu-storage-size 1 $PROXY | |
- name: Run E2E Test | |
timeout-minutes: 2 | |
run: | | |
date +"%Y-%m-%dT%H:%M:%S%z" | |
fluvio version | |
fluvio topic create ${{ env.TOPIC }} | |
# wait for topic to be created | |
sleep ${{ env.SLEEP }} | |
date +"%Y-%m-%dT%H:%M:%S%z" | |
echo foo | fluvio produce ${{ env.TOPIC }} | |
fluvio consume ${{ env.TOPIC }} --start 0 -d | grep -F -w "foo" | |
# Delete the topic afterword but this looks to not work right now. | |
# fluvio topic delete "${{ env.TOPIC }}" | |
- name: Run diagnostics | |
if: ${{ !success() }} | |
timeout-minutes: 5 | |
run: fluvio cluster diagnostics | |
- name: Upload diagnostics | |
uses: actions/upload-artifact@v3 | |
timeout-minutes: 5 | |
if: ${{ !success() }} | |
with: | |
name: cd_failure_${{ matrix.run }}_${{ matrix.cluster_type }} | |
path: diagnostics*.gz | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
if: ${{ !success() }} | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
# Perform upgrade test from previous stable version to latest | |
k8_cluster_upgrade: | |
name: Kubernetes cluster upgrade test | |
# if: false | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
rust: [stable] | |
env: | |
FLV_SOCKET_WAIT: 600 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup K3d | |
run: | | |
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash | |
./k8-util/cluster/reset-k3d.sh | |
- name: Run upgrade test | |
timeout-minutes: 10 | |
env: | |
TEST_DATA_BYTES: 10000 | |
run: | | |
export PATH=~/.fluvio/bin:$PATH | |
USE_LATEST=true make upgrade-test | |
- name: Run diagnostics | |
if: ${{ !success() }} | |
timeout-minutes: 5 | |
run: ~/.fluvio/bin/fluvio cluster diagnostics --k8 | |
- name: Upload diagnostics | |
uses: actions/upload-artifact@v3 | |
timeout-minutes: 5 | |
if: ${{ !success() }} | |
with: | |
name: cluster-upgrade-diag | |
path: diagnostics*.gz | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
if: ${{ !success() }} | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
# Verify latest version of CLI | |
installer_check: | |
name: Installer check | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
version: [latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set the expected fluvio version | |
run: | | |
if [[ -z "${{ env.USE_VERSION }}" ]]; then | |
echo "EXPECTED_VERSION=$(cat VERSION)+$(git rev-parse HEAD)" | tee -a $GITHUB_ENV | |
else | |
echo "EXPECTED_VERSION=${{ github.event.inputs.alt_version }}" | tee -a $GITHUB_ENV | |
fi | |
echo "EXPECTED_VERSION: $EXPECTED_VERSION" | |
- name: Curl Install - latest | |
if: matrix.version == 'latest' | |
run: | | |
echo "VERSION=latest" | tee -a $GITHUB_ENV | |
echo "FLV_VERSION=latest" | tee -a $GITHUB_ENV | |
# Utilizes the env var set in the previous step | |
- name: Curl Install | |
run: curl -fsS https://hub.infinyon.cloud/install/install.sh | bash | tee /tmp/installer.version | |
- name: Verify installer output | |
run: | | |
INSTALLER_VERSION=$(cat /tmp/installer.version | grep "Downloading Fluvio" | grep -v "channel" | awk '{print $5}') | |
if [ "$INSTALLER_VERSION" = "$EXPECTED_VERSION" ]; then | |
echo "✅ Installer version check passed: $EXPECTED_VERSION"; | |
else | |
echo "❌ Installer version check failed"; | |
echo "Version reported by installer: $INSTALLER_VERSION"; | |
echo "Expected version: $EXPECTED_VERSION"; | |
exit 1; | |
fi | |
cli-platform-cross-version-test: | |
name: CLI (${{ matrix.cli_version }}) x Platform (${{ matrix.cluster_version }}) version test | |
#if: false | |
runs-on: ${{ matrix.os }} | |
env: | |
FLUVIO_BIN: ~/.fluvio/bin/fluvio | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
cluster_version: [stable, latest] | |
cli_version: [stable, latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup BATS | |
uses: mig4/setup-bats@v1 | |
with: | |
bats-version: 1.2.1 | |
- name: Setup K3d | |
run: curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=${{ env.K3D_VERSION }} bash | |
- name: Create K3d cluster | |
run: | | |
./k8-util/cluster/reset-k3d.sh | |
- name: Setup bin path | |
run: echo "~/.fluvio/bin" >> $GITHUB_PATH | |
- name: Install stable CLI and start Fluvio cluster | |
timeout-minutes: 10 | |
run: | | |
curl -fsS https://hub.infinyon.cloud/install/install.sh | VERSION=${{ matrix.cluster_version }} bash | |
fluvio cluster start | |
- name: CLI ${{ matrix.cli_version }} x Cluster ${{ matrix.cluster_version }} | |
run: | | |
make FLUVIO_BIN=~/.fluvio/bin/fluvio SKIP_SETUP=true CLI_VERSION=${{ matrix.cli_version }} CLUSTER_VERSION=${{ matrix.cluster_version }} cli-platform-cross-version-test | |
- name: Run diagnostics | |
if: ${{ !success() }} | |
timeout-minutes: 5 | |
run: fluvio cluster diagnostics --k8 | |
- name: Upload diagnostics | |
uses: actions/upload-artifact@v3 | |
timeout-minutes: 5 | |
if: ${{ !success() }} | |
with: | |
name: cli-platform-cross-version-test | |
path: diagnostics*.gz | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v3 | |
if: ${{ !success() }} | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} |