wmedvede commented on code in PR #322:
URL: 
https://github.com/apache/incubator-kie-kogito-serverless-operator/pull/322#discussion_r1462229891


##########
test/testdata/persistence/workflow/by_service/03-sonataflow_callbackstatetimeouts.sw.yaml:
##########
@@ -0,0 +1,101 @@
+# Copyright 2024 Apache Software Foundation (ASF)
+#
+# Licensed 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.
+
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: callbackstatetimeouts
+  annotations:
+    sonataflow.org/description: Callback State Timeouts Example k8s
+    sonataflow.org/version: 0.0.1
+spec:
+  persistence:
+    postgresql:
+      secretRef:
+        name: postgres-secrets
+        userKey: POSTGRES_USER
+        passwordKey: POSTGRES_PASSWORD
+      serviceRef:
+        name: postgres
+        port: 5432
+        databaseName: sonataflow
+        databaseSchema: callbackstatetimeouts
+  podTemplate:
+    container:
+      env:
+      - name: QUARKUS_FLYWAY_MIGRATE_AT_START
+        value: "true"
+    initContainers:
+      - name: init-postgres
+        image: registry.access.redhat.com/ubi9/ubi-minimal:latest
+        imagePullPolicy: IfNotPresent
+        command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat 
/var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432)
 >/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ]

Review Comment:
   General comment here guys  @jordigilh @ricardozanini that doesn't block this 
PR.
   
   I think we need to assess here, because the persistence is a sort of all or 
nothing.
   
   I mean, if we add the 
**org.kie.kogito:kogito-addons-quarkus-persistence-jdbc:999-SNAPSHOT** to the 
**kogito-swf-builder**, then, every workflow image we produce must use 
persistence, otherwise we'll have runtime start-up failures.
   Additionally, we have the following scenarios:
   
   **1) The image is produced externally:**
   The workflow must come already built with the proper extensions incorporated 
in the produced image, and users might decide in a per-workflow basis to 
include the persistence related addons.
   The operator just relies on the workflow CRD con connect with the DB, and 
just produce the ENV vars as Jordi is doing. 
   If the image is not ok, it's not the operator problem. Which make sense in 
my opinion.
   
   (right now, AFAIK Parodos team is using the kogito-swf-builder series to 
produce their images, and I think they might eventually produce the images by 
adding the persistence related extensions in a per-workflow basis,
   or always add them if they always want persistence)
   
   **2) The Image is produced by the operator, and thus, managed by Kaniko or 
OpenShift based builds, etc.**
   In these cases, we could eventually manage to add the persistence extensions 
somehow dynamically, since in the end, for example with the Kaniko build we are 
producing a sonataflow-my-workflow-builder CM and here we can maybe manage to 
add these extensions.
   
   But, since Parodos is working with 1), I think they should add those 
extensions in their images build system.
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to