|
| 1 | +name: kubernetes-compute-training-cli-jobs-single-step |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: "0 23 * * *" |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + JOB_SELECTOR: |
| 8 | + description: 'Job selector used with grep command to select job workflows' |
| 9 | + required: false |
| 10 | + default: '^cli-jobs-single-step.*yml$' |
| 11 | + JOB_FILTER: |
| 12 | + description: 'Job filter used with grep command to filter out job workflows' |
| 13 | + required: false |
| 14 | + default: 'spark|java' |
| 15 | + TIMEOUT: |
| 16 | + description: 'Timeout of a single job' |
| 17 | + required: false |
| 18 | + default: '120m' |
| 19 | + FILE_TICKET: |
| 20 | + description: 'Whether to file icm ticket: true or false' |
| 21 | + required: false |
| 22 | + default: 'false' |
| 23 | +jobs: |
| 24 | + test: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + env: |
| 27 | + SUBSCRIPTION: 6560575d-fa06-4e7d-95fb-f962e74efd7a |
| 28 | + RESOURCE_GROUP: azureml-examples-rg |
| 29 | + WORKSPACE: amlarc-githubtest-ws |
| 30 | + KEY_VAULT_NAME: amlarcgithubworkflowkv |
| 31 | + KEY_VAULT_SUB: dd94e4df-b58f-4e81-9c5e-bd72a4b2ef9e |
| 32 | + KEY_VAULT_RG: amlarc-github-workflow |
| 33 | + LOCATION: ${{ github.event.inputs.AMLARC_TEST_REGION }} |
| 34 | + |
| 35 | + JOB_SELECTOR: ${{ github.event.inputs.JOB_SELECTOR }} |
| 36 | + JOB_FILTER: ${{ github.event.inputs.JOB_FILTER }} |
| 37 | + JOB_LIST_FILE: kubernetes-compute-training-cli-jobs-single-step.txt |
| 38 | + TIMEOUT: ${{ github.event.inputs.TIMEOUT }} |
| 39 | + |
| 40 | + MIN_SUCCESS_NUM: 1 |
| 41 | + SEVERITY: 3 |
| 42 | + |
| 43 | + TITLE: "[Github Workflow] kubernetes-compute-training-cli-jobs-single-step failed" |
| 44 | + GITHUB_REPO: https://github.com/Azure/azureml-examples |
| 45 | + WORKFLOW_URL: https://github.com/Azure/azureml-examples/actions/workflows/kubernetes-compute-training-cli-jobs-single-step.yml |
| 46 | + TSG_ID: https://microsoft.sharepoint.com/teams/Vienna/_layouts/15/Doc.aspx?sourcedoc=%7B7ebf9ccd-fa20-4e82-8b2b-6c14c9f1740f%7D&action=edit&wd=target(AMLArcTSG.one%7C69e8bdb1-5734-4b07-967a-5a50a91cf040%2FTroubleshooting%20github%20workflow%7C53a1a232-f9f0-4192-b7d2-0474848ebb18%2F)&share=IgHNnL9-IPqCTosrbBTJ8XQPAVwbVLD_kFe92G2Y9a49ROs |
| 47 | + ICM_MESSAGE: "Failed to run cli-jobs-single-step jobs on kubernetes compute!" |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: check out repo |
| 51 | + uses: actions/checkout@v2 |
| 52 | + with: |
| 53 | + ref: sdk-preview |
| 54 | + - name: setup python |
| 55 | + uses: actions/setup-python@v2 |
| 56 | + with: |
| 57 | + python-version: "3.8" |
| 58 | + - name: install tools |
| 59 | + run: | |
| 60 | + pip install shyaml |
| 61 | + bash .github/kubernetes-compute/tool.sh install_tools |
| 62 | + timeout-minutes: 30 |
| 63 | + - name: azure login |
| 64 | + uses: azure/login@v1 |
| 65 | + with: |
| 66 | + creds: ${{secrets.AZ_AE_CREDS}} |
| 67 | + timeout-minutes: 30 |
| 68 | + |
| 69 | + - name: collect jobs |
| 70 | + run: | |
| 71 | + bash .github/kubernetes-compute/tool.sh collect_jobs_from_workflows "$JOB_LIST_FILE" "$JOB_SELECTOR" "$JOB_FILTER" |
| 72 | + timeout-minutes: 30 |
| 73 | + |
| 74 | + - name: run jobs |
| 75 | + run: | |
| 76 | + for job in $(cat $JOB_LIST_FILE); do |
| 77 | + if [[ "$job" = *"yml" ]]; then |
| 78 | + echo "Run job: $job" |
| 79 | + bash .github/kubernetes-compute/tool.sh run_cli_job $job -cr & |
| 80 | + sleep 60 |
| 81 | + else |
| 82 | + echo "Found invalid job: $job" |
| 83 | + fi |
| 84 | + done |
| 85 | +
|
| 86 | + wait |
| 87 | + timeout-minutes: 300 |
| 88 | + |
| 89 | + - name: check jobs |
| 90 | + if: ${{ always() }} |
| 91 | + run: | |
| 92 | + bash .github/kubernetes-compute/tool.sh count_result |
| 93 | + timeout-minutes: 30 |
| 94 | + |
| 95 | + - name: file_icm |
| 96 | + if: ${{ always() }} |
| 97 | + run: | |
| 98 | + bash .github/kubernetes-compute/tool.sh count_result || ret=$? |
| 99 | + if [ "$ret" != "0" ] && [ "$ret" != "" ] && [ "${{ github.event.inputs.FILE_TICKET }}" != "false" ] ; then |
| 100 | + # download certificates |
| 101 | + export ICM_HOST_NAME=ICM-HOST-AML-EXAMPLES |
| 102 | + export ICM_CONNECTOR_ID_NAME=ICM-CONNECTOR-ID-AML-EXAMPLES |
| 103 | + export ICM_ROUTING_ID_NAME=ICM-ROUTING-ID-AML-EXAMPLES |
| 104 | + bash .github/kubernetes-compute/tool.sh download_icm_cert |
| 105 | + export ICM_HOST=$(cat icm_host) |
| 106 | + export CONNECTOR_ID=$(cat icm_connector_id) |
| 107 | + export ROUTING_ID=$(cat icm_routing_id) |
| 108 | + export SUMMARY=$(bash .github/kubernetes-compute/tool.sh gen_summary_for_github_test) |
| 109 | + bash .github/kubernetes-compute/tool.sh file_icm |
| 110 | + fi |
| 111 | + timeout-minutes: 30 |
0 commit comments