Skip to content
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
8 changes: 7 additions & 1 deletion .github/workflows/unit-test-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,16 @@ jobs:
core.setOutput('platform_suffix', ``)
}

- name: Install clang-format
- name: Install dependencies
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y uuid-dev
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y libuuid-devel
fi
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-17
elif [[ "$RUNNER_OS" == "Windows" ]]; then
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/unit-test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-

- name: Install dependencies
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y uuid-dev
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y libuuid-devel
fi
fi
# On Windows systems the 'mvnw' script needs an additional ".cmd" appended.
- name: Calculate platform suffix
id: platform_suffix
Expand Down
169 changes: 169 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Build TsFile wheels(multi-platform)

on:
push:
branches:
- "release_v*.*.*"
pull_request:
paths:
- "cpp/**"
- "python/**"
- ".github/**"
workflow_dispatch:

jobs:
build:
name: Build wheels on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-22.04
platform: linux
cibw_archs_linux: "x86_64"

- name: linux-aarch64
os: ubuntu-22.04-arm
platform: linux
cibw_archs_linux: "aarch64"

- name: macos-x86_64
os: macos-13
platform: macos
cibw_archs_macos: "x86_64"

- name: macos-arm64
os: macos-14
platform: macos
cibw_archs_macos: "arm64"
# currently, compile on windows is not supported for cibuildwheel
# - name: windows-amd64
# os: windows-2022
# platform: windows
# cibw_archs_windows: "AMD64"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Install system deps (macOS)
if: matrix.platform == 'macos'
run: |
set -eux
brew update
brew install pkg-config || true

- name: Install build tools
run: |
python -m pip install -U pip wheel
python -m pip install cibuildwheel==2.21.3

# - name: Build C++ core via Maven(win)
# if: matrix.platform == 'windows'
# shell: bash
# run: |
# set -euxo pipefail
# chmod +x mvnw || true
# ./mvnw -Pwith-cpp clean verify package \
# -DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true
# test -d cpp/target/build/lib
# test -d cpp/target/build/include

- name: Build C++ core via Maven (macOS)
if: matrix.platform == 'macos'
shell: bash
env:
MACOSX_DEPLOYMENT_TARGET: "12.0"
CFLAGS: "-mmacosx-version-min=12.0"
CXXFLAGS: "-mmacosx-version-min=12.0"
LDFLAGS: "-mmacosx-version-min=12.0"
run: |
set -euxo pipefail
chmod +x mvnw || true
./mvnw -Pwith-cpp clean verify package \
-DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true \
-Dcmake.args="-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0"
otool -l cpp/target/build/lib/libtsfile*.dylib | grep -A2 LC_VERSION_MIN_MACOSX || true

- name: Build wheels via cibuildwheel
if: matrix.platform != 'macos'
env:
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
# CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_archs_windows }}

CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
CIBW_SKIP: "pp* *-musllinux*"

CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"

MACOSX_DEPLOYMENT_TARGET: "12.0"

CIBW_BEFORE_ALL_LINUX: |
set -euxo pipefail
if command -v yum >/dev/null 2>&1; then
yum install -y wget tar gzip pkgconfig libuuid-devel libblkid-devel
else
echo "Not a yum-based image?" ; exit 1
fi
ARCH="$(uname -m)"
mkdir -p /opt/java
if [ "$ARCH" = "x86_64" ]; then
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz"
else
# aarch64
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz"
fi
curl -L -o /tmp/jdk17.tar.gz "$JDK_URL"
tar -xzf /tmp/jdk17.tar.gz -C /opt/java
export JAVA_HOME=$(echo /opt/java/jdk-17.0.12*)
export PATH="$JAVA_HOME/bin:$PATH"
java -version

chmod +x mvnw || true
./mvnw -Pwith-cpp clean verify package \
-DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true
test -d cpp/target/build/lib && test -d cpp/target/build/include

CIBW_TEST_COMMAND: >
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok:')"
CIBW_BUILD_VERBOSITY: "1"
run: cibuildwheel --output-dir wheelhouse python

