Skip to content

ci: Improve no-fail-fast mechanism #13370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 1, 2025
Merged

ci: Improve no-fail-fast mechanism #13370

merged 16 commits into from
May 1, 2025

Conversation

ko3n1g
Copy link
Collaborator

@ko3n1g ko3n1g commented May 1, 2025

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: oliver könig <okoenig@nvidia.com>
f
Signed-off-by: oliver könig <okoenig@nvidia.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels May 1, 2025
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels May 1, 2025
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels May 1, 2025
Signed-off-by: oliver könig <okoenig@nvidia.com>
Copy link
Collaborator

@chtruong814 chtruong814 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some clarification questions

@@ -179,42 +220,49 @@ jobs:
tests_to_run: '["L0_Setup_Test_Data_And_Models"]'

cicd-main-unit-tests:
needs: [pre-flight, cicd-test-container-build]
needs: [pre-flight, cicd-test-container-build, cicd-wait-in-queue]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add the cicd-wait-in-queue if the build step depends on it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weant to run unit-tests only if the queue event was skipped, but for instance not if the build has failed.

Therefore we need a query like:

      needs.pre-flight.outputs.test_to_run != '[]' 
      && (
        success() 
        || (
          needs.cicd-wait-in-queue.result == 'skipped'
          && needs.pre-flight.outputs.is_ci_workload == 'true'
        )
      )
      && !cancelled()

Since we want to access cicd-wait-in-queue's result attribute, we need to add it to the job's need array

with:
test_to_run: ${{ needs.pre-flight.outputs.test_to_run }}

cicd-main-export-deploy:
needs: [pre-flight, cicd-test-container-build, cicd-main-unit-tests]
uses: ./.github/workflows/cicd-main-export-deploy.yml
if: |
(success() || needs.cicd-wait-in-queue.result == 'skipped') && (contains(fromJson(needs.pre-flight.outputs.components_to_run), 'export-deploy') || needs.pre-flight.outputs.components_to_run == '["all"]')
(success() || (needs.cicd-wait-in-queue.result == 'skipped' && needs.pre-flight.outputs.is_ci_workload == 'true') || needs.pre-flight.outputs.no_fail_fast == 'true') && (contains(fromJson(needs.pre-flight.outputs.components_to_run), 'export-deploy') || needs.pre-flight.outputs.components_to_run == '["all"]')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we have both is_ci_workload mechanisms rather than relying on the no-fail-fast label like we did before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open for discussion, my thinking was that no-fail-fast is a label that also engineers can attach. We don't want to let them bypass approval though. CI-workloads make use of no-fail-fast but also get an express lane on the CI. So it's two different mechanisms that we need

Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g added the Run CICD label May 1, 2025
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g added Run CICD and removed Run CICD labels May 1, 2025
@github-actions github-actions bot removed the Run CICD label May 1, 2025
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g added the Run CICD label May 1, 2025
@github-actions github-actions bot removed the Run CICD label May 1, 2025
Signed-off-by: oliver könig <okoenig@nvidia.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g ko3n1g merged commit 649a276 into main May 1, 2025
49 of 59 checks passed
@ko3n1g ko3n1g deleted the ko3n1g/ci/no-fail-fast branch May 1, 2025 14:17
yuanzhedong pushed a commit that referenced this pull request May 1, 2025
* ci: Improve no-fail-fast mechanism

Signed-off-by: oliver könig <okoenig@nvidia.com>

* f

Signed-off-by: oliver könig <okoenig@nvidia.com>

* maybe like this?

Signed-off-by: oliver könig <okoenig@nvidia.com>

* test

Signed-off-by: oliver könig <okoenig@nvidia.com>

* fix

Signed-off-by: oliver könig <okoenig@nvidia.com>

* fix

Signed-off-by: oliver könig <okoenig@nvidia.com>

* test

Signed-off-by: oliver könig <okoenig@nvidia.com>

* test

Signed-off-by: oliver könig <okoenig@nvidia.com>

* test

Signed-off-by: oliver könig <okoenig@nvidia.com>

* fix

Signed-off-by: oliver könig <okoenig@nvidia.com>

* jobs

Signed-off-by: oliver könig <okoenig@nvidia.com>

* revert debugging

Signed-off-by: oliver könig <okoenig@nvidia.com>

* test

Signed-off-by: oliver könig <okoenig@nvidia.com>

* fix

Signed-off-by: oliver könig <okoenig@nvidia.com>

---------

Signed-off-by: oliver könig <okoenig@nvidia.com>
Signed-off-by: Yuanzhe Dong <yudong@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants