igalshilman commented on a change in pull request #20:
URL: 
https://github.com/apache/flink-statefun-playground/pull/20#discussion_r800038143



##########
File path: java/greeter/docker-compose.yml
##########
@@ -34,36 +34,21 @@ services:
   #    StateFun runtime
   ###############################################################
 
-  statefun-manager:
-    image: apache/flink-statefun:3.2.0-java11
-    expose:
-      - "6123"
+  statefun:
+    image: statefun-playground-entrypoint:latest
+    command:
+      --module file:///module.yaml
+      --set parallelism.default=1
     ports:
       - "8081:8081"
-    environment:

Review comment:
       I'm such a big fan of red diffs 😃

##########
File path: java/greeter/docker-compose.yml
##########
@@ -34,36 +34,21 @@ services:
   #    StateFun runtime
   ###############################################################
 
-  statefun-manager:
-    image: apache/flink-statefun:3.2.0-java11
-    expose:
-      - "6123"
+  statefun:
+    image: statefun-playground-entrypoint:latest
+    command:
+      --module file:///module.yaml
+      --set parallelism.default=1
     ports:
       - "8081:8081"
-    environment:
-      ROLE: master
-      MASTER_HOST: statefun-manager
-    volumes:
-      - ./module.yaml:/opt/statefun/modules/greeter/module.yaml
-
-  statefun-worker:
-    image: apache/flink-statefun:3.2.0-java11
-    expose:
-      - "6121"
-      - "6122"
     depends_on:
-      - statefun-manager
       - kafka
       - greeter-functions
     links:
-      - "statefun-manager:statefun-manager"
       - "kafka:kafka"
       - "greeter-functions:greeter-functions"
-    environment:
-      ROLE: worker
-      MASTER_HOST: statefun-manager
     volumes:
-      - ./module.yaml:/opt/statefun/modules/greeter/module.yaml
+      - ./module.yaml:/module.yaml

Review comment:
       I guess that this makes sense for the playground runner.

##########
File path: java/greeter/docker-compose.yml
##########
@@ -34,36 +34,21 @@ services:
   #    StateFun runtime
   ###############################################################
 
-  statefun-manager:
-    image: apache/flink-statefun:3.2.0-java11
-    expose:
-      - "6123"
+  statefun:
+    image: statefun-playground-entrypoint:latest

Review comment:
       why not `apache/statefun-playground` ?

##########
File path: playground-internal/statefun-playground-entrypoint/pom.xml
##########
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+  http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.flink</groupId>
+    <artifactId>statefun-playground-entrypoint</artifactId>
+    <version>3.2.0</version>
+    <packaging>jar</packaging>
+
+    <properties>
+        <statefun.version>3.2.0</statefun.version>
+        <flink.version>1.14.3</flink.version>
+        <slf4j.version>1.7.35</slf4j.version>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <!-- StateFun Core -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>statefun-flink-core</artifactId>
+            <version>${statefun.version}</version>
+        </dependency>
+        <!-- StateFun Distribution -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>statefun-flink-io-bundle</artifactId>
+            <version>${statefun.version}</version>
+        </dependency>
+
+        <!-- Flink dependencies -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-java</artifactId>
+            <version>${flink.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-streaming-java_2.12</artifactId>
+            <version>${flink.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-clients_2.12</artifactId>
+            <version>${flink.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-runtime-web_2.12</artifactId>
+            <version>${flink.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-statebackend-rocksdb_2.12</artifactId>
+            <version>${flink.version}</version>
+        </dependency>
+
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!-- Build a fat executable jar -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>

Review comment:
       nit: you can configure it, to not produce a reduced pom.

##########
File path: java/greeter/docker-compose.yml
##########
@@ -34,36 +34,21 @@ services:
   #    StateFun runtime
   ###############################################################
 
-  statefun-manager:
-    image: apache/flink-statefun:3.2.0-java11
-    expose:
-      - "6123"
+  statefun:
+    image: statefun-playground-entrypoint:latest
+    command:
+      --module file:///module.yaml

Review comment:
       What do you think of leaving this command out,
   So that folks would know that they can tweak this, but it would work without 
specifying any command?

##########
File path: playground-internal/statefun-playground-entrypoint/Dockerfile
##########
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Build the functions code ...
+FROM maven:3.6.3-jdk-11 AS builder
+COPY src /usr/src/app/src
+COPY pom.xml /usr/src/app
+RUN mvn -f /usr/src/app/pom.xml clean package
+
+# ... and run the web server!
+FROM openjdk:11

Review comment:
       That is really nice!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to