From f4b06ccd7320154db9d6d43f7e2e573e9739129d Mon Sep 17 00:00:00 2001 From: Razz4780 Date: Thu, 2 Jan 2025 11:17:08 +0100 Subject: [PATCH] Running session in the CI --- .github/workflows/ci.yaml | 40 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8001f62..c70f741 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ on: jobs: sanity: runs-on: ubuntu-latest - name: helm-sanity debug + name: sanity render chart steps: - uses: actions/checkout@v4 - uses: azure/setup-helm@v4.1.0 @@ -23,7 +23,7 @@ jobs: operator-install: runs-on: ubuntu-latest - name: helm install & check install + name: install chart steps: - uses: actions/checkout@v4 - name: start minikube @@ -37,8 +37,35 @@ jobs: run: kubectl create namespace namespace1 && kubectl create namespace namespace2 - name: check installing the chart with various `values` yamls run: ./test_values_files.sh + + operator-install-and-use: + runs-on: ubuntu-latest + name: install chart and run session + steps: + - uses: actions/checkout@v4 + - name: start minikube + uses: medyagh/setup-minikube@master + with: + container-runtime: ${{ inputs.container-runtime }} + cpus: 'max' + memory: '4gb' + - uses: azure/setup-helm@v4.1.0 + - name: prepare operator license + env: + MIRRORD_OPERATOR_LICENSE: ${{ secrets.MIRRORD_OPERATOR_LICENSE }} + run: echo $MIRRORD_OPERATOR_LICENSE | base64 --decode > license.pem + - name: print license file hash + run: cat license.pem | sha256sum - name: install the chart - run: helm install mirrord-operator --set license.file.data."license\\.pem"=$MIRRORD_OPERATOR_LICENSE --set operator.disableTelemetries=true --set operator.podAnnotations."annotation\.metalbear\.co/name"="operator" --set operator.podAnnotations."annotation\.metalbear\.co/version"="latest" --set operator.podLabels."label\.metalbear\.co/name"="operator" --set operator.podLabels."label\.metalbear\.co/version"="latest" ./mirrord-operator --wait + run: | + helm install mirrord-operator \ + --set license.file.data."license\\.pem"="$(cat license.pem)" \ + --set operator.disableTelemetries=true \ + --set operator.podAnnotations."annotation\.metalbear\.co/name"="operator" \ + --set operator.podAnnotations."annotation\.metalbear\.co/version"="latest" \ + --set operator.podLabels."label\.metalbear\.co/name"="operator" \ + --set operator.podLabels."label\.metalbear\.co/version"="latest" \ + ./mirrord-operator --wait - name: wait for the operator status uses: nick-fields/retry@v3 with: @@ -46,3 +73,10 @@ jobs: max_attempts: 5 retry_wait_seconds: 1 command: kubectl get mirrordoperators.operator.metalbear.co operator -o yaml + - name: download latest mirrord binary + run: curl -LO https://github.com/metalbear-co/mirrord/releases/latest/download/mirrord_linux_x86_64 && chmod +x ./mirrord_linux_x86_64 + - name: run dummy mirrord session + run: MIRRORD_OPERATOR_ENABLE=true MIRRORD_TELEMETRY=false ./mirrord_linux_x86_64 exec -- echo whatever + - name: get operator logs + if: failure() + run: kubectl logs -n mirrord deployment/mirrord-operator