Skip to content

Commit fe2ca6a

Browse files
authored
ci: bifurcate nemo2.0 and nemo-rl build profiles, use ci-success aggregate check in build (#91)
Sets up different dependency profiles in `pyproject.toml` for NeMo/RL and NeMo 2.0, since they require different python versions and have heavy dependencies that can easily conflict. The GH actions build will run them in parallel. For now, the `nemo-rl` extra is just an alias for the nemo one, until it is added. Now, `dev-nemo` and `dev-nemo-rl` are the target build extras, but `dev` is retained as an alias for `dev-nemo` for backwards compatibility. Additionally, a `ci-success` build job has been added, which depends on all other required jobs, and is now the sole "required" check from the build-and-test workflow.
1 parent c0b755a commit fe2ca6a

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

.github/workflows/build-and-test.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ jobs:
2525
# Use larger machine with more disk space
2626
runs-on: ubuntu-24.04-32core
2727
strategy:
28+
fail-fast: false
2829
matrix:
29-
python-version: ["3.10", "3.12"]
30+
include:
31+
- python-version: "3.10"
32+
profile: "dev-nemo"
33+
- python-version: "3.12"
34+
profile: "dev-nemo-rl"
3035
env:
3136
PYTHON_FAIL_UNDER: 90
3237
CPP_FAIL_UNDER: 80
@@ -51,7 +56,7 @@ jobs:
5156
df -h
5257
# Install python dependencies (with coverage enabled)
5358
echo -e "\n##### Running pip install #####"
54-
pip install -e '.[dev]' --config-settings=cmake.args="-DENABLE_COVERAGE=ON"
59+
pip install -e '.[${{ matrix.profile }}]' --config-settings=cmake.args="-DENABLE_COVERAGE=ON"
5560
5661
- run: df -h
5762

@@ -214,3 +219,20 @@ jobs:
214219
shell: 'bash'
215220
run: |
216221
go run github.com/google/addlicense@v1.1.1 -check -s=only .
222+
223+
# Add a gatekeeper job to act as the (main) required check, which in turn depends on all other required jobs.
224+
# This makes the required check management in GitHub settings tractable, as we don't have to tweak the settings everytime
225+
# a job name changes or a matrix option is modified.
226+
ci-success:
227+
runs-on: ubuntu-latest
228+
if: always()
229+
# Specify all top-level jobs that are required to pass.
230+
needs: [build, lint-code, lint-license]
231+
steps:
232+
- name: Check overall status
233+
run: |
234+
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
235+
echo "One or more dependent jobs failed or were cancelled."
236+
exit 1
237+
fi
238+
echo "All required jobs passed!"

pyproject.toml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,10 @@ docs = [
7979
#"zensical==0.0.11",
8080
]
8181

82-
# Defines a "dev" extra for setting up a development environment.
83-
# Installed via: `pip install -e .[dev]`
84-
dev = [
82+
# Defines a base set of development dependencies shared across all profiles.
83+
dev-base = [
8584
# A more advanced assertion framework.
8685
"assertpy==1.1",
87-
# Adds the optional pytorch dependency set to the development environment.
88-
"ml-flashpoint[pytorch,megatron,nemo,docs]",
8986
# Our testing framework.
9087
"pytest==8.4.1",
9188
# A plugin for pytest that generates code coverage reports for Python.
@@ -100,6 +97,27 @@ dev = [
10097
"ruff==0.12.11",
10198
]
10299

100+
# Defines a "dev-nemo" extra for NeMo 2.0 development (typically uses Python 3.10+).
101+
# Installed via: `pip install -e .[dev-nemo]`
102+
dev-nemo = [
103+
"ml-flashpoint[dev-base,pytorch,megatron,nemo,docs]",
104+
]
105+
106+
# Defines a "dev-nemo-rl" extra for NeMo RL development (typically uses Python 3.12+).
107+
# Installed via: `pip install -e .[dev-nemo-rl]`
108+
dev-nemo-rl = [
109+
"ml-flashpoint[dev-nemo]",
110+
# TODO: uncomment below and remove line above when nemo-rl profile is added
111+
#"ml-flashpoint[dev-base,nemo-rl]",
112+
]
113+
114+
# Defines a "dev" extra for setting up a development environment.
115+
# Aliased to dev-nemo to retain existing behavior.
116+
# Installed via: `pip install -e .[dev]`
117+
dev = [
118+
"ml-flashpoint[dev-nemo]",
119+
]
120+
103121

104122
# ===================================================================
105123
# PEP 518: Build System Definition

0 commit comments

Comments
 (0)