Skip to content

Commit e213d40

Browse files
authored
with zstd compression lets just run the steps individually (#1117)
Reverts part of #1108 since the output can be very hard to parse. with zstd compression and dockerhub caching the image pull doesn't take as much time <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - None - Tests - Parallelized per-recipe unit tests using containerized images. - Switched test execution to PyTest for each recipe. - Added per-recipe dependency installation with automatic detection of install method. - Introduced targeted/sparse checkouts and a pre-test GPU info check. - Chores - Refined CI to pass structured per-directory metadata to test jobs and updated outputs/logging to reflect per-recipe images. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Peter St. John <pstjohn@nvidia.com>
1 parent 9a9acd5 commit e213d40

1 file changed

Lines changed: 49 additions & 14 deletions

File tree

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

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,30 @@ jobs:
8989
fi
9090
fi
9191
92-
echo "dirs=$DIRS" >> $GITHUB_OUTPUT
92+
# Assign Docker images to the selected directories
93+
# Currently, AMPLIFY is the only folder that needs a custom base image, since we have to support both TE and
94+
# xformers-based models for golden value testing. The rest of the models use the default pytorch image.
95+
96+
# This uses a squashed version of the pytorch:25.06-py3 image, generated with `docker-squash
97+
# nvcr.io/nvidia/pytorch:25.06-py3 -t svcbionemo023/bionemo-framework:pytorch25.06-py3-squashed --output
98+
# type=registry,compression=zstd,force-compression=true,oci-mediatypes=true,compression-level=15` and pushed
99+
# to the dockerhub registry. Our github actions are able to cache image pulls from dockerhub but not nvcr, so
100+
# hopefully this cuts down slightly on CI time at the expense of having a slightly in-directed image location.
101+
102+
DIRS_WITH_IMAGES=$(echo "$DIRS" | jq -c '
103+
map({
104+
dir: .,
105+
image: (
106+
if . == "models/amplify" then
107+
"svcbionemo023/bionemo-framework:amplify-model-devcontainer-082025"
108+
else
109+
"svcbionemo023/bionemo-framework:pytorch25.06-py3-squashed-zstd"
110+
end
111+
)
112+
})
113+
')
114+
echo "dirs=$DIRS_WITH_IMAGES" >> $GITHUB_OUTPUT
115+
93116
- name: Show output
94117
run: |
95118
echo "=== Changed Files Analysis ==="
@@ -106,31 +129,43 @@ jobs:
106129
needs: changed-dirs
107130
runs-on: linux-amd64-gpu-l4-latest-1
108131
if: ${{ needs.changed-dirs.outputs.dirs != '[]' }}
132+
container:
133+
image: ${{ matrix.recipe.image }}
134+
strategy:
135+
matrix:
136+
recipe: ${{ fromJson(needs.changed-dirs.outputs.dirs) }}
137+
fail-fast: false
109138

110139
steps:
140+
141+
- name: Show GPU info
142+
run: nvidia-smi
111143
- name: Setup proxy cache
112144
uses: nv-gha-runners/setup-proxy-cache@main
113145

114146
- name: Checkout repository
115147
uses: actions/checkout@v4
116-
117-
- name: Setup python
118-
uses: actions/setup-python@v5
119148
with:
120-
python-version: "3.12"
149+
sparse-checkout: "${{ matrix.recipe.dir }}"
150+
sparse-checkout-cone-mode: false
121151

122-
- name: Install ci script dependencies
152+
- name: Install dependencies
153+
working-directory: ${{ matrix.recipe.dir }}
123154
run: |
124-
python -m pip install --upgrade pip
125-
pip install platformdirs
155+
if [ -f pyproject.toml ] || [ -f setup.py ]; then
156+
PIP_CONSTRAINT= pip install -e .
157+
echo "Installed ${{ matrix.recipe.dir }} as editable package"
158+
elif [ -f requirements.txt ]; then
159+
PIP_CONSTRAINT= pip install -r requirements.txt
160+
echo "Installed ${{ matrix.recipe.dir }} from requirements.txt"
161+
else
162+
echo "No pyproject.toml, setup.py, or requirements.txt found in ${{ matrix.recipe.dir }}"
163+
exit 1
164+
fi
126165
127166
- name: Run tests
128-
env:
129-
DIRS_JSON: ${{ needs.changed-dirs.outputs.dirs }}
130-
run: |
131-
# Convert JSON array to space-separated arguments
132-
DIRS_ARGS=$(echo "$DIRS_JSON" | jq -r '.[]' | tr '\n' ' ')
133-
./ci/scripts/recipes_local_test.py $DIRS_ARGS
167+
working-directory: ${{ matrix.recipe.dir }}
168+
run: pytest -v .
134169

135170
verify-recipe-tests:
136171
# This job checks the status of the unit-tests matrix and fails if any matrix job failed or was cancelled.

0 commit comments

Comments
 (0)