-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8529 from OpenMined/yash/helm-upgrade
Add helm upgrade test
- Loading branch information
Showing
3 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: PR Tests - Helm Upgrade | ||
|
||
on: | ||
# Re-enable when we have a stable helm chart | ||
# pull_request: | ||
# branches: | ||
# - dev | ||
# paths: | ||
# - packages/grid/helm/syft/** | ||
|
||
workflow_dispatch: | ||
inputs: | ||
upgrade_type: | ||
description: "Select upgrade path type" | ||
required: false | ||
default: "BetaToDev" | ||
type: choice | ||
options: | ||
- BetaToDev | ||
- ProdToBeta | ||
- ProdToDev | ||
|
||
concurrency: | ||
group: pr-tests-helm-upgrade | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pr-tests-helm-upgrade: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
brew update | ||
# Install python deps | ||
pip install --upgrade pip | ||
pip install tox | ||
# Install kubernetes | ||
brew install helm k3d devspace kubectl | ||
- name: Setup cluster | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
tox -e dev.k8s.start | ||
- name: Upgrade helm chart | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
# default upgrade is beta to dev, but override with input if provided | ||
UPGRADE_TYPE_INPUT=${{ github.event.inputs.upgrade_type }} | ||
export UPGRADE_TYPE=${UPGRADE_TYPE_INPUT:-BetaToDev} | ||
tox -e syft.test.helm.upgrade | ||
- name: Destroy cluster | ||
if: always() | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
tox -e dev.k8s.destroyall |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
HELM_REPO="openmined/syft" | ||
DOMAIN_NAME="test-domain" | ||
KUBE_NAMESPACE="syft" | ||
KUBE_CONTEXT=${KUBE_CONTEXT:-"k3d-syft-dev"} | ||
|
||
UPGRADE_TYPE=$1 | ||
|
||
PROD="openmined/syft" | ||
BETA="openmined/syft --devel" | ||
DEV="./helm/syft" | ||
|
||
if [ "$UPGRADE_TYPE" == "ProdToBeta" ]; then | ||
INSTALL_SOURCE=$PROD # latest published prod | ||
UPGRADE_SOURCE=$BETA # latest published beta | ||
INSTALL_ARGS="" | ||
UPGRADE_ARGS="" | ||
elif [ "$UPGRADE_TYPE" == "BetaToDev" ]; then | ||
INSTALL_SOURCE=$BETA # latest published beta | ||
UPGRADE_SOURCE=$DEV # local chart | ||
INSTALL_ARGS="" | ||
UPGRADE_ARGS="" | ||
elif [ "$UPGRADE_TYPE" == "ProdToDev" ]; then | ||
INSTALL_SOURCE=$PROD # latest published prod | ||
UPGRADE_SOURCE=$DEV # local chart | ||
INSTALL_ARGS="" | ||
UPGRADE_ARGS="" | ||
else | ||
echo Invalid upgrade type $UPGRADE_TYPE | ||
exit 1 | ||
fi | ||
|
||
kubectl config use-context $KUBE_CONTEXT | ||
kubectl delete namespace syft || true | ||
helm repo add openmined https://openmined.github.io/PySyft/helm | ||
helm repo update openmined | ||
|
||
echo Installing syft... | ||
helm install $DOMAIN_NAME $INSTALL_SOURCE $INSTALL_ARGS --namespace $KUBE_NAMESPACE --create-namespace | ||
helm ls -A | ||
|
||
WAIT_TIME=5 bash ./scripts/wait_for.sh service backend --namespace $KUBE_NAMESPACE | ||
WAIT_TIME=5 bash ./scripts/wait_for.sh pod default-pool-0 --namespace $KUBE_NAMESPACE | ||
|
||
echo Upgrading syft... | ||
helm upgrade $DOMAIN_NAME $UPGRADE_SOURCE $UPGRADE_ARGS --namespace $KUBE_NAMESPACE | ||
helm ls -A | ||
|
||
echo "Post-upgrade sleep" && sleep 5 | ||
WAIT_TIME=5 bash ./scripts/wait_for.sh service backend --namespace $KUBE_NAMESPACE |
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