Skip to content

Commit 6340b9b

Browse files
Models building workflow to fail on empty results (#520)
1 parent abd6e32 commit 6340b9b

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/ai-runner-models.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,28 @@ jobs:
3333

3434
- name: dl_checkpoints.sh
3535
env:
36-
AI_RUNNER_COMFYUI_IMAGE: "livepeer/ai-runner:live-app-comfyui"
36+
AI_RUNNER_COMFYUI_IMAGE: "livepeer/ai-runner:live-app-comfyui-89570ca"
37+
# If models are smaller than this size, the build will fail
38+
MIN_MODELS_SIZE_MB: 500
3739
run: |
3840
set -e
3941
pip install 'huggingface_hub[cli,hf_transfer]' hf_transfer
4042
runner/dl_checkpoints.sh --batch
4143
du -hs ./models/
4244
45+
MODELS_DIR="./models"
46+
47+
# Get the size of the model directory in bytes
48+
dir_size_bytes=$(du -sb "$MODELS_DIR" | awk '{print $1}')
49+
# Convert bytes to MB (1 MB = 1048576 bytes)
50+
dir_size_mb=$(echo "$dir_size_bytes / 1048576" | bc)
51+
52+
if [ "$dir_size_mb" -lt "$MIN_MODELS_SIZE_MB" ]; then
53+
echo "Error: $MODELS_DIR size is ${dir_size_mb}MB, which is less than required ${MIN_MODELS_SIZE_MB}MB."
54+
exit 1
55+
fi
56+
57+
4358
- name: Set up Docker Buildx
4459
uses: docker/setup-buildx-action@v3
4560

@@ -94,14 +109,28 @@ jobs:
94109

95110
- name: dl_checkpoints.sh
96111
env:
97-
AI_RUNNER_COMFYUI_IMAGE: "livepeer/ai-runner:live-app-comfyui"
112+
AI_RUNNER_COMFYUI_IMAGE: "livepeer/ai-runner:live-app-comfyui-89570ca"
113+
# If models are smaller than this size, the build will fail
114+
MIN_MODELS_SIZE_MB: 500
98115
run: |
99116
set -e
100117
pip install 'huggingface_hub[cli,hf_transfer]' hf_transfer
101118
rm -rf ./models/*
102119
runner/dl_checkpoints.sh --tensorrt
103120
du -hs ./models/
104121
122+
MODELS_DIR="./models"
123+
124+
# Get the size of the model directory in bytes
125+
dir_size_bytes=$(du -sb "$MODELS_DIR" | awk '{print $1}')
126+
# Convert bytes to MB (1 MB = 1048576 bytes)
127+
dir_size_mb=$(echo "$dir_size_bytes / 1048576" | bc)
128+
129+
if [ "$dir_size_mb" -lt "$MIN_MODELS_SIZE_MB" ]; then
130+
echo "Error: $MODELS_DIR size is ${dir_size_mb}MB, which is less than required ${MIN_MODELS_SIZE_MB}MB."
131+
exit 1
132+
fi
133+
105134
- name: Set up Docker Buildx
106135
uses: docker/setup-buildx-action@v3
107136

0 commit comments

Comments
 (0)