Skip to content

Commit c49f982

Browse files
committed
fix(ci): Halve dataset and add disk usage probes to detect disk size growth
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent ad57b93 commit c49f982

1 file changed

Lines changed: 33 additions & 6 deletions

File tree

.github/workflows/cluster-faces-test.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
id: photos-cache
149149
with:
150150
path: data/admin/files/
151-
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip
151+
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip-half
152152

153153
- name: Upload photos
154154
if: steps.photos-cache.outputs.cache-hit != 'true'
@@ -158,11 +158,21 @@ jobs:
158158
wget https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip
159159
unzip IMDb-Face.zip
160160
rm IMDb-Face.zip
161+
# Drop every other identity directory to roughly halve the dataset so
162+
# the classification run stays within the job time limit. Deterministic
163+
# (sorted glob) so both jobs cache an identical set under the same key.
164+
cd IMDb-Face
165+
i=0
166+
for d in */; do
167+
if [ $((i % 2)) -eq 1 ]; then rm -rf "$d"; fi
168+
i=$((i + 1))
169+
done
170+
echo "Kept $(ls -d */ | wc -l) identity directories"
161171
162172
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
163173
with:
164174
path: data/admin/files/
165-
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip
175+
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip-half
166176

167177
- name: Set config
168178
run: |
@@ -184,8 +194,11 @@ jobs:
184194
env:
185195
GITHUB_REF: ${{ github.ref }}
186196
run: |
197+
disk_free() { df -h / | awk 'NR==2 {print $4" free ("$5" used)"}'; }
198+
echo "disk before classification: $(disk_free)"
187199
./occ files:scan admin
188200
./occ recognize:classify
201+
echo "disk after classification: $(disk_free)"
189202
190203
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
191204
with:
@@ -597,7 +610,7 @@ jobs:
597610
id: photos-cache
598611
with:
599612
path: data/admin/files/
600-
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip
613+
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip-half
601614

602615
- name: Upload photos
603616
if: steps.photos-cache.outputs.cache-hit != 'true'
@@ -607,11 +620,21 @@ jobs:
607620
wget https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip
608621
unzip IMDb-Face.zip
609622
rm IMDb-Face.zip
623+
# Drop every other identity directory to roughly halve the dataset so
624+
# the classification run stays within the job time limit. Deterministic
625+
# (sorted glob) so both jobs cache an identical set under the same key.
626+
cd IMDb-Face
627+
i=0
628+
for d in */; do
629+
if [ $((i % 2)) -eq 1 ]; then rm -rf "$d"; fi
630+
i=$((i + 1))
631+
done
632+
echo "Kept $(ls -d */ | wc -l) identity directories"
610633
611634
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
612635
with:
613636
path: data/admin/files/
614-
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip
637+
key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip-half
615638

616639
- name: Set config
617640
run: |
@@ -695,6 +718,9 @@ jobs:
695718
- name: Run classification via TaskProcessing
696719
if: steps.db-cache.outputs.cache-hit != 'true'
697720
run: |
721+
# Probe available disk so we can tell whether runs die on ENOSPC.
722+
disk_free() { df -h / | awk 'NR==2 {print $4" free ("$5" used)"}'; }
723+
echo "disk before classification: $(disk_free)"
698724
./occ upgrade # in case server master has new migrations in the meantime
699725
./occ files:scan admin
700726
# Kick off a full classification run: SchedulerJob -> StorageCrawlJob
@@ -708,18 +734,19 @@ jobs:
708734
php cron.php || true
709735
QUEUE=$(sqlite3 data/nextcloud.db "select count(*) from oc_recognize_queue_faces;")
710736
CRAWL=$(sqlite3 data/nextcloud.db "select count(*) from oc_jobs where class like '%StorageCrawlJob' or class like '%SchedulerJob';")
711-
echo "round $i: faces queue=$QUEUE, pending crawl/scheduler jobs=$CRAWL"
737+
echo "round $i: faces queue=$QUEUE, pending crawl/scheduler jobs=$CRAWL, disk=$(disk_free)"
712738
if [ "$QUEUE" -eq 0 ] && [ "$CRAWL" -eq 0 ] && [ "$i" -gt 3 ]; then break; fi
713739
sleep 10
714740
done
715741
# Wait for the ExApp to finish processing all scheduled TaskProcessing
716742
# tasks (status 0=unknown, 1=scheduled, 2=running are still pending).
717743
for i in $(seq 1 240); do
718744
PENDING=$(sqlite3 data/nextcloud.db "select count(*) from oc_taskprocessing_tasks where app_id = 'recognize' and status in (0, 1, 2);")
719-
echo "wait $i: pending recognize taskprocessing tasks=$PENDING"
745+
echo "wait $i: pending recognize taskprocessing tasks=$PENDING, disk=$(disk_free)"
720746
if [ "$PENDING" -eq 0 ]; then break; fi
721747
sleep 30
722748
done
749+
echo "disk after classification: $(disk_free)"
723750
FAILED=$(sqlite3 data/nextcloud.db "select count(*) from oc_taskprocessing_tasks where app_id = 'recognize' and status = 4;")
724751
echo "failed recognize taskprocessing tasks: $FAILED"
725752

0 commit comments

Comments
 (0)