fix: вернул tar.gz, добавил wheels для Python 3.9-3.14, проверку версии
- архив снова tar.gz (сохраняет chmod +x) - wheels для Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 - install.sh проверяет Python >= 3.10 перед установкой
This commit is contained in:
parent
32c88ea463
commit
3ec3660455
33
build.sh
33
build.sh
@ -35,11 +35,26 @@ mkdir -p "$WHEELS_DIR" "$STAGE_DIR" "$DIST_DIR"
|
|||||||
# --- Step 1: Download wheel packages ---
|
# --- Step 1: Download wheel packages ---
|
||||||
echo "[1/4] Downloading dependencies as wheel packages..."
|
echo "[1/4] Downloading dependencies as wheel packages..."
|
||||||
|
|
||||||
|
# Download wheels for multiple Python versions to support different servers
|
||||||
|
PYTHON_VERSIONS="39 310 311 312 313 314"
|
||||||
|
echo " Downloading for Python versions: ${PYTHON_VERSIONS}"
|
||||||
|
|
||||||
|
for pyver in $PYTHON_VERSIONS; do
|
||||||
python3 -m pip download \
|
python3 -m pip download \
|
||||||
-r "$SCRIPT_DIR/requirements.txt" \
|
-r "$SCRIPT_DIR/requirements.txt" \
|
||||||
--dest "$WHEELS_DIR" \
|
--dest "$WHEELS_DIR" \
|
||||||
--quiet
|
--python-version "$pyver" \
|
||||||
|
--only-binary=:all: \
|
||||||
|
--quiet 2>/dev/null || true
|
||||||
|
done
|
||||||
|
|
||||||
|
# Also download pure-python wheels (no version constraint)
|
||||||
|
python3 -m pip download \
|
||||||
|
-r "$SCRIPT_DIR/requirements.txt" \
|
||||||
|
--dest "$WHEELS_DIR" \
|
||||||
|
--quiet 2>/dev/null || true
|
||||||
|
|
||||||
|
# Deduplicate (same file may be downloaded multiple times)
|
||||||
WHEEL_COUNT=$(find "$WHEELS_DIR" -type f | wc -l)
|
WHEEL_COUNT=$(find "$WHEELS_DIR" -type f | wc -l)
|
||||||
echo " Downloaded $WHEEL_COUNT packages:"
|
echo " Downloaded $WHEEL_COUNT packages:"
|
||||||
find "$WHEELS_DIR" -type f -printf " %f\n" | sort
|
find "$WHEELS_DIR" -type f -printf " %f\n" | sort
|
||||||
@ -84,6 +99,22 @@ cat > "$STAGE_DIR/install.sh" << 'INSTALL_SCRIPT'
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# --- Check Python version ---
|
||||||
|
PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2>/dev/null || echo "0.0")
|
||||||
|
PYTHON_MAJOR=$(echo "$PYTHON_VERSION" | cut -d. -f1)
|
||||||
|
PYTHON_MINOR=$(echo "$PYTHON_VERSION" | cut -d. -f2)
|
||||||
|
|
||||||
|
if [ "$PYTHON_MAJOR" -lt 3 ] || { [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -lt 10 ]; }; then
|
||||||
|
echo "ERROR: Python 3.10+ required, found Python ${PYTHON_VERSION}" >&2
|
||||||
|
echo "" >&2
|
||||||
|
echo "Install Python 3.10+:" >&2
|
||||||
|
echo " RHEL/CentOS: yum install python3.11" >&2
|
||||||
|
echo " ALT Linux: apt-get install python3" >&2
|
||||||
|
echo " Debian: apt install python3.11" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Python version: ${PYTHON_VERSION} (OK)"
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
INSTALL_DIR="/opt/airflow-monitor"
|
INSTALL_DIR="/opt/airflow-monitor"
|
||||||
SERVICE_USER="$(whoami)"
|
SERVICE_USER="$(whoami)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user