Skip to content

BM Ansible Script E2E Test #630

BM Ansible Script E2E Test

BM Ansible Script E2E Test #630

name: BM Ansible Script E2E Test
on:
# This workflow would run at 1 AM every day
schedule:
- cron: '0 1 * * *'
pull_request:
branches: [ '**' ]
permissions:
contents: read
env:
CI_CNO_ANSIBLE_FOLDER: /usr/src/ci_cno_ansible_telemetry_scheduler
CI_CNO_TAS_FOLDER: /usr/src/telemetry-scheduler
jobs:
exit-trigger:
if: ( !contains(github.repository, '/platform-aware-scheduling') )
uses: ./.github/workflows/bm-job-exit-trigger.yaml
with:
runson: self-hosted-ansible
pull-ci:
needs: [ exit-trigger ]
if: ${{ needs.exit-trigger.outputs.ansible-dir != '' || needs.exit-trigger.outputs.cno-ci-repo-name != '' || needs.exit-trigger.outputs.cno-ci-branch-name != '' }}
uses: ./.github/workflows/checkout-cno-ci-repo-job.yaml
with:
runson: self-hosted-ansible
ci-cno-ansible-folder: /usr/src/ci_cno_ansible_telemetry_scheduler
ci-cno-repo-name: ${{ needs.exit-trigger.outputs.cno-ci-repo-name }}
ci-cno-branch-name: ${{ needs.exit-trigger.outputs.cno-ci-branch-name }}
secrets:
CNO_CI_TOKEN: ${{ secrets.PASSWORD_PAT_CNO_CI }}
pull-tas:
needs: [ pull-ci ]
uses: ./.github/workflows/checkout-tas-repo-job.yaml
with:
runson: self-hosted-ansible
ci-cno-tas-ansible-folder: /usr/src/telemetry-scheduler
runscripts:
name: Run ansible scripts for E2E
needs: [ pull-ci, pull-tas ]
runs-on: self-hosted-ansible
defaults:
run:
working-directory: ${{ env.CI_CNO_ANSIBLE_FOLDER }}
env:
CI_CNO_PLAYBOOK_COMMON_FOLDER: /usr/src/ci_cno_ansible_telemetry_scheduler/playbooks/common
CI_CNO_PLAYBOOK_TAS_FOLDER: /usr/src/ci_cno_ansible_telemetry_scheduler/playbooks/tas
ANSIBLE_TELEMETRY_FOLDER_DESTINATION_PARAM: "destination_dir=/usr/src/telemetry-scheduler"
ANSIBLE_TAS_FOLDER_DESTINATION_PARAM: "destination_dir=/usr/src/telemetry-scheduler/telemetry-aware-scheduling/"
steps:
- name: BM Build & test TAS
run: ansible-playbook -i ${{ env.CI_CNO_ANSIBLE_FOLDER }}/inventory_cni.ini ${{ env.CI_CNO_PLAYBOOK_TAS_FOLDER }}/build.yml -e ${{ env.ANSIBLE_TAS_FOLDER_DESTINATION_PARAM }}
- name: BM Smoke Test
run: ansible-playbook -i ${{ env.CI_CNO_ANSIBLE_FOLDER }}/inventory_cni.ini ${{ env.CI_CNO_PLAYBOOK_TAS_FOLDER }}/smokeTest.yml -e ${{ env.ANSIBLE_TAS_FOLDER_DESTINATION_PARAM }}
- name: BM Clean-up TAS
run: ansible-playbook -i ${{ env.CI_CNO_ANSIBLE_FOLDER }}/inventory_cni.ini ${{ env.CI_CNO_PLAYBOOK_TAS_FOLDER }}/clusterCleanup.yml -e ${{ env.ANSIBLE_TAS_FOLDER_DESTINATION_PARAM }}
- name: BM Clean-up
run: ansible-playbook -i ${{ env.CI_CNO_ANSIBLE_FOLDER }}/inventory_cni.ini ${{ env.CI_CNO_PLAYBOOK_COMMON_FOLDER }}/commonCleanup.yml -e ${{ env.ANSIBLE_TELEMETRY_FOLDER_DESTINATION_PARAM }}