mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-23 13:51:06 -05:00
Add CI action to install CSI drivers
This commit is contained in:
parent
ad15c7f84d
commit
94429c8db8
30
.github/actions/constellation_destroy/action.yml
vendored
30
.github/actions/constellation_destroy/action.yml
vendored
@ -1,8 +1,30 @@
|
|||||||
name: Constellation destroy
|
name: Constellation destroy
|
||||||
description: "Destroy a running Constellation cluster."
|
description: "Destroy a running Constellation cluster."
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Constellation terminate
|
- name: Delete PVs
|
||||||
run: constellation terminate --yes
|
shell: bash
|
||||||
shell: bash
|
run: |
|
||||||
|
ELAPSED=0
|
||||||
|
kubectl delete pvc --all --wait=true || true
|
||||||
|
echo "::group::Wait for PV deletion"
|
||||||
|
until [ "$(kubectl get pv -o json | jq '.items | length')" == "0" ] || [ $ELAPSED -gt $PV_DELETION_TIMEOUT ];
|
||||||
|
do
|
||||||
|
echo $(kubectl get pv -o json | jq '.items | length') PV remaining..
|
||||||
|
sleep 1
|
||||||
|
ELAPSED=$((ELAPSED+1))
|
||||||
|
done
|
||||||
|
if [ $ELAPSED -gt $PV_DELETION_TIMEOUT ]; then
|
||||||
|
echo "Timed out waiting for PV deletion.."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "::endgroup::"
|
||||||
|
env:
|
||||||
|
KUBECONFIG: ${{ github.workspace }}/constellation-admin.conf
|
||||||
|
PV_DELETION_TIMEOUT: "120" # 2 minutes timeout for pv deletion
|
||||||
|
|
||||||
|
- name: Constellation terminate
|
||||||
|
run: constellation terminate --yes
|
||||||
|
shell: bash
|
||||||
|
35
.github/actions/install_csi_drivers/action.yml
vendored
Normal file
35
.github/actions/install_csi_drivers/action.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
name: Install CSI drivers
|
||||||
|
description: Installs the Constellation CSI drivers depending on the cloud provider.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
cloudProvider:
|
||||||
|
description: |
|
||||||
|
Cloud provider for the Constellation cluster.
|
||||||
|
Either 'gcp' or 'azure'.
|
||||||
|
required: true
|
||||||
|
kubeconfig:
|
||||||
|
description: "The kubeconfig of the cluster to test."
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install Constellation GCP CSI driver and create storage class
|
||||||
|
if: inputs.cloudProvider == 'gcp'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
kubectl apply -k github.com/edgelesssys/constellation-gcp-compute-persistent-disk-csi-driver/deploy/kubernetes/overlays/edgeless/latest
|
||||||
|
kubectl wait -n kube-system deployments csi-gce-pd-controller --for condition=available
|
||||||
|
kubectl apply -f .github/actions/install_csi_drivers/gcp_sc.yml
|
||||||
|
env:
|
||||||
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
||||||
|
|
||||||
|
- name: Install Constellation Azure CSI driver and create storage class
|
||||||
|
if: inputs.cloudProvider == 'azure'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
helm install azuredisk-csi-driver https://raw.githubusercontent.com/edgelesssys/constellation-azuredisk-csi-driver/main/charts/edgeless/latest/azuredisk-csi-driver.tgz --namespace kube-system --set linux.distro=fedora --set controller.replicas=1
|
||||||
|
kubectl wait -n kube-system deployments csi-azuredisk-controller --for condition=available --timeout=300s
|
||||||
|
kubectl apply -f .github/actions/install_csi_drivers/azure_sc.yml
|
||||||
|
env:
|
||||||
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
30
.github/actions/k-bench/action.yml
vendored
30
.github/actions/k-bench/action.yml
vendored
@ -16,7 +16,7 @@ runs:
|
|||||||
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # tag=v4.3.0
|
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # tag=v4.3.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Install evaluation dependencies
|
- name: Install evaluation dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: pip install -r .github/actions/k-bench/evaluate/requirements.txt
|
run: pip install -r .github/actions/k-bench/evaluate/requirements.txt
|
||||||
@ -26,7 +26,7 @@ runs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
repository: "edgelesssys/k-bench"
|
repository: "edgelesssys/k-bench"
|
||||||
ref: 'feat/constellation'
|
ref: "feat/constellation"
|
||||||
path: k-bench
|
path: k-bench
|
||||||
|
|
||||||
- name: Install patched K-Bench
|
- name: Install patched K-Bench
|
||||||
@ -34,25 +34,11 @@ runs:
|
|||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Install Constellation GCP CSI driver and create storage class
|
- name: Install Constellation CSI drivers and create storage class
|
||||||
if: ${{ inputs.cloudProvider == 'gcp' }}
|
uses: ./.github/actions/install_csi_drivers
|
||||||
shell: bash
|
with:
|
||||||
run: |
|
kubeconfig: ${{ inputs.kubeconfig }}
|
||||||
kubectl apply -k github.com/edgelesssys/constellation-gcp-compute-persistent-disk-csi-driver/deploy/kubernetes/overlays/edgeless/latest
|
cloudProvider: ${{ inputs.cloudProvider }}
|
||||||
kubectl wait -n kube-system deployments csi-gce-pd-controller --for condition=available
|
|
||||||
kubectl apply -f .github/actions/k-bench/gcp_sc.yml
|
|
||||||
env:
|
|
||||||
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
||||||
|
|
||||||
- name: Install Constellation Azure CSI driver and create storage class
|
|
||||||
if: ${{ inputs.cloudProvider == 'azure' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
helm install azuredisk-csi-driver https://raw.githubusercontent.com/edgelesssys/constellation-azuredisk-csi-driver/main/charts/edgeless/latest/azuredisk-csi-driver.tgz --namespace kube-system --set linux.distro=fedora --set controller.replicas=1
|
|
||||||
kubectl wait -n kube-system deployments csi-azuredisk-controller --for condition=available --timeout=300s
|
|
||||||
kubectl apply -f .github/actions/k-bench/azure_sc.yml
|
|
||||||
env:
|
|
||||||
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
||||||
|
|
||||||
- name: Run K-Bench
|
- name: Run K-Bench
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -84,7 +70,7 @@ runs:
|
|||||||
kubectl delete namespace kbench-pod-namespace --wait=true || true
|
kubectl delete namespace kbench-pod-namespace --wait=true || true
|
||||||
echo "::group::Wait for PV deletion"
|
echo "::group::Wait for PV deletion"
|
||||||
until [ "$(kubectl get pv -o json | jq '.items | length')" == "0" ] || [ $ELAPSED -gt $PV_DELETION_TIMEOUT ];
|
until [ "$(kubectl get pv -o json | jq '.items | length')" == "0" ] || [ $ELAPSED -gt $PV_DELETION_TIMEOUT ];
|
||||||
do
|
do
|
||||||
echo $(kubectl get pv -o json | jq '.items | length') PV remaining..
|
echo $(kubectl get pv -o json | jq '.items | length') PV remaining..
|
||||||
sleep 1
|
sleep 1
|
||||||
ELAPSED=$((ELAPSED+1))
|
ELAPSED=$((ELAPSED+1))
|
||||||
|
Loading…
Reference in New Issue
Block a user