Add endpoint evaluation component #14807
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: assets-validation | |
| on: | |
| push: | |
| branches: | |
| - release | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - labeled | |
| - unlabeled | |
| - synchronize | |
| - reopened | |
| workflow_dispatch: | |
| inputs: | |
| asset_dirs: | |
| description: Asset directories | |
| default: assets | |
| required: true | |
| env: | |
| default_asset_dirs: assets | |
| scripts_azureml_assets_dir: scripts/azureml-assets | |
| scripts_assets_dir: scripts/azureml-assets/azureml/assets | |
| scripts_release_dir: scripts/release | |
| asset_config_filename: asset.yaml | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| # Required for OIDC login to Azure | |
| id-token: write | |
| # Required to clone repo | |
| contents: read | |
| jobs: | |
| check-directory-file-changes: | |
| uses: Azure/azureml-assets/.github/workflows/check-changed-files.yaml@main | |
| with: | |
| folder_path: "assets/**" | |
| forked_pr_input: false | |
| validate: | |
| name: Validate | |
| needs: check-directory-file-changes | |
| if: needs.check-directory-file-changes.outputs.files-changed != '' | |
| runs-on: ubuntu-latest | |
| environment: Testing | |
| steps: | |
| - name: Clone branch | |
| uses: actions/checkout@v3 | |
| - name: Use Python 3.10 or newer | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Log in to Azure | |
| env: | |
| # to use in condition | |
| client_id: ${{ secrets.AZURE_CLIENT_ID }} | |
| tenant_id: ${{ secrets.AZURE_TENANT_ID }} | |
| subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| if: env.client_id != '' && env.tenant_id != '' | |
| uses: azure/login@v1 | |
| with: | |
| client-id: ${{ env.client_id }} | |
| tenant-id: ${{ env.tenant_id }} | |
| subscription-id: ${{ env.subscription_id }} | |
| - name: Install dependencies | |
| run: pip install -e $scripts_azureml_assets_dir azureml-registry-tools | |
| - name: Validate assets | |
| id: validate_assets | |
| run: | | |
| echo "Changed files: ${{ needs.check-directory-file-changes.outputs.files-changed }}" | |
| echo "Added files: ${{ needs.check-directory-file-changes.outputs.files-added }}" | |
| python -u $scripts_assets_dir/validate_assets.py -i "${{ github.event.inputs.asset_dirs || env.default_asset_dirs }}" -a $asset_config_filename -c "${{ needs.check-directory-file-changes.outputs.files-changed }}" -d "${{ needs.check-directory-file-changes.outputs.files-added }}" -n -I -C -b -t -e | |
| env: | |
| SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| # - name: Validate models with model schema | |
| # id: validate-models | |
| # run: python -u -m azureml.registry.data.validate_model_schema -i "${{ github.event.inputs.asset_dirs || env.default_asset_dirs }}" | |
| - name: Validate models with model variant schema | |
| id: validate-model-variants | |
| run: python -u -m azureml.registry.data.validate_model_variant_schema -i "${{ github.event.inputs.asset_dirs || env.default_asset_dirs }}" | |
| - name: Check PR labels for "mlflow noncompliant exception" label if new MLFlow model was detected | |
| if: fromJSON(steps.validate_assets.outputs.mlflow_model_detected || 'false') && !contains(github.event.pull_request.labels.*.name, 'mlflow noncompliant exception') | |
| run: | | |
| echo "::error::This PR contains an MLFlow model which is banned from the model catalog. Please reach out to System Registry Content team if you have any questions." | |
| exit 1 | |
| - name: Validate source tree | |
| run: python -u $scripts_assets_dir/validate_tree.py -i "${{ github.event.inputs.asset_dirs || env.default_asset_dirs }}" | |
| - name: Check test coverage | |
| run: | | |
| mkdir -p ${{ runner.temp }}/test_coverage | |
| python -u $scripts_release_dir/test_file_convert.py -i "${{ github.event.inputs.asset_dirs || env.default_asset_dirs }}" -r ${{ runner.temp }}/test_coverage |