Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to display fileName.sw.yaml that has a workflow defined in a manifest for a custom resource - VSCode serverless workflow editor #2127

Open
domhanak opened this issue Jan 22, 2024 · 3 comments

Comments

@domhanak
Copy link
Contributor

domhanak commented Jan 22, 2024

Extension version: 0.32
The file is correct and works well when used with OCP.

File content:

# 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: <url>/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;' ]
  flow:
    start: PrintStartMessage
    events:
      - name: callbackEvent
        source: ''
        type: callback_event_type
    functions:
      - name: systemOut
        type: custom
        operation: sysout
    states:
      - name: PrintStartMessage
        type: operation
        actions:
          - name: printSystemOut
            functionRef:
              refName: systemOut
              arguments:
                message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId + \" has started.\"}"
        transition: CallbackState
      - name: CallbackState
        type: callback
        action:
          name: callbackAction
          functionRef:
            refName: systemOut
            arguments:
              message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId + \" has executed the callbackFunction.\"}"
        eventRef: callbackEvent
        transition: CheckEventArrival
        timeouts:
          eventTimeout: PT30S
      - name: CheckEventArrival
        type: switch
        dataConditions:
          - condition: "${ .eventData != null }"
            transition: EventArrived
        defaultCondition:
          transition: EventNotArrived
      - name: EventArrived
        type: inject
        data:
          exitMessage: "The callback event has arrived."
        transition: PrintExitMessage
      - name: EventNotArrived
        type: inject
        data:
          exitMessage: "The callback event has not arrived, and the timeout has overdue."
        transition: PrintExitMessage
      - name: PrintExitMessage
        type: operation
        actions:
          - name: printSystemOut
            functionRef:
              refName: systemOut
              arguments:
                message: "${\"callback-state-timeouts: \" + $WORKFLOW.instanceId + \" has finalized. \" + .exitMessage + \" eventData: \" + .eventData}"
        end: true
@ederign
Copy link
Member

ederign commented Jan 23, 2024

@domhanak we don't provide visualization of the workflow in a manifest for a custom resource. On Serverless Workflow, the only source we will support is serverless workflow spec files (JSON or YAML).

@ederign ederign closed this as completed Jan 23, 2024
@domhanak
Copy link
Contributor Author

domhanak commented Jan 23, 2024

@ederign The file is indeed called fileName.sw.yaml so that's why I am confused. It comes from the community during testing of persistence additions.
Could it be considered a feature? Displaying such workflows? Thinking the flow: could be taken and displayed.

@ederign
Copy link
Member

ederign commented Jan 23, 2024

For the operator test, that is the correct file.

Display those workflows could be an interesting feature, but currently is not on our short term roadmap.

@ederign ederign reopened this Jan 23, 2024
@domhanak domhanak changed the title Unable to open a file in VSCode serverless workflow editor Unable to display a Workflow defined in a manifest for a custom resource in VSCode serverless workflow editor Jan 23, 2024
@domhanak domhanak changed the title Unable to display a Workflow defined in a manifest for a custom resource in VSCode serverless workflow editor Unable to display fileName.sw.yaml that has a workflow defined in a manifest for a custom resource - VSCode serverless workflow editor Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants