Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

update build matrix #1675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
Loading
from
Open
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
67 changes: 60 additions & 7 deletions 67 .github/workflows/ubuntu-packages-and-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@ jobs:
strategy:
fail-fast: false # Let the other job finish
matrix:
os: ["buildjet-4vcpu-ubuntu-2204", "buildjet-8vcpu-ubuntu-2204-arm"]
include:
# Ubuntu 24.04 LTS (Noble)
- os: "ubuntu-24.04"
ubuntu_version: "noble"
arch: "amd64"
- os: "ubuntu-24.04-arm"
ubuntu_version: "noble"
arch: "arm64"
# Ubuntu 22.04 LTS (Jammy)
- os: "ubuntu-22.04"
ubuntu_version: "jammy"
arch: "amd64"
- os: "ubuntu-22.04-arm"
ubuntu_version: "jammy"
arch: "arm64"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -78,14 +92,16 @@ jobs:
postgresql-14 \
postgresql-13 \
postgresql-12 \
postgresql-11 \
postgresql-server-dev-17 \
postgresql-server-dev-16 \
postgresql-server-dev-15 \
postgresql-server-dev-14 \
postgresql-server-dev-13 \
postgresql-server-dev-12 \
postgresql-server-dev-11 \
lsb-release \
python3.10 \
python3.11 \
python3-pip \
libpython3.10-dev \
python3.10-dev \
Expand All @@ -94,6 +110,7 @@ jobs:

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
sudo dpkg --configure -a
dpkg-deb --version
- name: Install pgrx
uses: postgresml/gh-actions-cargo@master
Expand Down Expand Up @@ -161,9 +178,23 @@ jobs:
postgresml:
needs: postgresml-pgml
strategy:
fail-fast: false # Let the other job finish
fail-fast: false
matrix:
os: ["ubuntu-22.04"]
include:
# Ubuntu 24.04 LTS (Noble)
- os: "ubuntu-24.04"
ubuntu_version: "noble"
arch: "amd64"
- os: "ubuntu-24.04-arm"
ubuntu_version: "noble"
arch: "arm64"
# Ubuntu 22.04 LTS (Jammy)
- os: "ubuntu-22.04"
ubuntu_version: "jammy"
arch: "amd64"
- os: "ubuntu-22.04-arm"
ubuntu_version: "jammy"
arch: "arm64"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -180,15 +211,35 @@ jobs:
#
postgresml-dashboard:
strategy:
fail-fast: false # Let the other job finish
fail-fast: false
matrix:
os: ["ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm"]
include:
# Ubuntu 24.04 LTS (Noble)
- os: "ubuntu-24.04"
ubuntu_version: "noble"
arch: "amd64"
- os: "ubuntu-24.04-arm"
ubuntu_version: "noble"
arch: "arm64"
# Ubuntu 22.04 LTS (Jammy)
- os: "ubuntu-22.04"
ubuntu_version: "jammy"
arch: "amd64"
- os: "ubuntu-22.04-arm"
ubuntu_version: "jammy"
arch: "arm64"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Update dependencies
run: |
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
sudo dpkg --configure -a
dpkg-deb --version
- name: Build and release package
env:
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }}
Expand All @@ -208,7 +259,9 @@ jobs:
strategy:
fail-fast: false # Let the other job finish
matrix:
os: ["buildjet-4vcpu-ubuntu-2204"]
include:
- os: "ubuntu-24.04"
ubuntu_version: "noble"
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
36 changes: 34 additions & 2 deletions 36 .github/workflows/ubuntu-postgresml-python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,49 @@ on:
workflow_dispatch:
inputs:
packageVersion:
default: "2.8.4"
default: "2.10.0"

jobs:
postgresml-python:
strategy:
fail-fast: false # Let the other job finish
matrix:
os: ["buildjet-4vcpu-ubuntu-2204", "buildjet-4vcpu-ubuntu-2204-arm", "ubuntu-24.04"]
include:
# Ubuntu 24.04 LTS (Noble)
- os: "ubuntu-24.04"
ubuntu_version: "noble"
arch: "amd64"
- os: "ubuntu-24.04-arm"
ubuntu_version: "noble"
arch: "arm64"
# Ubuntu 22.04 LTS (Jammy)
- os: "ubuntu-22.04"
ubuntu_version: "jammy"
arch: "amd64"
- os: "ubuntu-22.04-arm"
ubuntu_version: "jammy"
arch: "arm64"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:apt-fast/stable --yes
sudo add-apt-repository ppa:deadsnakes/ppa --yes
sudo apt update

sudo apt-get install -y apt-fast
sudo apt-get update && sudo apt-fast install -y \
python3.11 \
python3-pip \
libpython3.11-dev \
python3.11-dev

