Skip to content

Commit 46c8423

Browse files
authored
Merge branch 'main' into dev/ba/BIONEMO-2473-add-evo2-lora-tests
2 parents 79361ed + 832b244 commit 46c8423

File tree

11 files changed

+235
-52
lines changed

11 files changed

+235
-52
lines changed

.github/labels.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Test pipeline labels
2+
- name: ciflow:slow
3+
description: Run slow single GPU integration tests marked as @pytest.mark.slow for bionemo2
4+
color: 0E8A16 # Green
5+
6+
- name: ciflow:notebooks
7+
description: Run Jupyter notebooks execution tests for bionemo2
8+
color: 1D76DB # Blue
9+
10+
- name: ciflow:all
11+
description: Run all tests (unit tests, slow tests, and notebooks) for bionemo2. This label can be used to enforce running tests for all bionemo2.
12+
color: FBCA04 # Yellow/Gold
13+
14+
- name: ciflow:all-recipes
15+
description: Run tests for all recipes (under bionemo-recipes). This label can be used to enforce running tests for all recipes.
16+
color: 812afe # Purple
17+
18+
- name: ciflow:skip
19+
description: Skip all CI tests for this PR
20+
color: B60205 # Red

.github/pull_request_template.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
<!-- Provide a detailed description of the changes in this PR -->
44

5+
#### Usage
6+
7+
<!--- How does a user interact with the changed code -->
8+
9+
```python
10+
TODO: Add code snippet
11+
```
12+
513
### Type of changes
614

715
<!-- Mark the relevant option with an [x] -->
@@ -14,14 +22,20 @@
1422

1523
### CI Pipeline Configuration
1624

