Skip to content
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

chore: streaming source #191

Merged
merged 5 commits into from
Oct 7, 2024
Merged

chore: streaming source #191

merged 5 commits into from
Oct 7, 2024

Conversation

kohlisid
Copy link
Contributor

@kohlisid kohlisid commented Oct 1, 2024

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.

Copy link

codecov bot commented Oct 1, 2024

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 ⚠️
pynumaflow/sourcer/_dtypes.py 87.50% 1 Missing ⚠️
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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
@kohlisid kohlisid changed the title [WIP] chore: streaming source chore: streaming source Oct 2, 2024
Signed-off-by: Sidhant Kohli <[email protected]>
@kohlisid kohlisid requested a review from KeranYang October 3, 2024 00:02
@kohlisid
Copy link
Contributor Author

kohlisid commented Oct 3, 2024

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

Signed-off-by: Sidhant Kohli <[email protected]>
@kohlisid kohlisid marked this pull request as ready for review October 3, 2024 16:50
Copy link
Member

@vigith vigith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please run an endurance for a day

@@ -1,22 +0,0 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-python/async-source:${TAG}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kindly reminder to also delete the registry from quay.io.

@kohlisid kohlisid merged commit ea799ef into numaproj:main Oct 7, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants