Skip to content
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

[WIP] Make Rust flyteidl PyO3-ready #5525

Draft
wants to merge 126 commits into
base: flyrs
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
7a29c35
add google well-know-types `.proto` files to avoid using `prost_types…
austin362667 Jun 27, 2024
cac7443
add tonic builder as `flyteidl` code generator
austin362667 Jun 27, 2024
8ee56af
add config
austin362667 Jun 27, 2024
3711e7c
add prost
austin362667 Jun 27, 2024
dfad6c6
expose rust idl structures through PyO3 as `flyteidl-rust` python bin…
austin362667 Jun 27, 2024
4831f45
add `/python` for `.pyi` python type hints
austin362667 Jun 27, 2024
b90c510
fmt & clippy
austin362667 Jun 27, 2024
dc6ce58
add `.so` to git ignore
austin362667 Jun 27, 2024
1edc3a0
switch local pyo3_macro for pyclass constructor
austin362667 Jul 5, 2024
ac14200
add auxiliary scripts fix pyo3 `enum` cannot be `subclass`ed
austin362667 Jul 5, 2024
8982055
introducing declarative submodules after pyo3 fixed PyO3/pyo3/9afc38a…
austin362667 Jul 5, 2024
7a79ea9
cleanup unused code in pyor_macro
austin362667 Jul 6, 2024
3ba904c
update type hints file `.pyi`
austin362667 Jul 6, 2024
9ad467a
cleanup the comment of unused code AdminStub
austin362667 Jul 6, 2024
91eb00a
add workflow api & add other literal types
austin362667 Jul 6, 2024
b70e91b
add workflow types
austin362667 Jul 6, 2024
3d794ab
fixup workflow API & structure
austin362667 Jul 7, 2024
4cfa4fa
add `SerializeToString()`
austin362667 Jul 9, 2024
508ffb1
propagate tonic error to py error
austin362667 Jul 12, 2024
af3b328
add **kwargs
austin362667 Jul 14, 2024
f31ee04
add json parser for google Struct
austin362667 Jul 14, 2024
42023b9
add `subclass` scripts
austin362667 Jul 22, 2024
57ef17e
add customized error handling which can be raised from python
austin362667 Jul 22, 2024
30485f2
clean up
austin362667 Aug 11, 2024
ed51db4
fix `SerializeToString()` for protobuf bytes
austin362667 Jul 22, 2024
77c888e
update test version
austin362667 Jul 22, 2024
006acf4
add wip auth
austin362667 Jul 31, 2024
cefa22b
upgrade openssl
austin362667 Jul 31, 2024
566fa9a
gate openssl feature
austin362667 Jul 31, 2024
236bea5
return default `access_token` when keyring not found
austin362667 Aug 1, 2024
88f2cd8
modify `todo!()` to PyFlyteUserException in status code default case
austin362667 Aug 1, 2024
105169e
enable gated feature `vendored` in keyring
austin362667 Aug 1, 2024
8ad88c3
upgrade keyring
austin362667 Aug 1, 2024
4183d4a
set default keyring `access_token`
austin362667 Aug 1, 2024
fde130d
temp comments out
austin362667 Aug 1, 2024
050913b
add UrlBlob
austin362667 Aug 2, 2024
03df221
add NodeExecutionMetaData
austin362667 Aug 3, 2024
565a995
test release 0.1.3
austin362667 Aug 3, 2024
66ea4d2
release `flyteidl_rust` to v0.1.3
austin362667 Aug 5, 2024
f91aaa8
enable linux feature for keyring
austin362667 Aug 9, 2024
d9ac8aa
lower down the required pyhton version
austin362667 Aug 9, 2024
26267cd
add ContainerError
austin362667 Aug 10, 2024
e425785
fix protobuf bytes coder
austin362667 Aug 10, 2024
361ca0b
fix trailing optional arguments as default none
austin362667 Aug 10, 2024
704665a
add Blob
austin362667 Aug 11, 2024
6c8441b
clean up
austin362667 Aug 11, 2024
5e1e96e
import pyo3 via version instead of git branch
austin362667 Aug 11, 2024
bca4aa6
lower case the auth module
austin362667 Aug 12, 2024
0608697
add flyteidl.admin & enable dummy auth
austin362667 Aug 12, 2024
b630b37
add flyteidl.service
austin362667 Aug 12, 2024
636991d
add flyteidl.core
austin362667 Aug 12, 2024
c073143
add LabelValue
austin362667 Aug 12, 2024
db2f93e
add DumpStruct
austin362667 Aug 13, 2024
b39c985
fmt
austin362667 Aug 13, 2024
56388b6
lower down the required pyhton version to 3.9
austin362667 Aug 13, 2024
273d6f6
keyring init failed
austin362667 Aug 14, 2024
a3ffc5e
error handling for keyring if CI failed
austin362667 Aug 14, 2024
ee672b6
add load/dump json string
austin362667 Aug 17, 2024
a7a1151
add flyteidl-nightly ci publish to pypi test
austin362667 Aug 17, 2024
32cf588
add Cargo.toml path to maturin
austin362667 Aug 17, 2024
16144f3
normalize path
austin362667 Aug 17, 2024
865cb64
add fail-fast strategy on linux job
austin362667 Aug 17, 2024
3d6789f
fix automatic `openssl-sys`
austin362667 Aug 18, 2024
ba3fa43
install openssl ubuntu deps
austin362667 Aug 18, 2024
051bf8c
clean up nightly release
austin362667 Aug 18, 2024
ab17083
add before-script-linux to maturin action container
austin362667 Aug 19, 2024
8e54b36
add before-script-linux to maturin action container
austin362667 Aug 19, 2024
3cda566
add `openssl-sys`
austin362667 Aug 19, 2024
ae47482
modify manylinux from auto to 2014
austin362667 Aug 19, 2024
cd7867f
add krb5-dev
austin362667 Aug 19, 2024
2c15845
clean up manylinux
austin362667 Aug 19, 2024
ad45b56
test manylinux without before-script-linux
austin362667 Aug 19, 2024
350a569
add back `before-script-linux`
austin362667 Aug 19, 2024
b6a803a
add `protoc`
austin362667 Aug 19, 2024
757ef98
add debug msg
austin362667 Aug 19, 2024
3e2f238
fix matrix.platform.target
austin362667 Aug 19, 2024
9310143
normalize path
austin362667 Aug 19, 2024
758882e
unify platform.target to ubuntu-based system
austin362667 Aug 19, 2024
30e77c0
remove `sudo` in sudo-disabled container
austin362667 Aug 19, 2024
f7423e5
remove `sccache`
austin362667 Aug 19, 2024
5efb6a3
show openssl version
austin362667 Aug 19, 2024
d5a3583
clean up `before-script-linux`
austin362667 Aug 19, 2024
8fc888a
add gated `abi3-py39`
austin362667 Aug 19, 2024
6b9b492
Merge branch 'flyrs' of /~https://github.com/flyteorg/flyte into flyrs
austin362667 Aug 19, 2024
0b71eed
generate rust protobuf
austin362667 Aug 19, 2024
25646c2
generate rust protobuf
austin362667 Aug 19, 2024
1bf5300
add `abi3-py39`
austin362667 Aug 19, 2024
92720c2
fix gen syntax
austin362667 Aug 19, 2024
57cdf20
add multiple python version
austin362667 Aug 19, 2024
3acecee
fix python version with number string
austin362667 Aug 19, 2024
e246101
pin pyo3 version and lock
austin362667 Aug 19, 2024
71a8c8d
add pyo3 feature `abi3-py39`
austin362667 Aug 19, 2024
3a045c5
finalize rust `flyteidl-nightly` ci
austin362667 Aug 19, 2024
55bb6b3
modify `repository-url`
austin362667 Aug 20, 2024
b92691b
remove release tag check for nightly
austin362667 Aug 20, 2024
7cc2111
add flyteidl-rust and flyteidl-nightly ci publish to pypi test
austin362667 Aug 20, 2024
d0ffde9
add permission
austin362667 Aug 20, 2024
6a6564e
fix workflow must contain at least one job with no dependencies
austin362667 Aug 20, 2024
f6214a3
fix `index-url`
austin362667 Aug 20, 2024
0c507e1
fix `repository-url` `https://test.pypi.org/legacy/`
austin362667 Aug 20, 2024
a3f1050
normalize path
austin362667 Aug 20, 2024
344dc60
fix glob
austin362667 Aug 20, 2024
29ebbbf
specify minimum pyhton version to pypi
austin362667 Aug 21, 2024
c5e988e
change upload platform
austin362667 Aug 21, 2024
87a31fc
hardcodes nightly version
austin362667 Aug 21, 2024
c4af03d
fix testpypi url
austin362667 Aug 21, 2024
2a5cec8
add MATURIN_REPOSITORY_URL
austin362667 Aug 21, 2024
3d1f61e
upgrade to v0.1.4
austin362667 Aug 21, 2024
d26561c
add `dict`
austin362667 Aug 27, 2024
dc4f6ee
add more structs
austin362667 Aug 27, 2024
9a86ab3
upgrade to v0.1.5
austin362667 Aug 27, 2024
af28663
add `ResourceEntry`
austin362667 Aug 30, 2024
dc1e227
add `get_data_response`
austin362667 Sep 2, 2024
c9a549d
add `array_node.ExecutionMode`
austin362667 Sep 7, 2024
de7c357
Skip SSL verify
austin362667 Sep 13, 2024
866eef5
Add swithch by AuthMode
austin362667 Sep 13, 2024
a8e9801
Omit keyring & Add `client_id` and `client_credentials_secret`
austin362667 Sep 14, 2024
662438c
Release 0.1.5
austin362667 Sep 14, 2024
190cdc3
Add `get_data()`
austin362667 Oct 13, 2024
fb927f1
Build openssl automatically
austin362667 Oct 14, 2024
548abb5
Use abs path
austin362667 Oct 15, 2024
bb4aaab
Rollback abs path
austin362667 Oct 15, 2024
39a1967
Use vendored OpenSSL
austin362667 Oct 15, 2024
0831751
Use vendored OpenSSL
austin362667 Oct 15, 2024
eb7b696
Remove PKCE scopes
austin362667 Oct 20, 2024
4b5e2b1
Release `flyteidl_rust` 1.0.7 to test pypi
austin362667 Oct 20, 2024
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
194 changes: 194 additions & 0 deletions .github/workflows/flyteidl-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
name: Release

