Skip to content

Commit 5e94e3b

Browse files
committed
Validate rust ffi module version matches git tag
Signed-off-by: Sreekanth <prsreekanth920@gmail.com>
1 parent 39cc2fe commit 5e94e3b

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/pynumaflow-lite.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ jobs:
169169
rustup toolchain install stable --profile minimal
170170
rustup default stable
171171
172+
- name: Verify tag matches package version
173+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/pynumaflow-lite-v')
174+
run: |
175+
set -euo pipefail
176+
177+
tag_version="${GITHUB_REF_NAME#pynumaflow-lite-v}"
178+
package_version="$(cargo metadata --locked --no-deps --format-version 1 | python -c 'import json, sys; print(json.load(sys.stdin)["packages"][0]["version"])')"
179+
180+
if [ "${package_version}" != "${tag_version}" ]; then
181+
echo "Tag version ${tag_version} does not match Cargo.toml version ${package_version}"
182+
exit 1
183+
fi
184+
172185
- name: Build wheel
173186
uses: PyO3/maturin-action@v1
174187
with:

packages/pynumaflow-lite/src/pyrs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ pub(crate) fn run_asyncio(tx: Sender<Arc<Py<PyAny>>>) {
1212
let event_loop = Arc::new(event_loop);
1313
let _ = tx.send(event_loop.clone());
1414
Python::attach(|py| {
15-
println!("Starting NumaflowCore: event_loop={:?}", event_loop);
1615
event_loop.call_method0(py, "run_forever").unwrap();
1716
});
1817
}

packages/pynumaflow-lite/src/sink/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,7 @@ impl SinkAsyncServer {
517517
}
518518

519519
pyo3_async_runtimes::tokio::future_into_py(py, async move {
520-
crate::sink::server::start(py_func, sock_file, info_file, rx)
521-
.await
522-
.expect("server failed to start");
520+
crate::sink::server::start(py_func, sock_file, info_file, rx).await?;
523521
Ok(())
524522
})
525523
}

packages/pynumaflow-lite/src/sink/server.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ pub(super) async fn start(
6161
shutdown_rx: tokio::sync::oneshot::Receiver<()>,
6262
) -> Result<(), pyo3::PyErr> {
6363
let (tx, rx) = tokio::sync::oneshot::channel();
64-
let py_asyncio_loop_handle = tokio::task::spawn_blocking(move || crate::pyrs::run_asyncio(tx));
64+
let py_asyncio_loop_handle = tokio::task::spawn_blocking({
65+
println!("Starting Sink UDF. socket={}, server_info={}", &sock_file, &info_file);
66+
move || crate::pyrs::run_asyncio(tx)
67+
});
6568
let event_loop = rx.await.unwrap();
6669

6770
let (sig_handle, combined_rx) = crate::pyrs::setup_sig_handler(shutdown_rx);

0 commit comments

Comments
 (0)