Skip to content
Permalink
Browse files
[hotfix] Sync all current examples with latest StateFun core changes
  • Loading branch information
tzulitai committed Mar 25, 2021
1 parent 4503d9d commit 2cc9b54572ebc1c4e322ad442d5208b104c5a00d
Showing 12 changed files with 30 additions and 33 deletions.
@@ -18,14 +18,14 @@ FROM maven:3.6.3-jdk-11 AS builder
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
# TODO remove these commented lines and the jar; this is needed now only because we don't have the latest Java SDK published to Maven central yet
# COPY statefun-sdk-java-2.3-SNAPSHOT.jar /usr/src/app
# RUN mvn install:install-file \
# -Dfile=/usr/src/app/statefun-sdk-java-2.3-SNAPSHOT.jar \
# -DgroupId=org.apache.flink \
# -DartifactId=statefun-sdk-java \
# -Dversion=2.3-SNAPSHOT \
# -Dpackaging=jar \
# -DgeneratePom=true
COPY statefun-sdk-java-3.0-SNAPSHOT.jar /usr/src/app
RUN mvn install:install-file \
-Dfile=/usr/src/app/statefun-sdk-java-3.0-SNAPSHOT.jar \
-DgroupId=org.apache.flink \
-DartifactId=statefun-sdk-java \
-Dversion=3.0-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true
RUN mvn -f /usr/src/app/pom.xml clean package

# ... and run the web server!
@@ -35,7 +35,7 @@ services:
###############################################################

statefun-manager:
image: flink-statefun:2.3-SNAPSHOT
image: flink-statefun:3.0-SNAPSHOT
expose:
- "6123"
ports:
@@ -47,7 +47,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: flink-statefun:2.3-SNAPSHOT
image: flink-statefun:3.0-SNAPSHOT
expose:
- "6121"
- "6122"
@@ -24,13 +24,12 @@ module:
meta:
kind: http
spec:
typename:
namespace: greeter.fns
functions: greeter.fns/*
urlPathTemplate: http://greeter-functions:1108/
ingresses:
- ingress:
meta:
type: statefun.kafka.io/routable-protobuf-ingress
type: io.statefun.kafka/ingress
id: greeter.io/user-logins
spec:
address: kafka:9092
@@ -39,13 +38,13 @@ module:
type: earliest
topics:
- topic: user-logins
typeUrl: greeter.types/org.apache.flink.statefun.playground.java.greeter.types.UserLogin
valueType: greeter.types/org.apache.flink.statefun.playground.java.greeter.types.UserLogin
targets:
- greeter.fns/user
egresses:
- egress:
meta:
type: statefun.kafka.io/generic-egress
type: io.statefun.kafka/egress
id: greeter.io/user-greetings
spec:
address: kafka:9092
@@ -26,7 +26,7 @@ under the License.
<packaging>jar</packaging>

<properties>
<statefun.version>2.3-SNAPSHOT</statefun.version>
<statefun.version>3.0-SNAPSHOT</statefun.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
Binary file not shown.
@@ -26,7 +26,7 @@ under the License.
<packaging>jar</packaging>

<properties>
<statefun.version>2.3-SNAPSHOT</statefun.version>
<statefun.version>3.0-SNAPSHOT</statefun.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
@@ -86,7 +86,7 @@ private static KafkaContainer kafkaContainer(Network network) {
}

private static GenericContainer<?> managerContainer(Network network) {
return new GenericContainer<>(DockerImageName.parse("flink-statefun:2.3-SNAPSHOT"))
return new GenericContainer<>(DockerImageName.parse("flink-statefun:3.0-SNAPSHOT"))
.withNetwork(network)
.withNetworkAliases("statefun-manager")
.withEnv("ROLE", "master")
@@ -98,7 +98,7 @@ private static GenericContainer<?> managerContainer(Network network) {
}

private static GenericContainer<?> workerContainer(Network network) {
return new GenericContainer<>(DockerImageName.parse("flink-statefun:2.3-SNAPSHOT"))
return new GenericContainer<>(DockerImageName.parse("flink-statefun:3.0-SNAPSHOT"))
.withNetwork(network)
.withNetworkAliases("statefun-worker")
.withEnv("ROLE", "worker")
@@ -24,8 +24,7 @@ module:
meta:
kind: http
spec:
typename:
namespace: java.showcase.fns
functions: java.showcase.fns/*
urlPathTemplate: http://host.testcontainers.internal:1108/
timeouts:
call: 1day # setting a very high timeout here facilitates the user
@@ -34,7 +33,7 @@ module:
ingresses:
- ingress:
meta:
type: statefun.kafka.io/routable-protobuf-ingress
type: io.statefun.kafka/ingress
id: java.showcase.io/user-logins
spec:
address: kafka:9092
@@ -43,13 +42,13 @@ module:
type: earliest
topics:
- topic: user-logins
typeUrl: java.showcase.types/org.apache.flink.statefun.playground.java.showcase.part1.types.UserLogin
valueType: java.showcase.types/org.apache.flink.statefun.playground.java.showcase.part1.types.UserLogin
targets:
- java.showcase.fns/user
egresses:
- egress:
meta:
type: statefun.kafka.io/generic-egress
type: io.statefun.kafka/egress
id: java.showcase.io/user-greetings
spec:
address: kafka:9092
@@ -27,8 +27,8 @@ COPY functions.py /app
EXPOSE 8000

# TODO: remove the following 2 lines, once apache_filink_statefun-3.0.0 will be released.
ADD lib-dev/apache_flink_statefun-2.3_SNAPSHOT-py3-none-any.whl /app
RUN pip3 install /app/apache_flink_statefun-2.3_SNAPSHOT-py3-none-any.whl
ADD lib-dev/apache_flink_statefun-3.0_SNAPSHOT-py3-none-any.whl /app
RUN pip3 install /app/apache_flink_statefun-3.0_SNAPSHOT-py3-none-any.whl

CMD ["python3", "/app/functions.py"]

@@ -34,7 +34,7 @@ services:
###############################################################

statefun-manager:
image: flink-statefun:2.3-SNAPSHOT
image: flink-statefun:3.0-SNAPSHOT
expose:
- "6123"
ports:
@@ -46,7 +46,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: flink-statefun:2.3-SNAPSHOT
image: flink-statefun:3.0-SNAPSHOT
expose:
- "6121"
- "6122"
Binary file not shown.
@@ -22,28 +22,27 @@ module:
meta:
kind: http
spec:
typename:
namespace: example
functions: example/*
urlPathTemplate: http://functions:8000/statefun
timeouts:
call: 2min
ingresses:
- ingress:
meta:
type: statefun.kafka.io/routable-protobuf-ingress
type: io.statefun.kafka/ingress
id: example/names
spec:
address: kafka:9092
consumerGroupId: my-group-id
topics:
- topic: names
typeUrl: example/GreetRequest
valueType: example/GreetRequest
targets:
- example/person
egresses:
- egress:
meta:
type: statefun.kafka.io/generic-egress
type: io.statefun.kafka/egress
id: example/greets
spec:
address: kafka:9092

0 comments on commit 2cc9b54

Please sign in to comment.