anurag008w commited on
Commit
3f3cffe
·
1 Parent(s): 6337377

Update pip commands to use --break-system-packages

Browse files
Files changed (1) hide show
  1. start.sh +13 -5
start.sh CHANGED
@@ -1073,7 +1073,7 @@ apt() {
1073
  }
1074
  pip() {
1075
  if [ "${1:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "$@" && ! _hc_has_arg --prefix "$@"; then
1076
- command pip install --user "${@:2}"
1077
  else
1078
  command pip "$@"
1079
  fi
@@ -1085,7 +1085,7 @@ pip() {
1085
  }
1086
  pip3() {
1087
  if [ "${1:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "$@" && ! _hc_has_arg --prefix "$@"; then
1088
- command pip3 install --user "${@:2}"
1089
  else
1090
  command pip3 "$@"
1091
  fi
@@ -1097,7 +1097,7 @@ pip3() {
1097
  }
1098
  python() {
1099
  if [ "${1:-}" = "-m" ] && [ "${2:-}" = "pip" ] && [ "${3:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "${@:3}" && ! _hc_has_arg --prefix "${@:3}"; then
1100
- command python -m pip install --user "${@:4}"
1101
  else
1102
  command python "$@"
1103
  fi
@@ -1109,7 +1109,7 @@ python() {
1109
  }
1110
  python3() {
1111
  if [ "${1:-}" = "-m" ] && [ "${2:-}" = "pip" ] && [ "${3:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "${@:3}" && ! _hc_has_arg --prefix "${@:3}"; then
1112
- command python3 -m pip install --user "${@:4}"
1113
  else
1114
  command python3 "$@"
1115
  fi
@@ -1318,7 +1318,7 @@ fi
1318
  if [ -n "${HUGGINGCLAW_PIP_PACKAGES:-}" ]; then
1319
  echo "Installing Python packages from HUGGINGCLAW_PIP_PACKAGES..."
1320
  read -r -a HC_PIP_PACKAGES <<< "$HUGGINGCLAW_PIP_PACKAGES"
1321
- if python3 -m pip install --user "${HC_PIP_PACKAGES[@]}"; then
1322
  echo "HUGGINGCLAW_PIP_PACKAGES install complete."
1323
  else
1324
  HC_STARTUP_FAILURES=$((HC_STARTUP_FAILURES + 1))
@@ -1456,6 +1456,14 @@ start_guardian_once() {
1456
  }
1457
 
1458
  while true; do
 
 
 
 
 
 
 
 
1459
  # Check JupyterLab process - restart if died unexpectedly
1460
  if [ "$RUNTIME_JUPYTER_ENABLED" = "true" ]; then
1461
  if [ -n "${JUPYTER_PID:-}" ]; then
 
1073
  }
1074
  pip() {
1075
  if [ "${1:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "$@" && ! _hc_has_arg --prefix "$@"; then
1076
+ command pip install --user --break-system-packages "${@:2}"
1077
  else
1078
  command pip "$@"
1079
  fi
 
1085
  }
1086
  pip3() {
1087
  if [ "${1:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "$@" && ! _hc_has_arg --prefix "$@"; then
1088
+ command pip3 install --user --break-system-packages "${@:2}"
1089
  else
1090
  command pip3 "$@"
1091
  fi
 
1097
  }
1098
  python() {
1099
  if [ "${1:-}" = "-m" ] && [ "${2:-}" = "pip" ] && [ "${3:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "${@:3}" && ! _hc_has_arg --prefix "${@:3}"; then
1100
+ command python -m pip install --user --break-system-packages "${@:4}"
1101
  else
1102
  command python "$@"
1103
  fi
 
1109
  }
1110
  python3() {
1111
  if [ "${1:-}" = "-m" ] && [ "${2:-}" = "pip" ] && [ "${3:-}" = "install" ] && [ -z "${VIRTUAL_ENV:-}" ] && ! _hc_has_arg --user "${@:3}" && ! _hc_has_arg --prefix "${@:3}"; then
1112
+ command python3 -m pip install --user --break-system-packages "${@:4}"
1113
  else
1114
  command python3 "$@"
1115
  fi
 
1318
  if [ -n "${HUGGINGCLAW_PIP_PACKAGES:-}" ]; then
1319
  echo "Installing Python packages from HUGGINGCLAW_PIP_PACKAGES..."
1320
  read -r -a HC_PIP_PACKAGES <<< "$HUGGINGCLAW_PIP_PACKAGES"
1321
+ if python3 -m pip install --user --break-system-packages "${HC_PIP_PACKAGES[@]}"; then
1322
  echo "HUGGINGCLAW_PIP_PACKAGES install complete."
1323
  else
1324
  HC_STARTUP_FAILURES=$((HC_STARTUP_FAILURES + 1))
 
1456
  }
1457
 
1458
  while true; do
1459
+ # Check health-server process - restart if died unexpectedly
1460
+ if [ -n "${HEALTH_PID:-}" ] && ! kill -0 "$HEALTH_PID" 2>/dev/null; then
1461
+ echo "Warning: health-server exited (PID $HEALTH_PID dead); restarting..."
1462
+ node /home/node/app/health-server.js &
1463
+ HEALTH_PID=$!
1464
+ echo "Health server restarted (PID: $HEALTH_PID)"
1465
+ fi
1466
+
1467
  # Check JupyterLab process - restart if died unexpectedly
1468
  if [ "$RUNTIME_JUPYTER_ENABLED" = "true" ]; then
1469
  if [ -n "${JUPYTER_PID:-}" ]; then