- name: Build wheels via cibuildwheel (macOS)
if: matrix.platform == 'macos'
env:
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
# CIBW_BUILD: "cp313-*"
CIBW_SKIP: "pp*"
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=12.0"
MACOSX_DEPLOYMENT_TARGET: "12.0"
CIBW_TEST_COMMAND: >
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok:')"
CIBW_BUILD_VERBOSITY: "1"
run: cibuildwheel --output-dir wheelhouse python

- name: Upload wheels as artifact
uses: actions/upload-artifact@v4
with:
name: tsfile-wheels-${{ matrix.name }}
path: wheelhouse/*.whl


35 changes: 1 addition & 34 deletions cpp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.tsfile</groupId>
<artifactId>tsfile-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.1.4</version>
</parent>
<artifactId>tsfile-cpp</artifactId>
<packaging>pom</packaging>
Expand Down Expand Up @@ -151,39 +151,6 @@
</plugins>
</build>
<profiles>
<profile>
<id>linux-install-uuid-dev</id>
<activation>
<os>
<family>unix</family>
<name>Linux</name>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>install-uuid-dev</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>bash</executable>
<arguments>
<argument>-c</argument>
<argument>sudo apt-get update &amp;&amp; sudo apt-get install -y uuid-dev</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- When running on jenkins, download the sonar build-wrapper, so we can do a code analysis -->
<profile>
<id>jenkins-build</id>
Expand Down
1 change: 1 addition & 0 deletions cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(ANTLR4_WITH_STATIC_CRT OFF)
set(PROJECT_INCLUDE_DIR
${CMAKE_SOURCE_DIR}/src
${THIRD_PARTY_INCLUDE}/google_snappy
${THIRD_PARTY_INCLUDE}/zlib-1.2.13
${CMAKE_SOURCE_DIR}/third_party/lz4
${CMAKE_SOURCE_DIR}/third_party/lzokay
${CMAKE_SOURCE_DIR}/third_party/zlib-1.2.13
Expand Down
1 change: 1 addition & 0 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ include_directories(
${LIBRARY_INCLUDE_DIR}
${THIRD_PARTY_INCLUDE}
${THIRD_PARTY_INCLUDE}/google_snappy
${THIRD_PARTY_INCLUDE}/zlib-1.2.13
${CMAKE_SOURCE_DIR}/third_party/lz4
${CMAKE_SOURCE_DIR}/third_party/google_snappy
${CMAKE_SOURCE_DIR}/third_party/lzokay
Expand Down
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</parent>
<groupId>org.apache.tsfile</groupId>
<artifactId>tsfile-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.1.4</version>
<packaging>pom</packaging>
<name>Apache TsFile Project Parent POM</name>
<properties>
Expand Down Expand Up @@ -135,6 +135,10 @@
<exclude>**/tsfile.egg-info/**</exclude>
<!-- Exclude third_party-->
<exclude>**/third_party/**</exclude>
<exclude>**/.python-version</exclude>
<exclude>**/**venv-py**/**</exclude>
<exclude>**/.python-version</exclude>
<exclude>python/.python-version</exclude>
</excludes>
</configuration>
</plugin>
Expand Down Expand Up @@ -445,6 +449,8 @@
<indentSize>4</indentSize>
<excludes>
<exclude>**/target/**</exclude>
<exclude>python/.python-version</exclude>
<exclude>**/.python-version</exclude>
</excludes>
</configuration>
</execution>
Expand Down Expand Up @@ -587,7 +593,6 @@
<profile>
<id>with-python</id>
<modules>
<module>cpp</module>
<module>python</module>
</modules>
</profile>
Expand Down Expand Up @@ -751,8 +756,8 @@
<os.suffix>win</os.suffix>
<os.classifier>windows-amd64</os.classifier>
<cmake.generator>MinGW Makefiles</cmake.generator>
<python.venv.bin>venv/Scripts/</python.venv.bin>
<python.exe.bin>python</python.exe.bin>
<python.venv.bin/>
<python.exe.bin>python.exe</python.exe.bin>
</properties>
</profile>
<!-- profile for windows aarch64 (mainly VM on newer Mac) (Self-Enabling) -->
Expand Down
28 changes: 28 additions & 0 deletions python/how_to_build_and_release_py_tsfile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->

## Build on local

## Build on docker

## Build for release

## Release TsFile to Pypi and Conda
Loading
Loading