-
Notifications
You must be signed in to change notification settings - Fork 18
feat: integrate rust daemon behind a flag #719
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
Open
CougarTasker
wants to merge
1
commit into
feat/rust-daemon-setup
Choose a base branch
from
feat/rust-daemon-integration
base: feat/rust-daemon-setup
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,708
−178
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: Build Wheels | ||
|
|
||
| # Builds the Python wheel that bundles the Rust data-daemon binary and the | ||
| # producer cdylib. See docs/rust_data_daemon_development.md#packaging-the-wheel | ||
| # for the build pipeline rationale (cargo → build_wheel_artefacts.sh → python -m build). | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'rust/**' | ||
| - 'neuracore/data_daemon/**' | ||
| - 'setup.py' | ||
| - 'MANIFEST.in' | ||
| - '.github/workflows/build-wheels.yaml' | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'rust/**' | ||
| - 'neuracore/data_daemon/**' | ||
| - 'setup.py' | ||
| - 'MANIFEST.in' | ||
| - '.github/workflows/build-wheels.yaml' | ||
| workflow_call: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: wheel (${{ matrix.os }}, py${{ matrix.python-version }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # Linux-first per docs/data-daemon-rewrite.md §Open items. | ||
| # aarch64 ships when there's demand — the helper script is platform- | ||
| # agnostic but cross-compilation isn't wired up here yet. | ||
| os: [ubuntu-22.04] | ||
| python-version: ["3.10", "3.11"] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Cache cargo build | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: rust | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| id: setup-python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install build tooling | ||
| run: python -m pip install --upgrade pip build | ||
|
|
||
| - name: Build Rust artefacts | ||
| # PYO3_PYTHON pins pyo3-build-config to the matrix interpreter so the | ||
| # produced cdylib's ABI matches the wheel's python tag. Ubuntu images | ||
| # ship multiple python3 binaries; relying on PATH order would silently | ||
| # pick the wrong one and produce a wheel that imports under the wrong | ||
| # interpreter. | ||
| env: | ||
| PYO3_PYTHON: ${{ steps.setup-python.outputs.python-path }} | ||
| run: ./rust/scripts/build_wheel_artefacts.sh | ||
|
|
||
| - name: Build wheel | ||
| run: python -m build --wheel | ||
|
|
||
| - name: Smoke-test the built wheel | ||
| run: | | ||
| python -m pip install dist/neuracore-*.whl | ||
| python -c "import neuracore.data_daemon._native_producer as p; print('producer ok:', p)" | ||
| python -c "from importlib.resources import files; b = files('neuracore.data_daemon') / 'bin' / 'data-daemon'; assert b.is_file(), b; print('binary ok:', b)" | ||
|
|
||
| - name: Upload wheel artefact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: neuracore-wheel-${{ matrix.os }}-py${{ matrix.python-version }} | ||
| path: dist/*.whl | ||
| if-no-files-found: error | ||
| retention-days: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Sources required to rebuild the bundled Rust artefacts from an sdist. | ||
| # The artefacts themselves (neuracore/data_daemon/bin/data-daemon and | ||
| # neuracore/data_daemon/_native_producer.so) are gitignored and only land | ||
| # in the *wheel* — the sdist ships the Rust sources so a downstream | ||
| # packager can run rust/scripts/build_wheel_artefacts.sh themselves. | ||
| # | ||
| # See docs/rust_data_daemon_development.md#packaging-the-wheel. | ||
|
|
||
| include README.md | ||
| include LICENSE | ||
|
|
||
| recursive-include rust *.rs *.toml *.lock *.sql *.md *.sh | ||
|
|
||
| prune rust/target | ||
| global-exclude __pycache__ | ||
| global-exclude *.py[cod] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,7 @@ elems | |
| embs | ||
| Emika | ||
| ENOENT | ||
| enoexec | ||
| EPERM | ||
| EPIPE | ||
| erfinv | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.