From d8599b28755f4a7b6342d03f68c2a91093b78e8c Mon Sep 17 00:00:00 2001 From: Montana Low Date: Fri, 17 Jan 2025 10:44:36 -0800 Subject: [PATCH 1/2] update docker container --- docker/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index efd034649..5e7daa973 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 +FROM nvidia/cuda:12.6.3-devel-ubuntu24.04 ENV PATH="/usr/local/cuda/bin:${PATH}" RUN apt update && \ apt install -y \ @@ -15,8 +15,8 @@ RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | te ENV TZ=UTC ENV DEBIAN_FRONTEND=noninteractive -RUN apt update -y && apt install git postgresml-15 postgresml-dashboard -y -RUN git clone --branch v0.5.0 https://github.com/pgvector/pgvector && \ +RUN apt update -y && apt install git postgresml-17 postgresml-dashboard -y +RUN git clone --branch v0.8.0 https://github.com/pgvector/pgvector && \ cd pgvector && \ echo "trusted = true" >> vector.control && \ make && \ @@ -25,7 +25,7 @@ echo "trusted = true" >> vector.control && \ COPY entrypoint.sh /app/entrypoint.sh COPY dashboard.sh /app/dashboard.sh -COPY --chown=postgres:postgres local_dev.conf /etc/postgresql/15/main/conf.d/01-local_dev.conf -COPY --chown=postgres:postgres pg_hba.conf /etc/postgresql/15/main/pg_hba.conf +COPY --chown=postgres:postgres local_dev.conf /etc/postgresql/17/main/conf.d/01-local_dev.conf +COPY --chown=postgres:postgres pg_hba.conf /etc/postgresql/17/main/pg_hba.conf ENTRYPOINT ["bash", "/app/entrypoint.sh"] From af55b2681c874e1ac2db7c27c4fb11d9fa87f778 Mon Sep 17 00:00:00 2001 From: Montana Low Date: Fri, 17 Jan 2025 11:55:21 -0800 Subject: [PATCH 2/2] package for multiple versions of ubuntu --- packages/postgresml-dashboard/build.sh | 21 +++++-- packages/postgresml-dashboard/release.sh | 57 +++++++++++++------ packages/postgresml-python/build.sh | 34 ++++++++---- packages/postgresml-python/release.sh | 71 ++++++++++++++++-------- packages/postgresml/build.sh | 2 +- packages/postgresql-pgml/release.sh | 71 +++++++++++++++++------- 6 files changed, 180 insertions(+), 76 deletions(-) diff --git a/packages/postgresml-dashboard/build.sh b/packages/postgresml-dashboard/build.sh index b35603b2c..7c28999ef 100644 --- a/packages/postgresml-dashboard/build.sh +++ b/packages/postgresml-dashboard/build.sh @@ -1,11 +1,24 @@ #!/bin/bash set -e +# Parse arguments +PACKAGE_VERSION=${1:-"2.10.0"} +UBUNTU_VERSION=${2:-"22.04"} + +if [[ -z "$PACKAGE_VERSION" ]]; then + echo "postgresml dashboard build script" + echo "Usage: $0 [ubuntu version]" + echo "Example: $0 2.10.0 22.04" + exit 1 +fi + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) dir="/tmp/postgresml-dashboard" deb_dir="$dir/deb-build" source_dir="$dir/source" -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -export PACKAGE_VERSION=${1:-"2.10.0"} + +export PACKAGE_VERSION +export UBUNTU_VERSION export GITHUB_STARS=$(curl -s "https://api.github.com/repos/postgresml/postgresml" | grep stargazers_count | cut -d : -f 2 | tr -d " " | tr -d ",") if [[ $(arch) == "x86_64" ]]; then export ARCH=amd64 @@ -27,7 +40,7 @@ rm "$deb_dir/release.sh" cp -R static "$deb_dir/usr/share/pgml-dashboard/dashboard-static" && \ cp -R ../pgml-cms "$deb_dir/usr/share/pgml-cms" ) -(cat ${SCRIPT_DIR}/DEBIAN/control | envsubst) > "$deb_dir/DEBIAN/control" +(cat ${SCRIPT_DIR}/DEBIAN/control | envsubst '${PACKAGE_VERSION} ${UBUNTU_VERSION} ${ARCH}') > "$deb_dir/DEBIAN/control" (cat ${SCRIPT_DIR}/etc/systemd/system/pgml-dashboard.service | envsubst) > "$deb_dir/etc/systemd/system/pgml-dashboard.service" chmod 755 ${deb_dir}/DEBIAN/post* @@ -36,6 +49,6 @@ chmod 755 ${deb_dir}/DEBIAN/pre* dpkg-deb \ --root-owner-group \ --build "$deb_dir" \ - postgresml-dashboard-${PACKAGE_VERSION}-ubuntu22.04-${ARCH}.deb + "postgresml-dashboard-${PACKAGE_VERSION}-ubuntu${UBUNTU_VERSION}-${ARCH}.deb" rm -rf "$dir" diff --git a/packages/postgresml-dashboard/release.sh b/packages/postgresml-dashboard/release.sh index c06342129..0b5abf2a8 100644 --- a/packages/postgresml-dashboard/release.sh +++ b/packages/postgresml-dashboard/release.sh @@ -5,16 +5,22 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) package_version="$1" if [[ -z "$package_version" ]]; then + echo "postgresml dashboard package build and release script" echo "Usage: $0 " exit 1 fi -if [[ $(arch) == "x86_64" ]]; then - export ARCH=amd64 -else - export ARCH=arm64 -fi +# Active LTS Ubuntu versions and their codenames +declare -A ubuntu_versions=( + ["20.04"]="focal" + ["22.04"]="jammy" + ["24.04"]="noble" +) + +# Supported architectures +declare -a architectures=("amd64" "arm64") +# Install deb-s3 if not present if ! which deb-s3; then curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem sudo gem install deb-s3-0.11.4.gem @@ -22,18 +28,37 @@ if ! which deb-s3; then fi function package_name() { - echo "postgresml-dashboard-${package_version}-ubuntu22.04-${ARCH}.deb" + local ubuntu_version=$1 + local arch=$2 + echo "postgresml-dashboard-${package_version}-ubuntu${ubuntu_version}-${arch}.deb" } -bash ${SCRIPT_DIR}/build.sh "$package_version" +# Loop through Ubuntu versions +for ubuntu_version in "${!ubuntu_versions[@]}"; do + codename=${ubuntu_versions[$ubuntu_version]} + echo "Building packages for Ubuntu ${ubuntu_version} (${codename})" -if [[ ! -f $(package_name) ]]; then - echo "File $(package_name) doesn't exist" - exit 1 -fi + # Loop through architectures + for arch in "${architectures[@]}"; do + echo "Building for architecture: ${arch}" + export ARCH=${arch} + + # Build the dashboard package + bash ${SCRIPT_DIR}/build.sh "$package_version" "$ubuntu_version" + + if [[ ! -f $(package_name ${ubuntu_version} ${arch}) ]]; then + echo "File $(package_name ${ubuntu_version} ${arch}) doesn't exist" + exit 1 + fi + + # Upload to S3 + deb-s3 upload \ + --lock \ + --bucket apt.postgresml.org \ + $(package_name ${ubuntu_version} ${arch}) \ + --codename ${codename} -deb-s3 upload \ - --lock \ - --bucket apt.postgresml.org \ - $(package_name) \ - --codename $(lsb_release -cs) + # Clean up the package file + rm $(package_name ${ubuntu_version} ${arch}) + done +done diff --git a/packages/postgresml-python/build.sh b/packages/postgresml-python/build.sh index 602a8ca1e..b7f1167ce 100644 --- a/packages/postgresml-python/build.sh +++ b/packages/postgresml-python/build.sh @@ -1,21 +1,33 @@ #!/bin/bash -# -# -# set -e + SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) deb_dir="/tmp/postgresml-python/deb-build" -major=${1:-"14"} +# Parse arguments with defaults export PACKAGE_VERSION=${1:-"2.10.0"} -export PYTHON_VERSION=${2:-"3.10"} +export UBUNTU_VERSION=${2:-"22.04"} +export PYTHON_VERSION=${3:-"3.10"} +# Handle architecture if [[ $(arch) == "x86_64" ]]; then export ARCH=amd64 else export ARCH=arm64 fi +# Map Ubuntu versions to Python versions if needed +# For example: Ubuntu 20.04 uses Python 3.8 by default +declare -A ubuntu_python_versions=( + ["20.04"]="3.8" + ["22.04"]="3.10" + ["24.04"]="3.11" +) + +if [[ -z "$3" ]]; then + PYTHON_VERSION=${ubuntu_python_versions[$UBUNTU_VERSION]:-"3.10"} +fi + rm -rf "$deb_dir" mkdir -p "$deb_dir" @@ -23,10 +35,10 @@ cp -R ${SCRIPT_DIR}/* "$deb_dir" rm "$deb_dir/build.sh" rm "$deb_dir/release.sh" -(cat ${SCRIPT_DIR}/DEBIAN/control | envsubst) > "$deb_dir/DEBIAN/control" -(cat ${SCRIPT_DIR}/DEBIAN/postinst | envsubst '${PGVERSION}') > "$deb_dir/DEBIAN/postinst" -(cat ${SCRIPT_DIR}/DEBIAN/prerm | envsubst '${PGVERSION}') > "$deb_dir/DEBIAN/prerm" -(cat ${SCRIPT_DIR}/DEBIAN/postrm | envsubst '${PGVERSION}') > "$deb_dir/DEBIAN/postrm" +(cat ${SCRIPT_DIR}/DEBIAN/control | envsubst '${PACKAGE_VERSION} ${UBUNTU_VERSION} ${ARCH} ${PYTHON_VERSION}') > "$deb_dir/DEBIAN/control" +(cat ${SCRIPT_DIR}/DEBIAN/postinst | envsubst '${PGVERSION} ${PYTHON_VERSION}') > "$deb_dir/DEBIAN/postinst" +(cat ${SCRIPT_DIR}/DEBIAN/prerm | envsubst '${PGVERSION} ${PYTHON_VERSION}') > "$deb_dir/DEBIAN/prerm" +(cat ${SCRIPT_DIR}/DEBIAN/postrm | envsubst '${PGVERSION} ${PYTHON_VERSION}') > "$deb_dir/DEBIAN/postrm" if [[ "$ARCH" == "amd64" ]]; then cp ${SCRIPT_DIR}/../../pgml-extension/requirements.linux.txt "$deb_dir/etc/postgresml-python/requirements.txt" @@ -34,7 +46,7 @@ else cp ${SCRIPT_DIR}/../../pgml-extension/requirements.macos.txt "$deb_dir/etc/postgresml-python/requirements.txt" fi -virtualenv --python="python$PYTHON_VERSION" "$deb_dir/var/lib/postgresml-python/pgml-venv" +virtualenv --python="python${PYTHON_VERSION}" "$deb_dir/var/lib/postgresml-python/pgml-venv" source "$deb_dir/var/lib/postgresml-python/pgml-venv/bin/activate" python -m pip install -r "${deb_dir}/etc/postgresml-python/requirements.txt" @@ -48,6 +60,6 @@ dpkg-deb \ --root-owner-group \ -z1 \ --build "$deb_dir" \ - postgresml-python-${PACKAGE_VERSION}-ubuntu22.04-${ARCH}.deb + "postgresml-python-${PACKAGE_VERSION}-ubuntu${UBUNTU_VERSION}-${ARCH}.deb" rm -rf "$deb_dir" diff --git a/packages/postgresml-python/release.sh b/packages/postgresml-python/release.sh index e3b7371cf..3420b2628 100644 --- a/packages/postgresml-python/release.sh +++ b/packages/postgresml-python/release.sh @@ -4,41 +4,64 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) package_version="$1" -if [[ $(arch) == "x86_64" ]]; then - arch=amd64 -else - arch=arm64 -fi - if [[ -z "$package_version" ]]; then - echo "postgresml-python package build and release script" - echo "usage: $0 " - exit 1 + echo "postgresml-python package build and release script" + echo "Usage: $0 " + exit 1 fi +# Active LTS Ubuntu versions and their codenames +declare -A ubuntu_versions=( + ["20.04"]="focal" + ["22.04"]="jammy" + ["24.04"]="noble" +) + +# Supported architectures +declare -a architectures=("amd64" "arm64") + +# Install deb-s3 if not present if ! which deb-s3; then - curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem - sudo gem install deb-s3-0.11.4.gem - deb-s3 + curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem + sudo gem install deb-s3-0.11.4.gem + deb-s3 fi +# Install Python dependencies sudo apt install python3-pip python3 python3-virtualenv -y function package_name() { - echo "postgresml-python-$package_version-ubuntu22.04-${arch}.deb" + local ubuntu_version=$1 + local arch=$2 + echo "postgresml-python-${package_version}-ubuntu${ubuntu_version}-${arch}.deb" } -bash ${SCRIPT_DIR}/build.sh ${package_version} +# Loop through Ubuntu versions +for ubuntu_version in "${!ubuntu_versions[@]}"; do + codename=${ubuntu_versions[$ubuntu_version]} + echo "Building packages for Ubuntu ${ubuntu_version} (${codename})" -if [[ ! -f $(package_name ${pg}) ]]; then - echo "File $(package_name ${pg}) doesn't exist" - exit 1 -fi + # Loop through architectures + for arch in "${architectures[@]}"; do + echo "Building for architecture: ${arch}" + export ARCH=${arch} + + # Build the Python package + bash ${SCRIPT_DIR}/build.sh "$package_version" "$ubuntu_version" + + if [[ ! -f $(package_name ${ubuntu_version} ${arch}) ]]; then + echo "File $(package_name ${ubuntu_version} ${arch}) doesn't exist" + exit 1 + fi -deb-s3 upload \ - --lock \ - --bucket apt.postgresml.org \ - $(package_name ${pg}) \ - --codename $(lsb_release -cs) + # Upload to S3 + deb-s3 upload \ + --lock \ + --bucket apt.postgresml.org \ + $(package_name ${ubuntu_version} ${arch}) \ + --codename ${codename} -rm $(package_name ${pg}) + # Clean up the package file + rm $(package_name ${ubuntu_version} ${arch}) + done +done diff --git a/packages/postgresml/build.sh b/packages/postgresml/build.sh index b6daed532..4e0f224ba 100644 --- a/packages/postgresml/build.sh +++ b/packages/postgresml/build.sh @@ -4,7 +4,7 @@ set -e SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) export PACKAGE_VERSION=${1:-"2.10.0"} -export PGVERSION=${2:-"14"} +export PGVERSION=${2:-"17"} export UBUNTU_VERSION=${3:-"24.04"} deb_dir="/tmp/postgresml/deb-build" diff --git a/packages/postgresql-pgml/release.sh b/packages/postgresql-pgml/release.sh index 6153a7dba..28d760c92 100644 --- a/packages/postgresql-pgml/release.sh +++ b/packages/postgresql-pgml/release.sh @@ -9,12 +9,18 @@ if [[ -z "${1}" ]]; then fi export PACKAGE_VERSION=${1} -if [[ $(arch) == "x86_64" ]]; then - export ARCH=amd64 -else - export ARCH=arm64 -fi +# Active LTS Ubuntu versions and their codenames +declare -A ubuntu_versions=( + ["20.04"]="focal" + ["22.04"]="jammy" + ["24.04"]="noble" +) + +# Supported architectures +declare -a architectures=("amd64" "arm64") + +# Install deb-s3 if not present if ! which deb-s3; then curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem sudo gem install deb-s3-0.11.4.gem @@ -24,25 +30,50 @@ fi extension_dir="${SCRIPT_DIR}/../../pgml-extension" function package_name() { - echo "postgresql-pgml-${1}_${PACKAGE_VERSION}-ubuntu22.04-${ARCH}.deb" + local pg_version=$1 + local ubuntu_version=$2 + local arch=$3 + echo "postgresql-pgml-${pg_version}_${PACKAGE_VERSION}-ubuntu${ubuntu_version}-${arch}.deb" } -for pg in {12..16}; do - release_dir="$extension_dir/target/release/pgml-pg${pg}" +# Loop through Ubuntu versions +for ubuntu_version in "${!ubuntu_versions[@]}"; do + codename=${ubuntu_versions[$ubuntu_version]} + echo "Building packages for Ubuntu ${ubuntu_version} (${codename})" + + # Loop through architectures + for arch in "${architectures[@]}"; do + echo "Building for architecture: ${arch}" + export ARCH=${arch} + + # Loop through PostgreSQL versions + for pg in {11..17}; do + echo "Building PostgreSQL ${pg} package..." + + release_dir="$extension_dir/target/release/pgml-pg${pg}" + mkdir -p "$release_dir/DEBIAN" - mkdir -p "$release_dir/DEBIAN" + export PGVERSION=${pg} + # Update control file with Ubuntu version + (cat ${SCRIPT_DIR}/DEBIAN/control | + envsubst '${PGVERSION} ${PACKAGE_VERSION} ${ARCH}') > "$release_dir/DEBIAN/control" - export PGVERSION=${pg} - (cat ${SCRIPT_DIR}/DEBIAN/control | envsubst '${PGVERSION} ${PACKAGE_VERSION} ${ARCH}') > "$release_dir/DEBIAN/control" + # Build the package + dpkg-deb \ + --root-owner-group \ + -z1 \ + --build "$release_dir" \ + $(package_name ${pg} ${ubuntu_version} ${arch}) - dpkg-deb \ - --root-owner-group \ - -z1 \ - --build "$release_dir" \ - $(package_name ${pg}) + # Upload to S3 + deb-s3 upload \ + --lock \ + --bucket apt.postgresml.org \ + $(package_name ${pg} ${ubuntu_version} ${arch}) \ + --codename ${codename} - deb-s3 upload \ - --bucket apt.postgresml.org \ - $(package_name ${pg}) \ - --codename $(lsb_release -cs) + # Clean up the package file + rm $(package_name ${pg} ${ubuntu_version} ${arch}) + done + done done pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy