[DPE-7414] create reference architecture #11
This file contains hidden or 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
| name: Reference Architecture Testing (MicroK8s) | |
| on: | |
| pull_request: | |
| # workflow_dispatch: | |
| # inputs: | |
| # k8s_version: | |
| # description: 'Kubernetes version to be used for the AKS cluster' | |
| # required: false | |
| # default: "1.32" | |
| # charmed_spark_version: | |
| # description: 'Charmed Spark version to be tested' | |
| # required: false | |
| # default: "3.4" | |
| # juju_version: | |
| # description: 'Charmed Spark version to be tested' | |
| # required: false | |
| # default: "3.6" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| microk8s-deployment: | |
| runs-on: ["self-hosted", "linux", "X64", "jammy", "xlarge"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Update ENV variables from inputs if available | |
| run: | | |
| K8S_VERSION="1.32" | |
| # ${{ inputs.k8s_version }} | |
| echo "K8S_VERSION=${K8S_VERSION}" >> $GITHUB_ENV | |
| JUJU_VERSION="3.6" | |
| echo "JUJU_VERSION=${JUJU_VERSION}" >> $GITHUB_ENV | |
| RUN_VERSION="spark-${_K8S_VERSION//./_}" | |
| RESOURCE_GROUP=${RUN_VERSION}_rg | |
| echo "RESOURCE_GROUP=${RESOURCE_GROUP}" >> $GITHUB_ENV | |
| - name: Install CLI tools | |
| run: | | |
| # Install python tooling | |
| pip install tox | |
| pip install poetry | |
| # Install general tools via snaps | |
| sudo snap install charmcraft --classic | |
| sudo snap install terraform --channel latest/stable --classic | |
| # Check versions | |
| terraform --version | |
| - name: Setup operator environment | |
| uses: charmed-kubernetes/actions-operator@main | |
| with: | |
| juju-channel: ${{ env.JUJU_VERSION }}/stable | |
| provider: microk8s | |
| channel: ${{ env.K8S_VERSION }}-strict/stable | |
| microk8s-group: snap_microk8s | |
| microk8s-addons: "rbac dns minio metallb:10.64.140.43-10.64.140.49" | |
| - uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AKS_SERVICE_PRINCIPAL }} | |
| - name: Deploy Kyuubi Reference Architecture | |
| working-directory: ./python/tests/reference_architecture/azure | |
| run: | | |
| terraform init | |
| source get-vars.sh | |
| export TF_VAR_AZURE_RESOURCE_GROUP="test_microk8s_${{ env.RESOURCE_GROUP }}" | |
| _NAME="microk8s${{ env.RESOURCE_GROUP }}" | |
| export TF_VAR_AZURE_STORAGE_ACCOUNT=${_NAME//[_-]/} | |
| terraform apply -auto-approve | |
| juju wait-for model cos --query='forEach(units, unit => unit.agent-status=="idle" && unit.workload-status=="active")' --timeout 30m0s | |
| juju wait-for model spark --query='forEach(units, unit => unit.agent-status=="idle" && unit.workload-status=="active")' --timeout 30m0s | |
| - name: Get juju status | |
| if: always() | |
| run: | | |
| juju status --model cos | |
| juju status --model spark | |
| - name: Run Kyuubi UATs | |
| working-directory: ./python | |
| run: | | |
| tox -e integration-kyuubi -- --no-deploy --keep-models --model spark --cos-model cos | |
| - name: Get juju debug logs | |
| run: juju debug-log --replay --no-tail | |
| if: failure() || cancelled() | |
| - name: Tear down deployment | |
| if: always() | |
| working-directory: ./python/tests/reference_architecture/azure | |
| run: | | |
| source get-vars.sh | |
| export TF_VAR_AZURE_RESOURCE_GROUP="test_microk8s_${{ env.RESOURCE_GROUP }}" | |
| _NAME="microk8s${{ env.RESOURCE_GROUP }}" | |
| export TF_VAR_AZURE_STORAGE_ACCOUNT=${_NAME//[_-]/} | |
| terraform destroy -auto-approve |