sudo dpkg --configure -a
- name: Build and release package
env:
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }}
Expand Down
28 changes: 16 additions & 12 deletions 28 packages/postgresml-dashboard/build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
set -e

# Parse arguments
PACKAGE_VERSION=${1:-"2.10.0"}
UBUNTU_VERSION=${2:-"22.04"}
# Parse arguments with environment variable fallbacks
PACKAGE_VERSION=${1:-${PACKAGE_VERSION:-"2.10.0"}}
UBUNTU_VERSION=${2:-${ubuntu_version:-$(lsb_release -rs)}}
ARCH=${3:-${ARCH:-$(arch | sed 's/x86_64/amd64/; s/aarch64/arm64/')}}

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"
echo "Usage: $0 <package version> [ubuntu version] [arch]"
echo "Example: $0 2.10.0 22.04 amd64"
exit 1
fi

Expand All @@ -19,12 +20,16 @@ source_dir="$dir/source"

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
else
export ARCH=arm64
fi
export ARCH

# Fetch GitHub stars count with error handling
GITHUB_STARS=$(curl -s "https://api.github.com/repos/postgresml/postgresml" | grep stargazers_count | cut -d : -f 2 | tr -d " " | tr -d "," || echo "0")
export GITHUB_STARS

echo "Building dashboard package:"
echo "- Version: ${PACKAGE_VERSION}"
echo "- Ubuntu: ${UBUNTU_VERSION}"
echo "- Architecture: ${ARCH}"

rm -rf "$dir"
mkdir -p "$deb_dir"
Expand All @@ -33,7 +38,6 @@ cp -R ${SCRIPT_DIR}/* "$deb_dir"
rm "$deb_dir/build.sh"
rm "$deb_dir/release.sh"


( cd ${SCRIPT_DIR}/../../pgml-dashboard && \
cargo build --release && \
cp target/release/pgml-dashboard "$deb_dir/usr/bin/pgml-dashboard" && \
Expand Down
83 changes: 46 additions & 37 deletions 83 packages/postgresml-dashboard/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,64 @@ if [[ -z "$package_version" ]]; then
exit 1
fi

# Active LTS Ubuntu versions and their codenames
declare -A ubuntu_versions=(
["20.04"]="focal"
["22.04"]="jammy"
["24.04"]="noble"
)
# Set architecture based on system unless overridden by environment
if [[ -z "${ARCH}" ]]; then
if [[ $(arch) == "x86_64" ]]; then
export ARCH=amd64
else
export ARCH=arm64
fi
fi

# Get Ubuntu version from environment or try to detect it
if [[ -z "${ubuntu_version}" ]]; then
ubuntu_version=$(lsb_release -rs)
echo "No ubuntu_version specified, detected: ${ubuntu_version}"
fi

# Supported architectures
declare -a architectures=("amd64" "arm64")
# Map version number to codename
case "${ubuntu_version}" in
"20.04")
export CODENAME="focal"
;;
"22.04")
export CODENAME="jammy"
;;
"24.04")
export CODENAME="noble"
;;
*)
echo "Error: Unsupported Ubuntu version: ${ubuntu_version}"
exit 1
;;
esac

# 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() {
local ubuntu_version=$1
local arch=$2
echo "postgresml-dashboard-${package_version}-ubuntu${ubuntu_version}-${arch}.deb"
echo "postgresml-dashboard-${package_version}-ubuntu${ubuntu_version}-${ARCH}.deb"
}

# Loop through Ubuntu versions
for ubuntu_version in "${!ubuntu_versions[@]}"; do
codename=${ubuntu_versions[$ubuntu_version]}
echo "Building packages for Ubuntu ${ubuntu_version} (${codename})"
echo "Building package for Ubuntu ${ubuntu_version} (${CODENAME}) ${ARCH}"

# Loop through architectures
for arch in "${architectures[@]}"; do
echo "Building for architecture: ${arch}"
export ARCH=${arch}
# Build the package
bash ${SCRIPT_DIR}/build.sh "$package_version" "$ubuntu_version" "$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
if [[ ! -f $(package_name) ]]; then
echo "File $(package_name) doesn't exist"
exit 1
fi

# Upload to S3
deb-s3 upload \
--lock \
--bucket apt.postgresml.org \
$(package_name ${ubuntu_version} ${arch}) \
--codename ${codename}
# Upload to S3
deb-s3 upload \
--lock \
--bucket apt.postgresml.org \
$(package_name) \
--codename ${CODENAME}

# Clean up the package file
rm $(package_name ${ubuntu_version} ${arch})
done
done
# Clean up the package file
rm $(package_name)
Loading
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.