fix: fix: agents container missing procps package — formula-session check_memory fails (#211)
This commit is contained in:
parent
9a1c9cc2f7
commit
c362ac1440
2 changed files with 6 additions and 1 deletions
|
|
@ -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/*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue