Merge pull request 'fix: fix: agents container missing procps package — formula-session check_memory fails (#211)' (#217) from fix/issue-211 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

This commit is contained in:
dev-qwen 2026-04-05 14:28:37 +00:00
commit 55e4132560
2 changed files with 6 additions and 1 deletions

View file

@ -1,7 +1,7 @@
FROM debian:bookworm-slim FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
bash curl git jq tmux cron python3 python3-pip openssh-client ca-certificates age shellcheck \ bash curl git jq tmux cron python3 python3-pip openssh-client ca-certificates age shellcheck procps \
&& pip3 install --break-system-packages networkx \ && pip3 install --break-system-packages networkx \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*

View file

@ -44,6 +44,11 @@ acquire_cron_lock() {
# Exits 0 (skip) if available memory is below MIN_MB (default 2000). # Exits 0 (skip) if available memory is below MIN_MB (default 2000).
check_memory() { check_memory() {
local min_mb="${1:-2000}" local min_mb="${1:-2000}"
# Graceful fallback if free command is not available (procps not installed)
if ! command -v free &>/dev/null; then
log "run: free not found, skipping memory check"
return 0
fi
local avail_mb local avail_mb
avail_mb=$(free -m | awk '/Mem:/{print $7}') avail_mb=$(free -m | awk '/Mem:/{print $7}')
if [ "${avail_mb:-0}" -lt "$min_mb" ]; then if [ "${avail_mb:-0}" -lt "$min_mb" ]; then