Skip to content
Permalink
Browse files
[release] Update to v3.2.0
This closes #18.
  • Loading branch information
tillrohrmann committed Feb 1, 2022
1 parent dcfcb3a commit 66cbd1f6f0c9f60a18791f270273944da0433f5c
Showing 24 changed files with 51 additions and 56 deletions.
@@ -38,9 +38,9 @@ for invoking your StateFun functions.

### Configure StateFun Module Specification

The AWS Lambda endpoint URL should be configured as a function endpoint in your [Module Specification](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.0/docs/deployment/module/).
The AWS Lambda endpoint URL should be configured as a function endpoint in your [Module Specification](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.2/docs/deployment/module/).

Note how you may use [templating](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.0/docs/deployment/module/#url-template)
Note how you may use [templating](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.2/docs/deployment/module/#url-template)
in the endpoint URL for multiple functions under the same namespace This allows you to add new AWS Lambda functions,
potentially individually serving different StateFun functions, under separate paths of the same AWS API Gateway endpoint.
This provides flexibility to upgrade your StateFun application by dynamically adding new functions without having to restart the StateFun runtime.
@@ -22,11 +22,11 @@ under the License.

<groupId>org.apache.flink</groupId>
<artifactId>aws-lambda-example</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<packaging>jar</packaging>

<properties>
<statefun.version>3.1.0</statefun.version>
<statefun.version>3.2.0</statefun.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
@@ -17,15 +17,15 @@ data:
state.backend: rocksdb
state.backend.rocksdb.timer-service.factory: ROCKSDB
state.backend.incremental: true
parallelism.default: 1
parallelism.default: 1
s3.access-key: minioadmin
s3.secret-key: minioadmin
state.checkpoints.dir: s3://checkpoints/subscriptions
s3.endpoint: http://minio.statefun.svc.cluster.local:9000
s3.path-style-access: true
jobmanager.memory.process.size: 1g
jobmanager.memory.process.size: 1g
taskmanager.memory.process.size: 1g
log4j-console.properties: |+
monitorInterval=30
rootLogger.level = INFO
@@ -43,7 +43,7 @@ data:
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n
logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
logger.netty.level = OFF
logger.netty.level = OFF
---
apiVersion: v1
@@ -98,7 +98,7 @@ spec:
spec:
containers:
- name: master
image: apache/flink-statefun:3.1.0
image: apache/flink-statefun:3.2.0
imagePullPolicy: IfNotPresent
env:
- name: ROLE
@@ -144,7 +144,7 @@ metadata:
name: statefun-worker
namespace: statefun
spec:
replicas: 1
replicas: 1
selector:
matchLabels:
app: statefun
@@ -157,13 +157,13 @@ spec:
spec:
containers:
- name: worker
image: apache/flink-statefun:3.1.0
image: apache/flink-statefun:3.2.0
imagePullPolicy: IfNotPresent
env:
- name: ROLE
value: worker
- name: MASTER_HOST
value: statefun-master
value: statefun-master
resources:
requests:
memory: "1Gi"
@@ -199,4 +199,3 @@ spec:
items:
- key: module.yaml
path: module.yaml

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

statefun-manager:
image: apache/flink-statefun:3.1.0
image: apache/flink-statefun:3.2.0
expose:
- "6123"
ports:
@@ -46,7 +46,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0
image: apache/flink-statefun:3.2.0
expose:
- "6121"
- "6122"
@@ -18,4 +18,4 @@ module statefun.io/greeter

go 1.16

require github.com/apache/flink-statefun/statefun-sdk-go/v3 v3.1.0
require github.com/apache/flink-statefun/statefun-sdk-go/v3 v3.2.0
@@ -24,7 +24,7 @@ services:
###############################################################

statefun-manager:
image: apache/flink-statefun:3.1.0
image: apache/flink-statefun:3.2.0
expose:
- "6123"
ports:
@@ -36,7 +36,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0
image: apache/flink-statefun:3.2.0
expose:
- "6121"
- "6122"
@@ -72,7 +72,7 @@ services:
###############################################################
# Forward a port 8000 from the host's machine
###############################################################

host-machine:
image: qoomon/docker-host@sha256:e0f021dd77c7c26d37b825ab2cbf73cd0a77ca993417da80a14192cb041937b0
cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
@@ -18,4 +18,4 @@ module statefun.io/showcase

go 1.16

require github.com/apache/flink-statefun/statefun-sdk-go/v3 v3.1.0
require github.com/apache/flink-statefun/statefun-sdk-go/v3 v3.2.0
@@ -22,9 +22,9 @@ that accepts user information to generate personalized greeting messages that ar
our functions service, hosting the `UserFn` and `UserLogin` behind a HTTP endpoint. Check out the source code under
`src/main/java`. The `Dockerfile` is used to build a Docker image for our functions service.
- `user-logins.txt`: A file with multiple JSON objects per line; this is used as test events produced to our application ingress.
- `module.yaml`: The [Module Specification](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.0/docs/deployment/module/) file to be mounted to the StateFun runtime process containers. This
- `module.yaml`: The [Module Specification](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.2/docs/deployment/module/) file to be mounted to the StateFun runtime process containers. This
configures a few things for a StateFun application, such as the service endpoints of the application's functions, as
well as definitions of [Ingresses and Egresses](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.0/docs/io-module/overview/) which the application will use.
well as definitions of [Ingresses and Egresses](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.2/docs/io-module/overview/) which the application will use.
- `docker-compose.yml`: Docker Compose file to spin up everything.

## Prerequisites
@@ -35,7 +35,7 @@ services:
###############################################################

statefun-manager:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6123"
ports:
@@ -47,7 +47,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6121"
- "6122"
@@ -22,11 +22,11 @@ under the License.

<groupId>org.apache.flink</groupId>
<artifactId>greeter-functions-app</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<packaging>jar</packaging>

<properties>
<statefun.version>3.1.0</statefun.version>
<statefun.version>3.2.0</statefun.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
@@ -9,9 +9,9 @@ If you are new to stateful functions, we recommend you to first look at a more s
- `src/`, `pom.xml` and `Dockerfile`: These files and directories are the contents of a Java Maven project which builds
our functions service, hosting the `UserShoppingCartFn` and `StockFn` behind a HTTP endpoint. Check out the source code under
`src/main/java`. The `Dockerfile` is used to build a Docker image for our functions service.
- `module.yaml`: The [Module Specification](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.0/docs/deployment/module/) file to be mounted to the StateFun runtime process containers. This
- `module.yaml`: The [Module Specification](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.2/docs/deployment/module/) file to be mounted to the StateFun runtime process containers. This
configures a few things for a StateFun application, such as the service endpoints of the application's functions, as
well as definitions of [Ingresses and Egresses](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.0/docs/io-module/overview/) which the application will use.
well as definitions of [Ingresses and Egresses](https://ci.apache.org/projects/flink/flink-statefun-docs-release-3.2/docs/io-module/overview/) which the application will use.
- `docker-compose.yml`: Docker Compose file to spin up everything.
- `playthrough`: utilities for automatically playing through the interactions scenarios.

@@ -59,7 +59,7 @@ It will send a series of messages, results of which you can observe in the logs
```
docker-compose logs -f shopping-cart-functions
```
Note: `Caller: Optional.empty` in the logs corresponds to the messages that came via an ingress rather than from another stateful function.
Note: `Caller: Optional.empty` in the logs corresponds to the messages that came via an ingress rather than from another stateful function.

To see the results produced to the egress:
```
@@ -71,6 +71,3 @@ If you want to modify the code, you can do a hot redeploy of your functions serv
docker-compose up -d --build shopping-cart-functions
```
This rebuilds the functions service image with the updated code, and restarts the service with the new image.



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

statefun-manager:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6123"
ports:
@@ -47,7 +47,7 @@ services:
- ./module.yaml:/opt/statefun/modules/shopping-cart/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6121"
- "6122"
@@ -22,11 +22,11 @@ under the License.

<artifactId>shopping-cart</artifactId>
<groupId>org.apache.flink</groupId>
<version>3.1.0</version>
<version>3.2.0</version>
<packaging>jar</packaging>

<properties>
<statefun.version>3.1.0</statefun.version>
<statefun.version>3.2.0</statefun.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<untertow.version>1.4.18.Final</untertow.version>
@@ -22,11 +22,11 @@ under the License.

<groupId>org.apache.flink</groupId>
<artifactId>statefun-java-showcase</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<packaging>jar</packaging>

<properties>
<statefun.version>3.1.0</statefun.version>
<statefun.version>3.2.0</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("apache/flink-statefun:3.0.0"))
return new GenericContainer<>(DockerImageName.parse("apache/flink-statefun:3.2.0"))
.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("apache/flink-statefun:3.0.0"))
return new GenericContainer<>(DockerImageName.parse("apache/flink-statefun:3.2.0"))
.withNetwork(network)
.withNetworkAliases("statefun-worker")
.withEnv("ROLE", "worker")
@@ -18,9 +18,8 @@ FROM node:16

WORKDIR /usr/src/app

COPY apache-flink-statefun-3.2-SNAPSHOT.tgz ./
COPY package.json ./
RUN npm install -s apache-flink-statefun-3.2-SNAPSHOT.tgz
RUN npm install apache-flink-statefun@3.2.0

COPY functions.js ./

Binary file not shown.
@@ -34,7 +34,7 @@ services:
###############################################################

statefun-manager:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6123"
ports:
@@ -46,7 +46,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6121"
- "6122"
@@ -7,6 +7,6 @@
"start": "node functions.js"
},
"dependencies": {
"apache-flink-statefun": "3.2-SNAPSHOT"
"apache-flink-statefun": "3.2.0"
}
}
@@ -24,7 +24,7 @@ services:
###############################################################

statefun-manager:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6123"
ports:
@@ -36,7 +36,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6121"
- "6122"
@@ -72,7 +72,7 @@ services:
###############################################################
# Forward a port 8000 from the host's machine
###############################################################

host-machine:
image: qoomon/docker-host@sha256:e0f021dd77c7c26d37b825ab2cbf73cd0a77ca993417da80a14192cb041937b0
cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
@@ -34,7 +34,7 @@ services:
###############################################################

statefun-manager:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6123"
ports:
@@ -46,7 +46,7 @@ services:
- ./module.yaml:/opt/statefun/modules/greeter/module.yaml

statefun-worker:
image: apache/flink-statefun:3.1.0-java11
image: apache/flink-statefun:3.2.0-java11
expose:
- "6121"
- "6122"
@@ -15,4 +15,4 @@
# limitations under the License.

aiohttp
apache-flink-statefun==3.1.0
apache-flink-statefun==3.2.0

0 comments on commit 66cbd1f

Please sign in to comment.