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,45 @@ 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 :
111140 - name : Setup proxy cache
112141 uses : nv-gha-runners/setup-proxy-cache@main
113142
114143 - name : Checkout repository
115144 uses : actions/checkout@v4
145+ with :
146+ sparse-checkout : " ${{ matrix.recipe.dir }}"
147+ sparse-checkout-cone-mode : false
116148
117149 - name : Setup python
118150 uses : actions/setup-python@v5
119151 with :
120152 python-version : " 3.12"
121153
122- - name : Install ci script dependencies
154+ - name : Install dependencies
155+ working-directory : ${{ matrix.recipe.dir }}
123156 run : |
124- python -m pip install --upgrade pip
125- pip install platformdirs
157+ if [ -f pyproject.toml ] || [ -f setup.py ]; then
158+ PIP_CONSTRAINT= pip install -e .
159+ echo "Installed ${{ matrix.recipe.dir }} as editable package"
160+ elif [ -f requirements.txt ]; then
161+ PIP_CONSTRAINT= pip install -r requirements.txt
162+ echo "Installed ${{ matrix.recipe.dir }} from requirements.txt"
163+ else
164+ echo "No pyproject.toml, setup.py, or requirements.txt found in ${{ matrix.recipe.dir }}"
165+ exit 1
166+ fi
126167
127168 - 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
169+ working-directory : ${{ matrix.recipe.dir }}
170+ run : pytest -v .
134171
135172 verify-recipe-tests :
136173 # This job checks the status of the unit-tests matrix and fails if any matrix job failed or was cancelled.
0 commit comments