Skip to content

Commit

Permalink
Merge pull request #3 from postgresml/silas-merge-pgml
Browse files Browse the repository at this point in the history
Merge PGML
  • Loading branch information
SilasMarvin authored Jun 27, 2024
2 parents adce3cc + ced544b commit 3b84239
Show file tree
Hide file tree
Showing 109 changed files with 28,758 additions and 0 deletions.
126 changes: 126 additions & 0 deletions .github/workflows/javascript-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: deploy javascript sdk
on:
workflow_dispatch:
jobs:
build-javascript-sdk-macos-windows:
strategy:
matrix:
os:
[
"macos-latest",
"windows-latest",
]
include:
- neon-out-name: "x86_64-unknown-linux-gnu-index.node"
os: "ubuntu-22.04"
- neon-out-name: "aarch64-unknown-linux-gnu-index.node"
os: "buildjet-4vcpu-ubuntu-2204-arm"
- neon-out-name: "x86_64-apple-darwin-index.node"
os: "macos-latest"
- neon-out-name: "x86_64-pc-windows-gnu-index.node"
os: "windows-latest"
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: korvus/javascript
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Do build
env:
TYPESCRIPT_DECLARATION_FILE: "javascript/index.d.ts"
run: |
npm i
npm run build-release
- name: Upload built .node file
uses: actions/upload-artifact@v3
with:
name: node-artifacts
path: korvus/javascript/dist/${{ matrix.neon-out-name }}
retention-days: 1
build-javascript-sdk-linux:
strategy:
matrix:
os:
[
"ubuntu-22.04",
"buildjet-4vcpu-ubuntu-2204-arm",
]
include:
- neon-out-name: "x86_64-unknown-linux-gnu-index.node"
os: "ubuntu-22.04"
- neon-out-name: "aarch64-unknown-linux-gnu-index.node"
os: "buildjet-4vcpu-ubuntu-2204-arm"
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
defaults:
run:
working-directory: korvus/javascript
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
yum install -y perl-IPC-Cmd
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Do build
env:
TYPESCRIPT_DECLARATION_FILE: "javascript/index.d.ts"
run: |
npm i
npm run build-release
- name: Upload built .node file
uses: actions/upload-artifact@v3
with:
name: node-artifacts
path: korvus/javascript/dist/${{ matrix.neon-out-name }}
retention-days: 1
# publish-javascript-sdk:
# needs: build-javascript-sdk
# runs-on: "ubuntu-22.04"
# defaults:
# run:
# working-directory: korvus/javascript
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# - name: Validate cargo is working
# uses: postgresml/gh-actions-cargo@master
# with:
# command: version
# - name: Create artifact directory
# run: mkdir dist
# - name: Download artifacts
# uses: actions/download-artifact@v3
# with:
# name: node-artifacts
# path: pgml-sdks/rust/pgml/javascript/dist
# - uses: actions/setup-node@v3
# with:
# node-version: '20.x'
# registry-url: 'https://registry.npmjs.org'
# - name: Generate types declaration
# run: |
# npm i
# npm run build
# rm index.node
# - run: npm ci
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
135 changes: 135 additions & 0 deletions .github/workflows/python-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: deploy python sdk
on:
workflow_dispatch:
inputs:
deploy_to_pypi:
description: "Whether to deploy to PyPI (true) or TestPyPI (false)"
required: false
default: "false"
jobs:
deploy-python-sdk-linux:
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04", "buildjet-4vcpu-ubuntu-2204-arm"]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: korvus
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
sudo apt update
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo add-apt-repository -y ppa:apt-fast/stable
sudo apt update
sudo apt-get -y install apt-fast
sudo apt-fast -y install \
python3.7 python3.7-dev \
python3.8 python3.8-dev \
python3.9 python3.9-dev \
python3.10 python3.10-dev \
python3.11 python3.11-dev \
python3.12 python3.12-dev \
python3-pip \
git
pip install maturin
pip install patchelf
- name: Build and deploy wheels to TestPyPI
if: github.event.inputs.deploy_to_pypi == 'false'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/korvus/korvus.pyi"
run: maturin publish -r testpypi -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
- name: Build and deploy wheels to PyPI
if: github.event.inputs.deploy_to_pypi == 'true'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/korvus/korvus.pyi"
run: maturin publish -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python

deploy-python-sdk-mac:
runs-on: macos-latest
defaults:
run:
working-directory: korvus
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Install dependencies
run: |
# brew upgrade
# brew update
brew install [email protected]
brew install [email protected]
brew install [email protected]
brew install [email protected]
brew install [email protected]
pip3 install maturin --break-system-packages
- name: Build and deploy wheels to TestPyPI
if: github.event.inputs.deploy_to_pypi == 'false'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/korvus/korvus.pyi"
run: maturin publish -r testpypi -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
- name: Build and deploy wheels to PyPI
if: github.event.inputs.deploy_to_pypi == 'true'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/korvus/korvus.pyi"
run: maturin publish -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python

deploy-python-sdk-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
defaults:
run:
working-directory: korvus
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate cargo is working
uses: postgresml/gh-actions-cargo@master
with:
command: version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install maturin
- name: Build and deploy wheels to TestPyPI
if: github.event.inputs.deploy_to_pypi == 'false'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/korvus/korvus.pyi"
run: maturin publish -r testpypi -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
- name: Build and deploy wheels to PyPI
if: github.event.inputs.deploy_to_pypi == 'true'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYTHON_STUB_FILE: "python/korvus/korvus.pyi"
run: maturin publish -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --skip-existing -F python
5 changes: 5 additions & 0 deletions korvus/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-fuse-ld=/usr/bin/mold"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-fuse-ld=/usr/bin/mold"]
Loading

0 comments on commit 3b84239

Please sign in to comment.