17-
Configure CI behavior by applying the relevant labels:
25+
Configure CI behavior by applying the relevant labels. By default, only basic unit tests are run.
26+
27+
- [ciflow:skip](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/main/contributing/contributing.md#ciflow:skip) - Skip all CI tests for this PR
28+
- [ciflow:notebooks](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/main/contributing/contributing.md#ciflow:notebooks) - Run Jupyter notebooks execution tests for bionemo2
29+
- [ciflow:slow](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/main/contributing/contributing.md#ciflow:slow) - Run slow single GPU integration tests marked as @pytest.mark.slow for bionemo2
30+
- [ciflow:all](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/main/contributing/contributing.md#ciflow:all) - Run all tests (unit tests, slow tests, and notebooks) for bionemo2. This label can be used to enforce running tests for all bionemo2.
31+
- [ciflow:all-recipes](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/main/contributing/contributing.md#ciflow:all-recipes) - Run tests for all recipes (under bionemo-recipes). This label can be used to enforce running tests for all recipes.
1832

19-
- [SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci) - Skip all continuous integration tests
20-
- [INCLUDE_NOTEBOOKS_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_notebooks_tests) - Execute notebook validation tests in pytest
21-
- [INCLUDE_SLOW_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_slow_tests) - Execute tests labelled as slow in pytest for extensive testing
33+
Unit tests marked as `@pytest.mark.multi_gpu` or `@pytest.mark.distributed` are not run in the PR pipeline.
34+
35+
For more details, see [CONTRIBUTING](CONTRIBUTING.md)
2236

2337
> [!NOTE]
24-
> By default, the notebooks validation tests are skipped unless explicitly enabled.
38+
> By default, only basic unit tests are run. Add appropriate labels to enable an additional test coverage.
2539
2640
#### Authorizing CI Runs
2741

@@ -33,14 +47,6 @@ runs on NVIDIA's compute resources.
3347
- If a pull request is opened by an untrusted user or contains untrusted changes, an NVIDIA org member must leave an
3448
`/ok to test` comment on the pull request to trigger CI. This will need to be done for each new commit.
3549

36-
### Usage
37-
38-
<!--- How does a user interact with the changed code -->
39-
40-
```python
41-
# TODO: Add code snippet
42-
```
43-
4450
### Pre-submit Checklist
4551

4652
<!--- Ensure all items are completed before submitting -->

.github/workflows/approvals.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request_review:
55

66
env:
7-
TIER2_REVIEWERS: "jstjohn,trvachov,pstjohn"
7+
TIER2_REVIEWERS: "jstjohn,trvachov,pstjohn,dorotat-nv"
88

99
jobs:
1010
check_approval:

.github/workflows/sync-labels.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Sync Labels
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/labels.yml'
9+
- '.github/workflows/sync-labels.yml'
10+
workflow_dispatch:
11+
12+
jobs:
13+
sync-labels:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Sync labels
19+
uses: micnncim/action-label-syncer@v1
20+
with:
21+
repository: ${{ github.repository }}
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
config_file: .github/labels.yml
24+
# Optionally you can add these flags:
25+
# prune: true # Delete labels not defined in your config file
26+
# dry_run: true # Preview changes without applying them

.github/workflows/unit-tests-framework.yml

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
# BioNeMo Framework CI Workflow
2+
#
3+
# This workflow runs comprehensive tests for the BioNeMo framework on various triggers:
4+
#
5+
# TRIGGERS:
6+
# - Push to main branch, pull-request branches, or dependabot branches
7+
# - Merge group events (when PRs are merged via merge queue)
8+
# - Scheduled runs (daily at 7 AM UTC)
9+
#
10+
# WORKFLOW OVERVIEW:
11+
# 1. changed-files: Detects which files have changed compared to main branch
12+
# - Tracks changes in: All files (**) except:
13+
# * bionemo-recipes/** (recipes have separate workflow)
14+
# * **.md (markdown documentation files)
15+
# * .github/** (GitHub configuration, except this workflow file)
16+
# * .gitignore, .devcontainer/**
17+
# * ci/scripts/recipes_local_test.py
18+
# - Includes: .github/workflows/unit-tests-framework.yml (this workflow file)
19+
# 2. pre-commit: Runs static code checks and linting
20+
# 3. get-pr-labels: Retrieves PR labels for conditional job execution
21+
# 4. build-bionemo-image: Builds Docker image (conditional on triggers/labels)
22+
# 5. run-tests: Runs unit tests (when image build succeeds)
23+
# 6. run-tests-slow: Runs slow tests (when image succeeds + ciflow:slow label OR schedule/merge_group/ciflow:all)
24+
# 7. run-tests-notebooks: Runs notebook tests (when image succeeds + ciflow:notebooks label OR schedule/merge_group/ciflow:all)
25+
# 8. verify-tests-status: Verifies all test jobs completed successfully
26+
#
27+
# CONDITIONAL EXECUTION:
28+
# - build-bionemo-image runs on: schedule, ciflow:all label, (no ciflow:skip + modified files), (merge_group + modified files)
29+
# - run-tests runs when: build-bionemo-image succeeds
30+
# - run-tests-slow runs when: build-bionemo-image succeeds AND (schedule OR merge_group OR ciflow:all OR ciflow:slow)
31+
# - run-tests-notebooks runs when: build-bionemo-image succeeds AND (schedule OR merge_group OR ciflow:all OR ciflow:notebooks)
32+
133
name: "BioNeMo Framework CI"
234

335
on:
@@ -82,7 +114,7 @@ jobs:
82114
get-pr-labels:
83115
runs-on: ubuntu-latest
84116
outputs:
85-
labels: ${{ steps.get-labels.outputs.labels }}
117+
labels: ${{ steps.get-labels.outputs.labels || steps.get-labels-empty.outputs.labels }}
86118
steps:
87119
- name: Get PR number from branch
88120
if: startsWith(github.ref, 'refs/heads/pull-request/')
@@ -99,21 +131,34 @@ jobs:
99131
run: |
100132
LABELS=$(gh api repos/${{ github.repository }}/pulls/${{ steps.get-pr-num.outputs.pr_num }} --jq '[.labels[].name]' || echo "[]")
101133
echo "labels=$LABELS" >> $GITHUB_OUTPUT
134+
echo "Retrieved labels: $LABELS"
102135
103136
- name: Set empty labels for non-PR branches
104137
if: ${{ !startsWith(github.ref, 'refs/heads/pull-request/') }}
105138
id: get-labels-empty
106-
run: echo "labels=[]" >> $GITHUB_OUTPUT
139+
run: |
140+
echo "labels=[]" >> $GITHUB_OUTPUT
141+
echo "Set empty labels for non-PR branch"
107142
108143
build-bionemo-image:
109144
needs:
110145
- pre-commit
111146
- get-pr-labels
112147
- changed-files
113148
runs-on: linux-amd64-cpu16
114-
# We want this to run on schedule events even if no files have changed
115-
if: ${{ github.event_name == 'schedule' || (!contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'SKIP_CI') && needs.changed-files.outputs.any_changed == 'true') }}
149+
if: |
150+
(github.event_name == 'schedule') ||
151+
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'ciflow:all') ||
152+
(
153+
!contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'ciflow:skip') &&
154+
(needs.changed-files.outputs.any_changed == 'true')
155+
) ||
156+
(
157+
(github.event_name == 'merge_group') &&
158+
(needs.changed-files.outputs.any_changed == 'true')
159+
)
116160
steps:
161+
117162
- name: Login to Docker Hub
118163
uses: docker/login-action@v3
119164
with:
@@ -171,6 +216,7 @@ jobs:
171216
credentials:
172217
username: ${{ vars.DOCKER_USERNAME }}
173218
password: ${{ secrets.DOCKER_PASSWORD }}
219+
if: needs.build-bionemo-image.result == 'success'
174220
steps:
175221
- name: Checkout repository
176222
uses: actions/checkout@v4
@@ -200,7 +246,7 @@ jobs:
200246
with:
201247
token: ${{ secrets.CODECOV_TOKEN }}
202248

203-
run-slow-tests:
249+
run-tests-slow:
204250
needs:
205251
- build-bionemo-image
206252
- get-pr-labels
@@ -211,13 +257,19 @@ jobs:
211257
username: ${{ vars.DOCKER_USERNAME }}
212258
password: ${{ secrets.DOCKER_PASSWORD }}
213259
if: |
214-
github.event_name == 'schedule' || github.event_name == 'merge_group' ||
215-
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'INCLUDE_SLOW_TESTS')
260+
(needs.build-bionemo-image.result == 'success') &&
261+
(
262+
(github.event_name == 'schedule') ||
263+
(github.event_name == 'merge_group') ||
264+
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'ciflow:all') ||
265+
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'ciflow:slow')
266+
)
216267
steps:
217268
- name: Checkout repository
218269
uses: actions/checkout@v4
219270

