@crvouga/homelab 0.23.7 → 0.23.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -227,6 +227,7 @@
|
|
|
227
227
|
"intervalSeconds": 2,
|
|
228
228
|
"refusedExitCode": 75
|
|
229
229
|
},
|
|
230
|
+
"diskGuardScript": "/usr/local/lib/personal-fleet-disk-guard.py",
|
|
230
231
|
"diskGuardWriteMiB": 32,
|
|
231
232
|
"diskGuardIntervalSeconds": 5,
|
|
232
233
|
"diskGcIdleDays": 7,
|
|
@@ -270,6 +271,7 @@
|
|
|
270
271
|
"dockerLogMaxFiles": "3",
|
|
271
272
|
"inodeWarnFreePercent": 10,
|
|
272
273
|
"inodeFailFreePercent": 2,
|
|
274
|
+
"diskGcScript": "/usr/local/lib/personal-fleet-disk-gc.py",
|
|
273
275
|
"diskGcMemoryMaxMiB": 2048,
|
|
274
276
|
"diskGcGitTempHours": 1,
|
|
275
277
|
"diskGcFetchMaxMiB": 256
|
|
@@ -343,6 +343,14 @@
|
|
|
343
343
|
checksum_algorithm: sha256
|
|
344
344
|
register: disk_guard_source
|
|
345
345
|
when: development_source is defined
|
|
346
|
+
- name: Install the tracked disk guard outside pruned revisions
|
|
347
|
+
ansible.builtin.copy:
|
|
348
|
+
src: '{{ playbook_dir }}/disk-guard.py'
|
|
349
|
+
dest: '{{ resourceSafety.diskGuardScript }}'
|
|
350
|
+
owner: root
|
|
351
|
+
group: root
|
|
352
|
+
mode: '0644'
|
|
353
|
+
when: development_source is defined and disk_guard_source.stat.exists
|
|
346
354
|
- name: Declare the disk guard service
|
|
347
355
|
ansible.builtin.copy:
|
|
348
356
|
dest: /etc/systemd/system/personal-fleet-disk-guard.service
|
|
@@ -357,7 +365,7 @@
|
|
|
357
365
|
StartLimitIntervalSec=0
|
|
358
366
|
[Service]
|
|
359
367
|
Type=simple
|
|
360
|
-
ExecStart=/usr/bin/python3 -I -B {{
|
|
368
|
+
ExecStart=/usr/bin/python3 -I -B {{ resourceSafety.diskGuardScript }} --path / --path {{ development_home }} --floor-mib {{ worker_disk_guard_floor_mib }} --inode-floor-percent {{ resourceSafety.inodeFailFreePercent }} --managed-cgroup /sys/fs/cgroup/system.slice/personal-fleet-disk-gc.service --write-mib {{ resourceSafety.diskGuardWriteMiB }} --interval {{ resourceSafety.diskGuardIntervalSeconds }}
|
|
361
369
|
Restart=always
|
|
362
370
|
RestartSec=5
|
|
363
371
|
OOMScoreAdjust=-1000
|
|
@@ -392,6 +400,16 @@
|
|
|
392
400
|
checksum_algorithm: sha256
|
|
393
401
|
register: disk_gc_source
|
|
394
402
|
when: development_source is defined
|
|
403
|
+
# Keep the running collector outside the revision cache it prunes. This also
|
|
404
|
+
# supports applying the resource play independently of a toolchain/T3 rollout.
|
|
405
|
+
- name: Install the tracked disk GC outside pruned revisions
|
|
406
|
+
ansible.builtin.copy:
|
|
407
|
+
src: '{{ playbook_dir }}/disk-gc.py'
|
|
408
|
+
dest: '{{ resourceSafety.diskGcScript }}'
|
|
409
|
+
owner: root
|
|
410
|
+
group: root
|
|
411
|
+
mode: '0644'
|
|
412
|
+
when: development_source is defined and disk_gc_source.stat.exists
|
|
395
413
|
# storage.disposable in fleet.json (fleet_storage_disposable) switches every
|
|
396
414
|
# node to the disposable policy (docs/ubuntu-sync.md, Disk GC): hours instead
|
|
397
415
|
# of days, worktrees saved in a recovery ref or done with on their remote,
|
|
@@ -422,7 +440,7 @@
|
|
|
422
440
|
After=docker.service
|
|
423
441
|
[Service]
|
|
424
442
|
Type=oneshot
|
|
425
|
-
ExecStart=/usr/bin/python3 -I -B {{
|
|
443
|
+
ExecStart=/usr/bin/python3 -I -B {{ resourceSafety.diskGcScript }} --home {{ development_home }} --git-temp-hours {{ resourceSafety.diskGcGitTempHours }} --fetch-max-mib {{ resourceSafety.diskGcFetchMaxMiB }} --path / --path {{ development_home }} --idle-days {{ gc_idle_days }} --pressure-mib {{ worker_disk_gc_pressure_mib }}{{ (' --target-used-percent ' ~ (fleet_storage_target_used_percent | default(gc_disposable.targetUsedPercent))) if disposable else '' }} --pressure-inode-percent {{ resourceSafety.inodeWarnFreePercent }} --pressure-idle-hours {{ resourceSafety.diskGcPressureIdleHours }} --docker-age-hours {{ resourceSafety.diskGcDockerAgeHours }} --pressure-docker-age-hours {{ resourceSafety.diskGcPressureDockerAgeHours }} --docker-cap-percent {{ resourceSafety.diskGcBuildCachePercent }} --host-var-tmp /run/homelab-host-var-tmp --host-tmp /run/homelab-host-tmp --mise-cache-mib {{ resourceSafety.diskGcMiseCacheMiB }} --home-cache-mib {{ resourceSafety.diskGcHomeCacheMiB }}{% for cache in resourceSafety.diskGcExcludedCaches %} --exclude-cache {{ cache }}{% endfor %}{% for store, mib in resourceSafety.diskGcStoreCapsMiB.items() %} --store-cap {{ store }}={{ mib }}{% endfor %}{% for root in resourceSafety.diskGcWorktreeRoots %} --worktree-root {{ root }}{% endfor %} --worktree-idle-days {{ gc_worktree_idle_days }}{{ ' --disposable' if disposable else '' }}{% for cache, mib in resourceSafety.diskGcCacheCapsMiB.items() %} --cache-cap {{ cache }}={{ mib }}{% endfor %} --keep-newest /var/cache/personal-fleet={{ resourceSafety.diskGcPackagesKept }}{% for root in resourceSafety.diskGcCheckoutRoots %} --keep-checkouts {{ root }}={{ resourceSafety.diskGcCheckoutsKept }}{% endfor %} --current {{ resourceSafety.diskGcCurrentCheckout }}{% for directory, hours in resourceSafety.diskGcExpireHours.items() %} --expire {{ directory }}={{ hours }}{% endfor %} --report {{ resourceSafety.diskGcReport }} --mise {{ development_home }}/.local/bin/mise --user {{ development_user }}{{ '' if worker_containers_on | default(true) | bool else ' --no-docker' }}
|
|
426
444
|
|
|
427
445
|
StateDirectory=personal-fleet-disk-gc
|
|
428
446
|
StateDirectoryMode=0755
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/homelab",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.8",
|
|
4
4
|
"description": "Keeps a set of development machines in sync: one manager and many workers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:crvouga/homelab",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=22"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "ca217613ff14b205a5a78b3654004581115d4155"
|
|
78
78
|
}
|