From d99637ec8211a5ab5806a6bbcdd8e91a7e1d3cdd Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:07:17 +0200 Subject: [PATCH 1/7] Changes --- .github/workflows/mlflow.yml | 13 ------------- .github/workflows/modelcard.yml | 7 +------ modelcard.yaml | 8 +++++++- 3 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/mlflow.yml diff --git a/.github/workflows/mlflow.yml b/.github/workflows/mlflow.yml deleted file mode 100644 index 28c83e7b..00000000 --- a/.github/workflows/mlflow.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Modelcard sync with MLflow run -on: - workflow_dispatch: {} - -jobs: - mlflow: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/mlflow-run-id - env: - MLFLOW_TRACKING_URI: ${{ secrets.MLFLOW_TRACKING_URI }} diff --git a/.github/workflows/modelcard.yml b/.github/workflows/modelcard.yml index 87046ebc..25d208eb 100644 --- a/.github/workflows/modelcard.yml +++ b/.github/workflows/modelcard.yml @@ -1,12 +1,9 @@ name: modelcard-test on: - push: - branches: - - demos/* pull_request: branches: - - main + - master workflow_dispatch: jobs: @@ -18,7 +15,5 @@ jobs: - name: Check for model card file uses: CompliancePal/modelcard-action@main - env: - MLFLOW_TRACKING_URI: ${{ secrets.MLFLOW_TRACKING_URI }} with: modelcard: modelcard.yaml diff --git a/modelcard.yaml b/modelcard.yaml index 033d1dd3..274a23e2 100644 --- a/modelcard.yaml +++ b/modelcard.yaml @@ -1,5 +1,11 @@ model_details: name: Wine prediction version: - name: 1.0.0 + name: '' date: 2022-11-03 + description: | + + ## Wine quality prediction + This model predicts the quality of wine batches based on physicochemical inputs and sensory outputs. + references: + reference: http://made-up-exam.ple/ From 2408fe4afec5e7e49e08af32f0a91d4e0b53fb57 Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:12:05 +0200 Subject: [PATCH 2/7] Fixed rereference property type --- modelcard.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modelcard.yaml b/modelcard.yaml index 274a23e2..f4ba7037 100644 --- a/modelcard.yaml +++ b/modelcard.yaml @@ -8,4 +8,4 @@ model_details: ## Wine quality prediction This model predicts the quality of wine batches based on physicochemical inputs and sensory outputs. references: - reference: http://made-up-exam.ple/ + - reference: http://made-up-exam.ple/ From 5a42461f7f9bbb667e8584576e6d409c2da5e22e Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:17:06 +0200 Subject: [PATCH 3/7] Added custom rule --- .github/workflows/modelcard.yml | 1 + .rules/rules.yaml | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 .rules/rules.yaml diff --git a/.github/workflows/modelcard.yml b/.github/workflows/modelcard.yml index 25d208eb..6af314ce 100644 --- a/.github/workflows/modelcard.yml +++ b/.github/workflows/modelcard.yml @@ -17,3 +17,4 @@ jobs: uses: CompliancePal/modelcard-action@main with: modelcard: modelcard.yaml + rules: .rules diff --git a/.rules/rules.yaml b/.rules/rules.yaml new file mode 100644 index 00000000..6251cfd1 --- /dev/null +++ b/.rules/rules.yaml @@ -0,0 +1,7 @@ +rules: + legal-version-name: + message: '{{error}}' + severity: error + given: '$.model_details.version.name' + then: + function: truthy From 28dd7785ec32b56108657a58c431f61ff8b90d6f Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:19:35 +0200 Subject: [PATCH 4/7] Added truthy model version name --- modelcard.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modelcard.yaml b/modelcard.yaml index f4ba7037..b841ce59 100644 --- a/modelcard.yaml +++ b/modelcard.yaml @@ -1,7 +1,7 @@ model_details: name: Wine prediction version: - name: '' + name: 'version 1' date: 2022-11-03 description: | From d54489e9d576e9b9ee351cc0bcd481632ab9f21f Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:25:18 +0200 Subject: [PATCH 5/7] Added custom rule function --- .rules/functions/semver.js | 12 ++++++++++++ .rules/rules.yaml | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .rules/functions/semver.js diff --git a/.rules/functions/semver.js b/.rules/functions/semver.js new file mode 100644 index 00000000..7f9c5ecd --- /dev/null +++ b/.rules/functions/semver.js @@ -0,0 +1,12 @@ +export default (input) => { + const versionParts = input.split('.'); + + if (versionParts.length != 3 || versionParts.some((part) => isNaN(part))) { + return [ + { + message: + 'Version name must be in format MAJOR.MINOR.PATCH, see semantic versioning (https://semver.org/)', + }, + ]; + } +}; diff --git a/.rules/rules.yaml b/.rules/rules.yaml index 6251cfd1..80dde3d6 100644 --- a/.rules/rules.yaml +++ b/.rules/rules.yaml @@ -1,7 +1,8 @@ +functions: [semver] rules: legal-version-name: message: '{{error}}' severity: error given: '$.model_details.version.name' then: - function: truthy + function: semver From eba02fd35865eb2850c92a921b9f5b6c363aefc1 Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:28:22 +0200 Subject: [PATCH 6/7] Fixed version name to follow semver --- modelcard.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modelcard.yaml b/modelcard.yaml index b841ce59..16c8f1ee 100644 --- a/modelcard.yaml +++ b/modelcard.yaml @@ -1,7 +1,7 @@ model_details: name: Wine prediction version: - name: 'version 1' + name: 0.0.1 date: 2022-11-03 description: | From 7b84ff6aa2abf3b21e5d2fcde4377d2a9c316e3f Mon Sep 17 00:00:00 2001 From: Markus Holopainen Date: Tue, 31 Jan 2023 10:33:07 +0200 Subject: [PATCH 7/7] Added mlflow integration --- .github/workflows/modelcard.yml | 2 ++ modelcard.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/modelcard.yml b/.github/workflows/modelcard.yml index 6af314ce..d5460e5a 100644 --- a/.github/workflows/modelcard.yml +++ b/.github/workflows/modelcard.yml @@ -15,6 +15,8 @@ jobs: - name: Check for model card file uses: CompliancePal/modelcard-action@main + env: + MLFLOW_TRACKING_URI: ${{secrets.MLFLOW_TRACKING_URI}} with: modelcard: modelcard.yaml rules: .rules diff --git a/modelcard.yaml b/modelcard.yaml index 16c8f1ee..c531e493 100644 --- a/modelcard.yaml +++ b/modelcard.yaml @@ -3,6 +3,9 @@ model_details: version: name: 0.0.1 date: 2022-11-03 + run: + type: mlflow + id: 35c174ef99c04747b0467aaeabf70773 description: | ## Wine quality prediction