diff --git a/.github/workflows/check_failed_model_tests.yml b/.github/workflows/check_failed_model_tests.yml index f3ea8646900a..7c4c528d022e 100644 --- a/.github/workflows/check_failed_model_tests.yml +++ b/.github/workflows/check_failed_model_tests.yml @@ -47,7 +47,7 @@ jobs: - name: Get target commit working-directory: /transformers/utils run: | - echo "END_SHA=$(TOKEN=${{ secrets.ACCESS_REPO_INFO_TOKEN }} python3 -c 'import os; from get_previous_daily_ci import get_last_daily_ci_run_commit; commit=get_last_daily_ci_run_commit(token=os.environ["TOKEN"]); print(commit)')" >> $GITHUB_ENV + echo "END_SHA=$(TOKEN=${{ secrets.ACCESS_REPO_INFO_TOKEN }} python3 -c 'commit = "30335093276212ce74938bdfd85bfd5df31a668a"; print(commit)')" >> $GITHUB_ENV - name: Checkout to `start_sha` working-directory: /transformers diff --git a/.github/workflows/self-scheduled.yml b/.github/workflows/self-scheduled.yml index 1a6f4a485430..353fb59843e4 100644 --- a/.github/workflows/self-scheduled.yml +++ b/.github/workflows/self-scheduled.yml @@ -562,3 +562,13 @@ jobs: ci_event: ${{ inputs.ci_event }} secrets: inherit + + check_new_model_failures: + if: ${{ always() && inputs.ci_event == 'Daily CI' && inputs.job == 'run_models_gpu' && needs.send_results.result == 'success' }} + name: Check new model failures + needs: send_results + uses: ./.github/workflows/check_failed_model_tests.yml + with: + docker: ${{ inputs.docker }} + start_sha: ${{ github.sha }} + secrets: inherit \ No newline at end of file diff --git a/utils/notification_service.py b/utils/notification_service.py index d700ca7894bb..40a6e329edda 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -532,12 +532,12 @@ def payload(self) -> str: file_path = os.path.join(os.getcwd(), f"ci_results_{job_name}/new_model_failures.txt") commit_info = api.upload_file( path_or_fileobj=file_path, - path_in_repo=f"{(datetime.datetime.today() - datetime.timedelta(days = 1)).strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt", + path_in_repo=f"{(datetime.datetime.today()).strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt", repo_id="hf-internal-testing/transformers_daily_ci", repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), ) - url = f"https://huggingface.co/datasets/hf-internal-testing/transformers_daily_ci/raw/{commit_info.oid}/{(datetime.datetime.today() - datetime.timedelta(days = 1)).strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt" + url = f"https://huggingface.co/datasets/hf-internal-testing/transformers_daily_ci/raw/{commit_info.oid}/{(datetime.datetime.today()).strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt" # extra processing to save to json format new_failed_tests = {} @@ -559,7 +559,7 @@ def payload(self) -> str: file_path = os.path.join(os.getcwd(), f"ci_results_{job_name}/new_model_failures.json") _ = api.upload_file( path_or_fileobj=file_path, - path_in_repo=f"{(datetime.datetime.today() - datetime.timedelta(days = 1)).strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.json", + path_in_repo=f"{(datetime.datetime.today()).strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.json", repo_id="hf-internal-testing/transformers_daily_ci", repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), @@ -1232,7 +1232,7 @@ def prepare_reports(title, header, reports, to_truncate=True): if is_scheduled_ci_run: api.upload_file( path_or_fileobj=f"ci_results_{job_name}/model_results.json", - path_in_repo=f"{(datetime.datetime.today() - datetime.timedelta(days = 1)).strftime('%Y-%m-%d')}/ci_results_{job_name}/model_results.json", + path_in_repo=f"{(datetime.datetime.today()).strftime('%Y-%m-%d')}/ci_results_{job_name}/model_results.json", repo_id="hf-internal-testing/transformers_daily_ci", repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None), @@ -1254,7 +1254,7 @@ def prepare_reports(title, header, reports, to_truncate=True): if is_scheduled_ci_run: api.upload_file( path_or_fileobj=f"ci_results_{job_name}/{test_to_result_name[job]}_results.json", - path_in_repo=f"{(datetime.datetime.today() - datetime.timedelta(days = 1)).strftime('%Y-%m-%d')}/ci_results_{job_name}/{test_to_result_name[job]}_results.json", + path_in_repo=f"{(datetime.datetime.today()).strftime('%Y-%m-%d')}/ci_results_{job_name}/{test_to_result_name[job]}_results.json", repo_id="hf-internal-testing/transformers_daily_ci", repo_type="dataset", token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None),