File tree Expand file tree Collapse file tree 5 files changed +311
-155
lines changed
examples/reduce-stream-counter Expand file tree Collapse file tree 5 files changed +311
-155
lines changed Original file line number Diff line number Diff line change 1- [package ]
2- name = " reduce-stream-counter"
3- version = " 0.1.0"
4- edition.workspace = true
5- rust-version.workspace = true
6-
7- [dependencies ]
8- tonic.workspace = true
9- tokio.workspace = true
10- numaflow = { path = " ../../numaflow" }
11-
1+ [package ]
2+ name = " reduce-stream-counter"
3+ version = " 0.1.0"
4+ edition.workspace = true
5+ rust-version.workspace = true
6+
7+ [dependencies ]
8+ tonic.workspace = true
9+ tokio.workspace = true
10+ numaflow = { path = " ../../numaflow" }
11+
12+ [dev-dependencies ]
13+ chrono.workspace = true
14+
Original file line number Diff line number Diff line change 1- FROM rust:1.85-bullseye AS build
2-
3- RUN apt-get update
4- RUN apt-get install protobuf-compiler -y
5-
6- WORKDIR /numaflow-rs
7- COPY ./ ./
8- WORKDIR /numaflow-rs/examples/reduce-stream-counter
9-
10- # build for release
11- RUN cargo build --release
12-
13- # our final base
14- FROM debian:bullseye AS reduce-stream-counter
15-
16- # copy the build artifact from the build stage
17- COPY --from=build /numaflow-rs/target/release/reduce-stream-counter .
18-
19- # set the startup command to run your binary
20- CMD ["./reduce-stream-counter" ]
21-
1+ FROM rust:1.85-bullseye AS build
2+
3+ RUN apt-get update
4+ RUN apt-get install protobuf-compiler -y
5+
6+ WORKDIR /numaflow-rs
7+ COPY ./ ./
8+ WORKDIR /numaflow-rs/examples/reduce-stream-counter
9+
10+ # build for release
11+ RUN cargo build --release
12+
13+ # our final base
14+ FROM debian:bullseye AS reduce-stream-counter
15+
16+ # copy the build artifact from the build stage
17+ COPY --from=build /numaflow-rs/target/release/reduce-stream-counter .
18+
19+ # set the startup command to run your binary
20+ CMD ["./reduce-stream-counter" ]
21+
Original file line number Diff line number Diff line change 1- TAG ?= stable
2- PUSH ?= false
3- IMAGE_REGISTRY = quay.io/numaio/numaflow-rs/reduce-stream-counter:${TAG}
4- DOCKER_FILE_PATH = examples/reduce-stream-counter/Dockerfile
5-
6- .PHONY : update
7- update :
8- cargo check
9- cargo update
10-
11- .PHONY : image
12- image : update
13- cd ../../ && docker build \
14- -f ${DOCKER_FILE_PATH} \
15- -t ${IMAGE_REGISTRY} .
16- @if [ " $( PUSH) " = " true" ]; then docker push ${IMAGE_REGISTRY} ; fi
17-
1+ TAG ?= stable
2+ PUSH ?= false
3+ IMAGE_REGISTRY = quay.io/numaio/numaflow-rs/reduce-stream-counter:${TAG}
4+ DOCKER_FILE_PATH = examples/reduce-stream-counter/Dockerfile
5+
6+ .PHONY : update
7+ update :
8+ cargo check
9+ cargo update
10+
11+ .PHONY : image
12+ image : update
13+ cd ../../ && docker build \
14+ -f ${DOCKER_FILE_PATH} \
15+ -t ${IMAGE_REGISTRY} .
16+ @if [ " $( PUSH) " = " true" ]; then docker push ${IMAGE_REGISTRY} ; fi
17+
Original file line number Diff line number Diff line change 1- apiVersion : numaflow.numaproj.io/v1alpha1
2- kind : Pipeline
3- metadata :
4- name : simple-reduce-stream
5- spec :
6- vertices :
7- - name : in
8- source :
9- # A self data generating source
10- generator :
11- rpu : 10
12- duration : 1s
13- keyCount : 5
14- value : 5
15- - name : streaming-counter
16- udf :
17- container :
18- # count element with streaming results
19- image : quay.io/numaio/numaflow-rs/reduce-stream-counter:stable
20- groupBy :
21- window :
22- fixed :
23- length : 10s
24- streaming : true
25- keyed : true
26- storage :
27- persistentVolumeClaim :
28- volumeSize : 10Gi
29- accessMode : ReadWriteOnce
30- - name : out
31- sink :
32- # A simple log printing sink
33- log : {}
34- edges :
35- - from : in
36- to : streaming-counter
37- - from : streaming-counter
38- to : out
39-
1+ apiVersion : numaflow.numaproj.io/v1alpha1
2+ kind : Pipeline
3+ metadata :
4+ name : simple-reduce-stream
5+ spec :
6+ vertices :
7+ - name : in
8+ source :
9+ # A self data generating source
10+ generator :
11+ rpu : 10
12+ duration : 1s
13+ keyCount : 5
14+ value : 5
15+ - name : streaming-counter
16+ udf :
17+ container :
18+ # count element with streaming results
19+ image : quay.io/numaio/numaflow-rs/reduce-stream-counter:stable
20+ groupBy :
21+ window :
22+ fixed :
23+ length : 10s
24+ streaming : true
25+ keyed : true
26+ storage :
27+ persistentVolumeClaim :
28+ volumeSize : 10Gi
29+ accessMode : ReadWriteOnce
30+ - name : out
31+ sink :
32+ # A simple log printing sink
33+ log : {}
34+ edges :
35+ - from : in
36+ to : streaming-counter
37+ - from : streaming-counter
38+ to : out
39+
You can’t perform that action at this time.
0 commit comments