on:
release:
types: [published]
schedule:
- cron: "0 * * * *"
push:
branches:
- main
- master
- flyrs
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
command: build
args: --release --out dist --find-interpreter -m flyteidl/Cargo.toml
before-script-linux: |
sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev
cd ${{ github.workspace }}/flyteidl
rm -rf ./gen/pb_rust/*
cargo run --bin gen_flyteidl
cd ../
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}-py${{ matrix.python-version }}
path: dist

# musllinux:
# runs-on: ${{ matrix.platform.runner }}
# strategy:
# matrix:
# platform:
# - runner: ubuntu-latest
# target: x86_64
# - runner: ubuntu-latest
# target: x86
# - runner: ubuntu-latest
# target: aarch64
# - runner: ubuntu-latest
# target: armv7
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist --find-interpreter -m flyteidl/Cargo.toml
# sccache: 'true'
# manylinux: musllinux_1_2
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-musllinux-${{ matrix.platform.target }}
# path: dist

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter -m flyteidl/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-12
target: x86_64
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- name: 'Clear action cache'
uses: ./.github/actions/clear-action-cache
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter -m flyteidl/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist -m flyteidl/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

release:
name: Release to PyPI(test)
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_REPOSITORY_URL: ${{ secrets.PYPI_REPOSITORY_URL }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*.whl

nightly:
name: Publish to PyPI(test) Nightly
runs-on: ubuntu-latest
needs: [linux, windows, macos, sdist]
permissions:
contents: write
actions: read
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_REPOSITORY_URL: ${{ secrets.PYPI_REPOSITORY_URL }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*.whl

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ docs/examples
docs/_src
docs/_projects
docs/api
docs/tests
docs/tests
1 change: 1 addition & 0 deletions flyteidl/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ __pycache__/
venv/
build/
target/
.so
Loading
Loading