Skip to content

Commit

Permalink
Merge branch 'main' into serialize-pojo-to-another
Browse files Browse the repository at this point in the history
  • Loading branch information
orisgarno authored Jan 31, 2025
2 parents 2b58862 + b4f5a2a commit 84bea5e
Show file tree
Hide file tree
Showing 68 changed files with 3,883 additions and 1,444 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.3.2
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,27 @@ jobs:
name: Python CI
# Fix python 3.6 install issue, see
# https://github.com/rwth-i6/returnn/commit/38ecab17d781c4b74db6a174c8097187380b4ddc
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8, 3.12]
os: [ubuntu-20.04, windows-2022]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install bazel
run: ./ci/run_ci.sh install_bazel
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./ci/run_ci.sh install_bazel_windows
else
./ci/run_ci.sh install_bazel
fi
- name: Run Python CI
shell: bash
run: ./ci/run_ci.sh python

go:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/*.cpp
**/*.so
**/*.dylib
**/*.pyd
bazel-*
.whl
python/.cache
Expand Down
17 changes: 13 additions & 4 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,19 @@ genrule(
set -e
set -x
WORK_DIR=$$(pwd)
cp -f $(location python/pyfury/_util.so) "$$WORK_DIR/python/pyfury"
cp -f $(location python/pyfury/lib/mmh3/mmh3.so) "$$WORK_DIR/python/pyfury/lib/mmh3"
cp -f $(location python/pyfury/format/_format.so) "$$WORK_DIR/python/pyfury/format"
cp -f $(location python/pyfury/_serialization.so) "$$WORK_DIR/python/pyfury"
u_name=`uname -s`
if [ "$${u_name: 0: 4}" == "MING" ] || [ "$${u_name: 0: 4}" == "MSYS" ]
then
cp -f $(location python/pyfury/_util.so) "$$WORK_DIR/python/pyfury/_util.pyd"
cp -f $(location python/pyfury/lib/mmh3/mmh3.so) "$$WORK_DIR/python/pyfury/lib/mmh3/mmh3.pyd"
cp -f $(location python/pyfury/format/_format.so) "$$WORK_DIR/python/pyfury/format/_format.pyd"
cp -f $(location python/pyfury/_serialization.so) "$$WORK_DIR/python/pyfury/_serialization.pyd"
else
cp -f $(location python/pyfury/_util.so) "$$WORK_DIR/python/pyfury"
cp -f $(location python/pyfury/lib/mmh3/mmh3.so) "$$WORK_DIR/python/pyfury/lib/mmh3"
cp -f $(location python/pyfury/format/_format.so) "$$WORK_DIR/python/pyfury/format"
cp -f $(location python/pyfury/_serialization.so) "$$WORK_DIR/python/pyfury"
fi
echo $$(date) > $@
""",
local = 1,
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache Fury (Incubating)
Copyright 2023-2024 The Apache Software Foundation
Copyright 2023-2025 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
Expand Down
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure")
load("//bazel/arrow:pyarrow_configure.bzl", "pyarrow_configure")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# Add Benchmark
git_repository(
name = "com_google_benchmark",
remote = "https://github.com/google/benchmark.git",
tag = "v1.9.1",
)

bazel_skylib_workspace()
python_configure(name="local_config_python")
pyarrow_configure(name="local_config_pyarrow")
Expand Down
4 changes: 2 additions & 2 deletions ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ VERSIONS=("3.7"
"3.11"
"3.12")

source $(conda info --base)/etc/profile.d/conda.sh

create_py_envs() {
source $(conda info --base)/etc/profile.d/conda.sh
for version in "${VERSIONS[@]}"; do
conda create -y --name "py$version" python="$version"
done
Expand Down Expand Up @@ -94,6 +93,7 @@ deploy_jars() {
}

deploy_python() {
source $(conda info --base)/etc/profile.d/conda.sh
if command -v pyenv; then
pyenv local system
fi
Expand Down
6 changes: 6 additions & 0 deletions ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ install_bazel() {
fi
}

install_bazel_windows() {
choco install bazel --version=6.3.2 --force
VERSION=`bazel version`
echo "bazel version: $VERSION"
}

JDKS=(
"zulu21.28.85-ca-jdk21.0.0-linux_x64"
"zulu17.44.17-ca-crac-jdk17.0.8-linux_x64"
Expand Down
20 changes: 19 additions & 1 deletion cpp/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# Apache Fury™ C++

## How to build
Fury is a blazingly-fast multi-language serialization framework powered by just-in-time compilation and zero-copy.

## Build Fury C++

```bash
# Build all projects
bazel build //:all
# Run all tests
bazel test //:all
```

## Environment

- Bazel version: 6.3.2

## Benchmark

```bash
bazel build //cpp/fury/benchmark:all
bazel test //cpp/fury/benchmark:all
# You can also run a single benchmark to see how efficient it is.
# For example
bazel run //cpp/fury/benchmark:benchmark_string_util
```
24 changes: 24 additions & 0 deletions cpp/fury/benchmark/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")

cc_library(
name = "fury_benchmark",
srcs = glob(["*.cc"], exclude=["benchmark*.cc"]),
hdrs = glob(["*.h"]),
strip_include_prefix = "/cpp",
alwayslink = True,
linkstatic = True,
deps = [
"//cpp/fury/util:fury_util",
"@com_google_benchmark//:benchmark",
],
visibility = ["//visibility:public"],
)


cc_test(
name = "benchmark_string_util",
srcs = ["benchmark_string_util.cc"],
deps = [
":fury_benchmark",
],
)
Loading

0 comments on commit 84bea5e

Please sign in to comment.