Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 && \
Expand All @@ -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"]
21 changes: 17 additions & 4 deletions packages/postgresml-dashboard/build.sh
Original file line number Diff line number Diff line change
@@ -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 <package version> [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
Expand All @@ -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*
Expand All @@ -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"
57 changes: 41 additions & 16 deletions packages/postgresml-dashboard/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,60 @@ 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 <package version, e.g. 2.10.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
deb-s3
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
34 changes: 23 additions & 11 deletions packages/postgresml-python/build.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
#!/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"

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"
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"
Expand All @@ -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"
71 changes: 47 additions & 24 deletions packages/postgresml-python/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <package version, e.g. 2.10.0>"
exit 1
echo "postgresml-python package build and release script"
echo "Usage: $0 <package version, e.g. 2.10.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
2 changes: 1 addition & 1 deletion packages/postgresml/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
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