Skip to content

Merge pull request #1199 from shreyabiradar07/test_list_metadata #372

Merge pull request #1199 from shreyabiradar07/test_list_metadata

Merge pull request #1199 from shreyabiradar07/test_list_metadata #372

Workflow file for this run

name: Test on Push
# Controls when the action will run.
on:
# Triggers the workflow on push event but only for the mvp_demo branch
push:
branches: [ mvp_demo ]
paths-ignore:
- 'docs/**'
- 'design/**'
- 'examples/**'
- 'extensions/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
get_pr:
uses: ./.github/workflows/get-pr-number.yaml
# This workflow contains three jobs called "build job" , "deploy autotune" and "deploy crc"
build_job:
needs: get_pr
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Get PR number
run: |
echo "PR_NUMBER=${{ needs.get_pr.outputs.pr_number }}" >> $GITHUB_ENV
- name: Build monitoring
run: |
echo Build monitoring
./build.sh -i autotune_operator:pr_${{ env.PR_NUMBER }} -o autotune_optuna:pr_${{ env.PR_NUMBER }}
docker images | grep autotune
- name: docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Push
run: |
docker tag autotune_operator:pr_${{ env.PR_NUMBER }} kruize/autotune_operator:pr_${{ env.PR_NUMBER }}
docker push kruize/autotune_operator:pr_${{ env.PR_NUMBER }}
deploy_autotune:
# The type of runner that the job will run on
needs: [build_job, get_pr]
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Get PR number
run: |
echo "PR_NUMBER=${{ needs.get_pr.outputs.pr_number }}" >> $GITHUB_ENV
- name: Setup Minikube
uses: manusa/actions-setup-minikube@v2.3.0
with:
minikube version: 'v1.16.0'
kubernetes version: 'v1.19.2'
- name: Display cluster info
run: |
kubectl cluster-info
kubectl get pods -n kube-system
- name: Install Prometheus on minikube
run: |
echo Install Prometheus on minikube
cd scripts
./prometheus_on_minikube.sh -as
- name: Deploy kruize in experiment mode
run: |
echo Deploy Kruize in experiment mode
echo "PR_NUMBER = ${{ env.PR_NUMBER }}"
./deploy.sh -c minikube -i kruize/autotune_operator:pr_${{ env.PR_NUMBER }}
sleep 20
- name: Capture ffdc logs
if: always()
run: |
./scripts/ffdc.sh -d ${GITHUB_WORKSPACE}
- name: Archive results
if: always()
run: |
cd ${GITHUB_WORKSPACE}
tar cvf autotune_results.tar kruize_*log.txt
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: autotune-results
path: ./autotune_results.tar
retention-days: 2
deploy_crc:
# The type of runner that the job will run on
needs: [build_job, get_pr]
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Get PR number
run: |
echo "PR_NUMBER=${{ needs.get_pr.outputs.pr_number }}" >> $GITHUB_ENV
- name: Setup Minikube
uses: manusa/actions-setup-minikube@v2.3.0
with:
minikube version: 'v1.16.0'
kubernetes version: 'v1.19.2'
- name: Display cluster info
run: |
kubectl cluster-info
kubectl get pods -n kube-system
- name: Install Prometheus on minikube
run: |
echo Install Prometheus on minikube
cd scripts
./prometheus_on_minikube.sh -as
- name: Deploy Kruize in crc mode
run: |
echo Deploy Kruize in crc mode
echo "***************************************************************"
cp ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old
sed -e "s/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g" ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml.old > ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml
cat ./manifests/crc/default-db-included-installation/minikube/kruize-crc-minikube.yaml
cd tests
echo "PR_NUMBER = ${{ env.PR_NUMBER }}"
./test_autotune.sh -c minikube -i kruize/autotune_operator:pr_${{ env.PR_NUMBER }} --testsuite=remote_monitoring_tests --testcase=test_e2e --resultsdir=${GITHUB_WORKSPACE}
- name: Capture ffdc logs
if: always()
run: |
./scripts/ffdc.sh -m crc -d ${GITHUB_WORKSPACE}/kruize_test_results
- name: Archive results
if: always()
run: |
cd ${GITHUB_WORKSPACE}
tar cvf crc_results.tar kruize_test_results
- name: Upload results
if: always()
uses: actions/upload-artifact@v3
with:
name: crc-results
path: ./crc_results.tar
retention-days: 2