220271
- name: Run slow tests
272+
221273
env:
222274
BIONEMO_DATA_SOURCE: ngc
223275
# Not every sub-package has slow tests, and since some sub-packages have tests under the same name we need
@@ -227,14 +279,20 @@ jobs:
227279
./ci/scripts/run_pytest_slow.sh
228280
229281
230-
run-notebooks-docs:
282+
run-tests-notebooks:
231283
needs:
232284
- build-bionemo-image
233285
- get-pr-labels
234286
runs-on: linux-amd64-gpu-l4-latest-1
287+
235288
if: |
236-
github.event_name == 'schedule' || github.event_name == 'merge_group' ||
237-
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'INCLUDE_NOTEBOOKS_TESTS')
289+
(needs.build-bionemo-image.result == 'success') &&
290+
(
291+
(github.event_name == 'schedule') ||
292+
(github.event_name == 'merge_group') ||
293+
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'ciflow:all') ||
294+
contains(fromJSON(needs.get-pr-labels.outputs.labels || '[]'), 'ciflow:notebooks')
295+
)
238296
container:
239297
image: svcbionemo023/bionemo-framework:${{ github.run_id }}
240298
credentials:
@@ -260,8 +318,8 @@ jobs:
260318
- get-pr-labels
261319
- build-bionemo-image
262320
- run-tests
263-
- run-slow-tests
264-
- run-notebooks-docs
321+
- run-tests-slow
322+
- run-tests-notebooks
265323
# Add all other run-*-test jobs
266324
runs-on: ubuntu-latest
267325
if: always() # This ensures the job runs even if previous jobs fail

.github/workflows/unit-tests-recipes.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ jobs:
7070
if [[ "$EVENT_NAME" == "schedule" ]]; then
7171
DIRS=$(echo "$ALL_DIRS")
7272
else
73-
# Check if INCLUDE_ALL_RECIPES label is present
73+
# Check if "ciflow:all-recipes" label is present
7474
HAS_INCLUDE_ALL_LABEL=false
7575
if [[ "$PR_INFO" != "null" && "$PR_INFO" != "" ]]; then
76-
if echo "$PR_INFO" | jq -e '.labels[]? | select(.name == "INCLUDE_ALL_RECIPES")' > /dev/null 2>&1; then
76+
if echo "$PR_INFO" | jq -e '.labels[]? | select(.name == "ciflow:all-recipes")' > /dev/null 2>&1; then
7777
HAS_INCLUDE_ALL_LABEL=true
78-
echo "Found INCLUDE_ALL_RECIPES label - running all directories"
78+
echo "Found 'ciflow:all-recipes' label - running all directories"
7979
fi
8080
fi
8181
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- [NeMo2 Parallelism](nemo2.md)
1+
- [NeMo2](nemo2.md)
22
- [Megatron Dataset Considerations](megatron_datasets.md)

0 commit comments

Comments
 (0)