From 66325f30e44fba2fb0d7d6141f832945eb773c19 Mon Sep 17 00:00:00 2001 From: Thanawan Atchariyachanvanit Date: Mon, 18 Sep 2023 22:46:57 -0400 Subject: [PATCH] Fix conditional job execution issue in model upload workflow (#294) * Update model_uploader.yml Signed-off-by: Thanawan Atchariyachanvanit * Update model_uploader.yml Signed-off-by: Thanawan Atchariyachanvanit * Update model_uploader.yml Signed-off-by: Thanawan Atchariyachanvanit * Update CHANGELOG.md Signed-off-by: Thanawan Atchariyachanvanit --------- Signed-off-by: Thanawan Atchariyachanvanit --- .github/workflows/model_uploader.yml | 6 ++---- CHANGELOG.md | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/model_uploader.yml b/.github/workflows/model_uploader.yml index ce4bb36e..68d75c90 100644 --- a/.github/workflows/model_uploader.yml +++ b/.github/workflows/model_uploader.yml @@ -111,7 +111,6 @@ jobs: # Step 3: Check if the model already exists in the model hub checking-out-model-hub: needs: init-workflow-var - if: github.event.inputs.allow_overwrite == 'NO' runs-on: 'ubuntu-latest' permissions: id-token: write @@ -131,7 +130,7 @@ jobs: role-to-assume: ${{ secrets.MODEL_UPLOADER_ROLE }} role-session-name: checking-out-model-hub - name: Check if TORCH_SCRIPT Model Exists - if: github.event.inputs.tracing_format == 'TORCH_SCRIPT' || github.event.inputs.tracing_format == 'BOTH' + if: github.event.inputs.allow_overwrite == 'NO' && (github.event.inputs.tracing_format == 'TORCH_SCRIPT' || github.event.inputs.tracing_format == 'BOTH') run: | TORCH_FILE_PATH=$(python utils/model_uploader/save_model_file_path_to_env.py \ ${{ needs.init-workflow-var.outputs.sentence_transformer_folder }} ${{ github.event.inputs.model_id }} \ @@ -143,7 +142,7 @@ jobs: exit 1 fi - name: Check if ONNX Model Exists - if: github.event.inputs.tracing_format == 'ONNX' || github.event.inputs.tracing_format == 'BOTH' + if: github.event.inputs.allow_overwrite == 'NO' && (github.event.inputs.tracing_format == 'ONNX' || github.event.inputs.tracing_format == 'BOTH') run: | ONNX_FILE_PATH=$(python utils/model_uploader/save_model_file_path_to_env.py \ ${{ needs.init-workflow-var.outputs.sentence_transformer_folder }} ${{ github.event.inputs.model_id }} \ @@ -158,7 +157,6 @@ jobs: # Step 4: Trace the model, Verify the embeddings & Upload the model files as artifacts model-auto-tracing: needs: [init-workflow-var, checking-out-model-hub] - if: always() && needs.init-workflow-var.result == 'success' && (needs.checking-out-model-hub.result == 'success' || needs.checking-out-model-hub.result == 'skipped') name: model-auto-tracing runs-on: ubuntu-latest permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a0858ea..b5f799b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Update pretrained_models_all_versions.json (2023-09-08 13:14:07) by @dhrubo-os ([#277](https://github.com/opensearch-project/opensearch-py-ml/pull/277)) - Update model upload history - sentence-transformers/distiluse-base-multilingual-cased-v1 (v.1.0.1)(TORCH_SCRIPT) by @dhrubo-os ([#281](https://github.com/opensearch-project/opensearch-py-ml/pull/281)) - Update pretrained_models_all_versions.json (2023-09-14 10:28:41) by @dhrubo-os ([#282](https://github.com/opensearch-project/opensearch-py-ml/pull/282)) -Enable the model upload workflow to add model_content_size_in_bytes & model_content_hash_value to model config automatically @thanawan-atc ([#291](https://github.com/opensearch-project/opensearch-py-ml/pull/291)) +- Enable the model upload workflow to add model_content_size_in_bytes & model_content_hash_value to model config automatically @thanawan-atc ([#291](https://github.com/opensearch-project/opensearch-py-ml/pull/291)) ### Fixed - Enable make_model_config_json to add model description to model config file by @thanawan-atc in ([#203](https://github.com/opensearch-project/opensearch-py-ml/pull/203)) @@ -35,6 +35,7 @@ Enable the model upload workflow to add model_content_size_in_bytes & model_cont - Add BUCKET_NAME to ml-models-release jenkinsfile by @thanawan-atc in ([#249](https://github.com/opensearch-project/opensearch-py-ml/pull/249)) - Roll over pretrained_model_listing.json because of ml-commons dependency by @thanawan-atc in ([#252](https://github.com/opensearch-project/opensearch-py-ml/pull/252)) - Fix pandas dependency issue in nox session by installing pandas package to python directly by @thanawan-atc in ([#266](https://github.com/opensearch-project/opensearch-py-ml/pull/266)) +- Fix conditional job execution issue in model upload workflow by @thanawan-atc in ([#294](https://github.com/opensearch-project/opensearch-py-ml/pull/294)) ## [1.1.0]