numaflow-python icon indicating copy to clipboard operation
numaflow-python copied to clipboard

chore: streaming source

Open kohlisid opened this issue 1 year ago • 2 comments

PR to make source streaming in nature. We have removed the sync source from the implementation Refer: https://grpc.io/docs/guides/performance/#python

Streaming RPCs create extra threads for receiving and possibly sending the messages, which makes streaming RPCs much slower than unary RPCs in gRPC Python, unlike the other languages supported by gRPC.

Using asyncio could improve performance.

kohlisid avatar Oct 01 '24 16:10 kohlisid

Codecov Report

Attention: Patch coverage is 94.73684% with 4 lines in your changes missing coverage. Please review.

Project coverage is 94.04%. Comparing base (7180ce2) to head (aeecb8a). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pynumaflow/sourcer/servicer/async_servicer.py 95.52% 0 Missing and 3 partials :warning:
pynumaflow/sourcer/_dtypes.py 87.50% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
- Coverage   94.06%   94.04%   -0.02%     
==========================================
  Files          56       54       -2     
  Lines        2241     2167      -74     
  Branches      131      131              
==========================================
- Hits         2108     2038      -70     
+ Misses        102       97       -5     
- Partials       31       32       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 01 '24 16:10 codecov[bot]

Running the E2E locally after the change


    e2e_suite.go:131: Redis resources are ready
=== RUN   TestUserDefinedSourceSuite/TestUDSource
    udsource_test.go:82: Creating Pipeline simple-source-python
Watching POD: simple-source-python-out-0-drr5b
    udsource_test.go:93: Expected vertex "out" pod contains "147"
Watching POD: simple-source-python-out-0-drr5b
    udsource_test.go:94: Expected vertex "out" pod contains "258"
Watching POD: simple-source-python-out-0-drr5b
    udsource_test.go:95: Expected vertex "out" pod contains "369"
Watching POD: simple-source-python-out-0-drr5b
    udsource_test.go:97: Expected vertex "out" pod contains "520"
Watching POD: simple-source-python-out-0-drr5b
    udsource_test.go:98: Expected vertex "out" pod contains "630"
Watching POD: simple-source-python-out-0-drr5b
    udsource_test.go:99: Expected vertex "out" pod contains "999"
    udsource_test.go:148: Deleting Pipeline simple-source-python
=== NAME  TestUserDefinedSourceSuite
    e2e_suite.go:143: Waiting for 5s
    e2e_suite.go:143: Done waiting
    e2e_suite.go:144: Deleting ISB svc numaflow-e2e
    e2e_suite.go:145: Waiting for 3s
    e2e_suite.go:145: Done waiting
/bin/sh -c kubectl delete pods -n numaflow-system -l app.kubernetes.io/component=isbsvc,numaflow.numaproj.io/isbsvc-name=numaflow-e2e --ignore-not-found=true --grace-period=0 --force
Warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
No resources found

    e2e_suite.go:154: ISB svc is deleted
/bin/sh -c kubectl delete -k ../../config/apps/redis -n numaflow-system --ignore-not-found=true
configmap "redis-config" deleted
service "redis" deleted
statefulset.apps "redis" deleted

    e2e_suite.go:157: Redis resources are deleted
--- PASS: TestUserDefinedSourceSuite (82.64s)
    --- PASS: TestUserDefinedSourceSuite/TestUDSource (57.36s)
PASS
ok      github.com/numaproj/numaflow/test/udsource-e2e  83.336s
/Library/Developer/CommandLineTools/usr/bin/make cleanup-e2e

kohlisid avatar Oct 03 '24 00:10 kohlisid