Skip to content

Commit

Permalink
add basic crosscompiling pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Sep 9, 2024
1 parent a8404f9 commit f6b84ef
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,30 @@ jobs:
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v2

build_wheels:
name: Build wheels
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.11"

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
uses: pypa/[email protected]
# env:
# # configure cibuildwheel to build native archs ('auto'), and some
# # emulated ones
# CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x

containerbuild:
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ logprep.log
examples/k8s/charts
*.so
target
wheelhouse
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
### Breaking
### Features
### Improvements

* adds support for rust extension development
* adds prebuild wheels for architectures `x86_64 i686 aarch64` on `manylinux` and `musllinux` based linux platforms

### Bugfix

## 13.1.2
Expand Down
5 changes: 1 addition & 4 deletions logprep/framework/pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# pylint: disable=logging-fstring-interpolation

import ctypes
import logging
import logging.handlers
import multiprocessing
Expand All @@ -21,8 +20,6 @@
from logprep.util.configuration import Configuration
from logprep.util.logging import LogprepMPQueueListener, logqueue

libc = ctypes.CDLL("libc.so.6")

logger = logging.getLogger("Manager")


Expand All @@ -48,7 +45,7 @@ def throttle(self, batch_size=1):
self.wait_time, int(self.wait_time * self.consumed_percent / batch_size)
)
# sleep times in microseconds
libc.usleep(sleep_time)
time.sleep(sleep_time / 1000)

def put(self, obj, block=True, timeout=None, batch_size=1):
"""Put an obj into the queue."""
Expand Down
12 changes: 11 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires = [
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["logprep"]
package-dir = { "" = "logprep" }

[tool.setuptools_scm]
fallback_version = "unset"
Expand Down Expand Up @@ -110,6 +110,7 @@ dev = [
"responses",
"jinja2",
"maturin",
"cibuildwheel",
]

doc = [
Expand Down Expand Up @@ -145,3 +146,12 @@ extend-exclude = '''

[tool.isort]
profile = "black"

[tool.cibuildwheel]
build = "cp310-* cp311-* cp312-*"
skip = "*pp* *i686*musl*"

[tool.cibuildwheel.linux]
archs = "x86_64 i686 aarch64"
before-build = "curl -sSf https://sh.rustup.rs | sh -s -- -y"
environment = 'PATH=$HOME/.cargo/bin:$PATH'
1 change: 0 additions & 1 deletion rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[cfg(test)]
mod tests;
use pyo3::prelude::*;

Expand Down

0 comments on commit f6b84ef

Please sign in to comment.