### Verifying Rill-Flow Installation Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/01-quickstart.md This command checks the status of the services defined in the docker-compose.yml file. It ensures that all the required services are up and running, indicating a successful installation. ```shell docker-compose ps ``` -------------------------------- ### Starting Sample API Service with Docker Compose Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This bash script uses docker-compose to start a sample API service required for some of the Rill Flow examples. It defines a service named sample-executor using the weibocom/rill-flow-sample:sample-executor image. ```Bash cat < docker-compose-sample.yaml version: '3' services: sample-executor: image: weibocom/rill-flow-sample:sample-executor EOF docker-compose up -d ``` -------------------------------- ### Starting Rill-Flow Services with Docker Compose Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/01-quickstart.md This command navigates to the docker directory within the Rill-Flow source code and starts all the necessary services defined in the docker-compose.yml file in detached mode. ```shell cd rill-flow/docker docker-compose up -d ``` -------------------------------- ### Cloning Rill-Flow Repository Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/01-quickstart.md This command clones the Rill-Flow repository from GitHub to your local machine. It's the first step in setting up the Rill-Flow environment. ```shell git clone https://github.com/weibocom/rill-flow.git ``` -------------------------------- ### Installing rill-flow-ui Dependencies Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command installs the dependencies for the rill-flow-ui project using pnpm. It should be executed from the rill-flow-ui directory after downloading the source code. ```bash pnpm install ``` -------------------------------- ### Starting Kafka with Docker Compose Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This bash script uses docker-compose to start a Kafka cluster with Zookeeper. It defines the necessary services, ports, and environment variables for Kafka to run. ```Bash cat << EOF > docker-compose-sample.yaml version: '3' services: zoo1: image: confluentinc/cp-zookeeper:7.3.2 hostname: zoo1 container_name: zoo1 ports: - "2181:2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 ZOOKEEPER_SERVER_ID: 1 ZOOKEEPER_SERVERS: zoo1:2888:3888 kafka1: image: confluentinc/cp-kafka:7.3.2 hostname: kafka1 container_name: kafka1 ports: - "9092:9092" - "29092:29092" - "9999:9999" environment: KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092,DOCKER://host.docker.internal:29092 KAFKA_ADVERTISED_HOST_NAME: localhost KAFKA_CREATE_TOPICS: "topic_input:1:1" KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181" KAFKA_BROKER_ID: 1 KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO" KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 KAFKA_JMX_PORT: 9999 KAFKA_JMX_HOSTNAME: ${DOCKER_HOST_IP:-127.0.0.1} KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.authorizer.AclAuthorizer KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" depends_on: - zoo1 EOF docker-compose -f docker-compose-sample.yaml up -d ``` -------------------------------- ### Sample Rill Flow YAML Definition Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/01-quickstart.md This YAML configuration defines a simple Rill Flow with two tasks, Bob and Alice, each calling a sample-executor service to greet a user. It specifies the flow's version, workspace, DAG name, alias, type, input schema, and task details including resource names, patterns, tolerance, and input mappings. ```yaml version: 1.0.0 workspace: rillFlowSimple dagName: greet alias: release type: flow inputSchema: >- [{"required":true,"name":"Bob","type":"String"},{"required":true,"name":"Alice","type":"String"}] tasks: - category: function name: Bob resourceName: http://sample-executor:8000/greet.json?user=Bob pattern: task_sync tolerance: false next: Alice inputMappings: - source: "$.context.Bob" target: "$.input.Bob" - category: function name: Alice resourceName: http://sample-executor:8000/greet.json?user=Alice pattern: task_sync tolerance: false inputMappings: - source: "$.context.Alice" target: "$.input.Alice" ``` -------------------------------- ### Installing flow-graph Dependencies Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command installs the dependencies for the flow-graph project using pnpm. It should be executed from the flow-graph directory after navigating into it. ```bash cd flow-graph pnpm install ``` -------------------------------- ### Installing nvm (Node Version Manager) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command downloads and executes the nvm installation script, which allows you to manage multiple Node.js versions on your system. It is a prerequisite for installing a specific Node.js version. ```shell curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash ``` -------------------------------- ### Running rill-flow-ui in Development Mode Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command starts the rill-flow-ui application in development mode using pnpm. This allows you to make changes to the code and see them reflected in the browser in real-time. ```bash pnpm serve ``` -------------------------------- ### Installing pnpm Package Manager Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command installs the pnpm package manager globally using npm, specifying a registry mirror for faster downloads. pnpm is used to manage dependencies for the Rill-Flow UI project. ```shell npm install -g pnpm --registry=https://registry.npmmirror.com ``` -------------------------------- ### Running flow-graph in Development Mode Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command starts the flow-graph application in development mode using pnpm. This allows you to make changes to the code and see them reflected in the browser in real-time. ```bash pnpm serve ``` -------------------------------- ### Installing and Setting Default Node.js Version Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md These commands install Node.js version 18.19.0 using nvm and then set it as the default Node.js version for your system. This ensures that the correct Node.js version is used for the Rill-Flow project. ```shell nvm install v18.19.0 nvm alias default v18.19.0 ``` -------------------------------- ### Starting Local Development Server with Yarn Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/README.md Starts a local development server for the Rill Flow documentation website using Yarn. This allows for live previewing of changes without restarting the server. ```Shell $ yarn start ``` -------------------------------- ### Building rill-flow-ui for Production Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command builds the rill-flow-ui application for production using pnpm. This creates optimized and minified files that can be deployed to a production environment. ```bash pnpm build:prod ``` -------------------------------- ### Building flow-graph for Production Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/03-rill-flow-ui/01-env.md This command builds the flow-graph application for production using pnpm. This creates optimized and minified files that can be deployed to a production environment. ```bash pnpm build:prod ``` -------------------------------- ### Installing Dependencies with Yarn Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/README.md Installs the necessary dependencies for the Rill Flow documentation website using Yarn package manager. This command is essential for setting up the development environment. ```Shell $ yarn ``` -------------------------------- ### HTTP Resource Name Example Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/02-task-and-dispatcher.md This example demonstrates a typical HTTP URL used as a `resourceName` for an HTTP dispatcher. It specifies the protocol (http), server address (www.sample.com), and the resource path (callback.json). ```txt http://www.sample.com/callback.json ``` -------------------------------- ### Resource Name URL Example Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/02-task-and-dispatcher.md This example shows the simplified URL format used to describe dispatchers and executors via the `resourceName` property. It includes the protocol, server address, port, resource path, query parameters, and fragment ID. ```txt [协议类型]://[服务器地址]:[端口号]/[资源层级UNIX文件路径][文件名]?[查询参数]#[片段ID] ``` -------------------------------- ### Complete Task Configuration with Mappings Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/04-context-and-mapping.md This YAML snippet provides a comprehensive example of task configuration, including input mappings with both direct source-target assignments and references to common mappings. It also demonstrates output mappings for updating the context. ```yaml type: flow dagName: sample_dag commonMapping: commonInput: - source: $.context.user target: $.input.user tasks: - name: A inputMappings: - source: $.context.urlCon target: $.input.url - source: "hello" target: $.input.text - reference: commonInput outputMappings: - source: $.output.segments target: $.context.segments ``` -------------------------------- ### Executor Address Example Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/03-executor.md Example of an executor address when deployed using docker-compose. The `resourceName` and executor address are the same in this case. ```text http://sample-executor:8000/executor.json ``` -------------------------------- ### Base64 Encoded Image Icon Example Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/06-background/02-definition/03-node-template.md This example shows how to use a base64 encoded image as a node icon. The base64 string represents the image data. ```text iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAC3BJREFUeF7tXXuMHVUZ/76ZvY3txgpiAkXbGEUgGiUGjFpLrYaiAimiGElQULStJljZ3Xu+uRur24vdvXPO7G6RWJUiqICpj0SQR4zFR1UqUcEHBnwU8f2MQdSuG7d75zOn3C232zt3Zu6de+64c07SP7rzne/x+373mzmPOYNgW6ERwEJHb4MHS4CCk8ASwBKg4AgUPHxbASwBCo5AwcO3FcASoOAIFDx8WwEsAQqOQMHDtxXAEqDgCBQ8fFsBLAEKjkDBw7cVwBKg4AgUPHxbASwBCo5AwcO3FcASoOAIFDx8WwEsAQqOQMHDtxXAEqDgCBQ8fFsBLAGWHgJSyh2IeCkAvCjj6PbX6/Xq6Ojo/oz19k3dkqwASqlvAsCGHqG6n4he0yPdxtUuVQJwL5EkoiWD25IJpDnhSilLgIS/AEuAhEA1i9kK0AFoJrvYCpAc7UJVgLS/3CgipdWTPB3mJS0B2mBuCWCekJlYzCpxWenJJKgeKcllBZienn7m4cOHt+mYmfmLlUrl4TTxZ5W4rPQEQXBeGIbrdAye5+1IE0uvZXNHgLGxsZWDg4P/bAr83wCwi4jGkoChlDoXAL7dSjbtvTuKAI7jnFsul++L80dKearOOSIeIfN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Acp5NWALkOTsGfLMEMABynk1YAuQ5OwZ8+x/KkOLMeCJQyAAAAABJRU5ErkJggg== ``` -------------------------------- ### Calling API with cURL Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This cURL command submits a flow to the Rill Flow server, triggering an API call. It specifies the descriptor ID and sends a JSON payload with an input number. ```cURL curl --location 'http://127.0.0.1:8080/flow/submit.json?descriptor_id=rillFlowSample:callApiSample' \ --header 'Content-Type: application/json' \ --data '{ "input_num":10 }' ``` -------------------------------- ### Example JSON for Kafka trigger creation Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/04-execution/02-trigger.md This JSON example shows the required parameters for creating a Kafka trigger task. It includes the Kafka server address, group ID, and topic to listen to. ```json { "kafka_server": "127.0.0.1:9200", "group_id": "rill-flow-group", "topic": "submit_topic" } ``` -------------------------------- ### Ant Design Vue Icon Example Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/06-background/02-definition/03-node-template.md This example demonstrates how to use an Ant Design Vue icon as a node icon. The format is 'ant-design:{icon}'. ```text ant-design:api-outlined ``` -------------------------------- ### Submitting Parallel Async Task Flow with cURL Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This cURL command submits a flow designed for parallel and asynchronous processing to the Rill Flow server. It includes a random number as input. ```cURL curl --location 'http://127.0.0.1:8080/flow/submit.json?descriptor_id=rillFlowSample%3AparallelAsyncTask' \ --header 'Content-Type: application/json' \ --data '{ "rand_num":20 }' ``` -------------------------------- ### Example JSON for cron trigger creation Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/04-execution/02-trigger.md This JSON example shows the required parameters for creating a cron trigger task. It includes the cron expression and the context to be used when executing the DAG. ```json { "cron": "0 * * * * *", "context": { "message": "hello world" } } ``` -------------------------------- ### ResourceName Example (HTTP) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/best-practice/01-customize-executor.md Illustrates a typical ResourceName structure using the HTTP protocol. The `http` part specifies the dispatcher name, `sample-service` corresponds to the deployment unit, and `do_something` represents the specific function. Parameters are passed using the `body`. ```ignorelang http://sample-service/do_something ``` -------------------------------- ### Input Mapping Example in Rill Flow Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/04-context-and-mapping.md This YAML snippet demonstrates how to map a context variable 'foo' to a task's input parameter 'bar' using the inputMappings configuration. It shows the source and target properties using JsonPath expressions. ```yaml inputMappings: - source: $.context.foo target: $.input.bar ``` -------------------------------- ### ResourceName Example (Motan) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/best-practice/01-customize-executor.md Shows an example of a ResourceName when using a Motan-based dispatcher for RPC requests. `motan` indicates the dispatcher, `group_name` and `service_name` identify the service. ```ignorelang motan://group_name/service_name ``` -------------------------------- ### Submitting Kafka Message with Docker Exec Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This bash command uses docker exec to send a message to a Kafka topic from within the kafka1 container. It pipes a JSON message to the kafka-console-producer. ```Bash docker exec kafka1 bash -c 'echo {\"message\":\"this is a message from rill-flow\"} |kafka-console-producer --bootstrap-server localhost:19092 --topic topic_input' ``` -------------------------------- ### Submitting a Flow with cURL Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This cURL command submits a flow to the Rill Flow server using the specified descriptor ID and input data. It sends a JSON payload containing an input number to the server. ```cURL curl --location 'http://127.0.0.1:8080/flow/submit.json?descriptor_id=rillFlowSample:switchSample' \ --header 'Content-Type: application/json' \ --data '{ "input_num":10 }' ``` -------------------------------- ### Creating Kafka Trigger with cURL Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This cURL command creates a Kafka trigger in Rill Flow, which will initiate a flow when a message is received on the specified Kafka topic. It requires the topic name, Kafka server address, and group ID. ```cURL curl -XPOST 'http://127.0.0.1:8080/flow/trigger/add_trigger.json?descriptor_id=rillFlowSample:kafkaTranslate&type=kafka' -d '{"topic": "topic_input", "kafka_server": ":9092", "group_id": "rill-flow-group"}' -H 'Content-Type: application/json' ``` -------------------------------- ### Submitting Subgraph Task Flow with cURL Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/getting-started/02-sample.md This cURL command submits a flow that references a subgraph to the Rill Flow server. It sends a parent random number as input. ```cURL curl --location 'http://127.0.0.1:8080/flow/submit.json?descriptor_id=rillFlowSample%3AsubdagTask' \ --header 'Content-Type: application/json' \ --data '{ "parent_rand_num":20 }' ``` -------------------------------- ### Rate Limiting Configuration Example Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/04-execution/04-overflow.md This JSON configuration demonstrates how to set up rate limiting using the key_resource mode. The check_type field specifies the rate limiting strategy, and the key_resources field lists the critical resources that trigger rate limiting when all are in a circuit-broken state. ```json { "check_type": "key_resource", "key_resources": [ "http://127.0.0.1:8080/sample/start.json", "http://127.0.0.1:8080/sample/end.json" ] } ``` -------------------------------- ### Generated JSON Input from Context Mapping Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/04-context-and-mapping.md This JSON snippet shows the resulting input structure that would be passed to a task if the context variable 'foo' is set to 'hello' and mapped to the 'bar' parameter as defined in the previous YAML example. ```json { "bar": "hello" } ``` -------------------------------- ### Example JSON message for Kafka trigger Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/04-execution/02-trigger.md This JSON example shows the format of the message that should be sent to the Kafka topic to trigger the DAG execution. The message body will be used as the context for the DAG execution. ```json { "message": "hello world" } ``` -------------------------------- ### Example JSON response for trigger task list Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/04-execution/02-trigger.md This JSON example shows the structure of the response when querying the list of trigger tasks. It includes a code indicating success or failure, and a data field containing the task details. ```json { "code": 0, "data": { "submit_topic#weiboFaasFlowTest:openaiTask": { "descriptor_id": "RillFlowTest:openaiTask" } } } ``` -------------------------------- ### Two-Layer Input Mapping Example in Rill Flow Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/04-context-and-mapping.md This YAML snippet demonstrates a two-layer input mapping, where the context variable 'name' is mapped to a nested property 'user.name' within the task's input. Rill Flow automatically creates the intermediate 'user' object. ```yaml inputMappings: - source: $.context.name target: $.input.user.name ``` -------------------------------- ### Rate Limiting via URL Parameter Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/04-execution/04-overflow.md This curl command demonstrates how to pass the rate limiting configuration as a URL-encoded parameter (resource_check) when submitting a flow. The example uses the long_board rate limiting strategy. ```sh curl -XPOST 'http://127.0.0.1:8080/flow/submit.json?descriptor_id=demoFlowTest:demoTest&resource_check=%7B%22check_type%22%3A%22long_board%22%7D' -H'Content-Type:application/json' -d '{"left":5,"right":5}' ``` -------------------------------- ### Generated JSON Input with Nested Structure Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/04-context-and-mapping.md This JSON snippet shows the resulting input structure with a nested 'user' object containing the 'name' property, based on the two-layer mapping defined in the previous YAML example. The context variable 'name' is assumed to be 'hello'. ```json { "user": { "name": "hello" } } ``` -------------------------------- ### Get Workflow Execution Status Response Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/07-api.md This snippet shows the JSON response format for retrieving the workflow execution status from the `/flow/get.json` endpoint. It includes the execution ID, status, progress, and task details. ```txt { "ret": { "execution_id": "", // 工作流执行ID "dag_status": "RUNNING", // 工作流执行状态 "process": 100, // 工作流当前执行进度(100代表100%) "tasks": { // brief为true时不返回tasks。tasks是以节点名称为key,节点信息为value的map结构 "startNode": { "contains_sub": false, // 是否包含子节点 "name": "startNode", // 节点名称 "next": ["endNode"], // 下一个节点名称 "status": "NOT_STARTED", // 节点状态 "task": { "name": "startNode", "next": "endNode", "resourceName": "http://127.0.0.1:8080/flow/sample/start_node.json", "pattern": "task_sync", "inputMappings": [ // 输入映射规则 ... ], "outputMappings": [ // 输出映射规则 ... ] } }, "endNode": { ... } } } } ``` -------------------------------- ### Maven Build Configuration for Plugin (XML) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/01-plugin/02-create-plugin.md This XML snippet demonstrates the Maven build configuration required for packaging the plugin. It includes the maven-assembly-plugin for creating a jar-with-dependencies, the maven-deploy-plugin to skip deployment, and the maven-compiler-plugin with the ExtensionAnnotationProcessor for PF4J. ```xml user-plugin org.apache.maven.plugins maven-assembly-plugin 3.1.0 jar-with-dependencies ${project.artifactId}-${project.version}-all false false true true aliyun-ai-plugin 1.0 rill-flow make-assembly package single org.apache.maven.plugins maven-deploy-plugin true 2.8.2 org.apache.maven.plugins maven-compiler-plugin 2.5.1 org.pf4j.processor.ExtensionAnnotationProcessor ``` -------------------------------- ### Building Static Content with Yarn Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/README.md Generates static content for the Rill Flow documentation website using Yarn. The output is placed in the `build` directory, ready for deployment on a static hosting service. ```Shell $ yarn build ``` -------------------------------- ### Deploying Rill Flow to Kubernetes using Helm Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/02-deploy.md This command adds the Rill Flow Helm repository and deploys Rill Flow to a Kubernetes cluster using Helm. It creates a new namespace for the deployment. ```shell helm repo add rill-flow https://rill-flow.github.io/rill-flow-helm-chart helm upgrade --install rill-flow rill-flow/rill-flow -n=rill-flow --create-namespace ``` -------------------------------- ### Creating a Workflow with curl Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/07-api.md This snippet demonstrates how to create a workflow using a POST request to the `/flow/bg/manage/descriptor/add_descriptor.json` endpoint. It includes the necessary headers and data for defining the workflow. ```curl curl --location --request POST 'http://127.0.0.1:8080/flow/bg/manage/descriptor/add_descriptor.json?business_id=demoFlowTest &feature_name=demoFlowTest &alias=release' \ --header 'Content-Type: text/plain' \ --data-raw '--- version: 20230829 workspace: demoFlowTest dagName: demoTest type: flow tasks: - category: function name: startNode next: endNode resourceName: http://127.0.0.1:8080/flow/sample/start_node.json pattern: task_sync inputMappings: - target: $.input.right source: $.context.right - target: $.input.left source: $.context.left outputMappings: - target: $.context.result_number source: $.output.result_number - category: function name: endNode resourceName: http://127.0.0.1:8080/flow/sample/end_node.json pattern: task_sync inputMappings: - target: $.input.result_number source: $.context.result_number - target: $.input.expect_number source: $.context.result_number ' ``` -------------------------------- ### Plugin Manifest Configuration (MANIFEST.MF) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/01-plugin/02-create-plugin.md This snippet shows the configuration of the MANIFEST.MF file, which is required by PF4J. It includes essential plugin metadata such as Plugin-Id, Plugin-Provider, and Plugin-Version. This file is placed in the META-INF directory within the plugin's resources directory. ```text Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: decebal Build-Jdk: 17.0.8 Plugin-Id: user-plugin Plugin-Provider: rill-flow Plugin-Version: 0.0.1 ``` -------------------------------- ### Deploying Rill Flow with Docker and External Services Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/02-deploy.md This command deploys Rill Flow using Docker, configuring it to connect to external Redis and Jaeger services by setting environment variables. It also deploys the Rill Flow UI. ```shell docker run -d --name rill-flow -p 8080:8080 -e rill_flow_descriptor_redis_host=${redis_ip} -e rill_flow_descriptor_redis_port=${redis_port} -e rill_flow_default_redis_host=${redis_ip} -e rill_flow_default_redis_port=${redis_port} -e rill_flow_trace_query_host=${trace_server} -e rill_flow_callback_url=${callback_url} weibocom/rill-flow:latest && \ docker run -d --name rill-flow-ui -p 8088:80 -e BACKEND_SERVER=${backend_server} weibocom/rill-flow-ui:latest ``` -------------------------------- ### Run Prometheus in Docker Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/05-monitor/02-prometheus.md This command deploys Prometheus using Docker, mapping the configuration file and exposing the Prometheus web interface on port 9090. Replace `/path/to/prometheus.yml` with the actual path to the configuration file. ```Shell docker run -p 9090:9090 -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus ``` -------------------------------- ### Defining a DAG-based Workflow in YAML Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/03-defination/01-flow.md This YAML snippet defines a simple DAG-based workflow named 'sample_dag'. It outlines the tasks (A, B, C, D, E, F, G, H) and their dependencies using the 'next' property. The 'category' property specifies the type of each task (function or return). ```yaml type: flow dagName: sample_dag tasks: - name: A next: B,F category: function - name: B next: C category: function - name: C next: D,E category: function - name: D category: return - name: E next: H category: function - name: F next: G category: function - name: G next: F category: function - name: H category: return ``` -------------------------------- ### Default YAML Template for Aliyun AI Dispatcher Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/06-background/02-definition/03-node-template.md This YAML template configures a default task for an Aliyun model service dispatcher. It specifies the resource name, protocol, task name, category, and pattern. ```yaml resourceName: "aliyun_ai://aliyun" resourceProtocal: "aliyun_ai" name: "aliyunAiTemplate" category: "function" pattern: "task_sync" ``` -------------------------------- ### Executing a Workflow with curl Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/07-api.md This snippet demonstrates how to execute a workflow using a POST request to the `/flow/submit.json` endpoint. It includes the necessary parameters and context information. ```curl curl -XPOST 'http://127.0.0.1:8080/2/flow/submit.json?descriptor_id=demoFlowTest:demoTest' -d '{"left": 512, "right": 512}' -H'Content-Type:application/json' ``` -------------------------------- ### Implementing DispatcherExtension Interface (Java) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/01-plugin/02-create-plugin.md This Java code snippet shows how to create a plugin class that implements the DispatcherExtension interface. This interface is essential for defining the plugin's behavior within Rill Flow. The handle method is where the plugin's logic is implemented, and the getName method provides a unique identifier for the plugin. ```java import org.pf4j.Extension; import com.rill.flow.interfaces.dispatcher.DispatcherExtension; @Extension public class UserDefineDispatcherExtension implements DispatcherExtension { @Override public String handle(Resource resource, DispatchInfo dispatchInfo) { return null; } @Override public String getName() { return "user_define"; } } ``` -------------------------------- ### Swagger UI Access URL Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/07-api.md This snippet shows the URL to access the Swagger UI for the Rill Flow API. It provides a complete interface description. ```txt http://127.0.0.1:8080/swagger-ui.html ``` -------------------------------- ### Default YAML Template for HTTP Dispatcher Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/06-background/02-definition/03-node-template.md This YAML template configures a default task for an HTTP protocol dispatcher. It includes resource name, protocol, task name, category, and pattern. ```yaml resourceName: "http://www.sample.com/execute.json" resourceProtocal: "http" name: "httpDemo" category: "function" pattern: "task_sync" ``` -------------------------------- ### Checking Rill Flow Deployment Status in Kubernetes Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/02-deploy.md This command retrieves the status of the pods in the 'rill-flow' namespace, allowing you to verify that Rill Flow has been deployed successfully. ```shell kubectl get pod -n=rill-flow ``` -------------------------------- ### Accessing Jaeger UI Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/05-monitor/01-trace.md Provides the URL to access the Jaeger visualization interface for viewing traces. The default port is 16686. ```txt http://127.0.0.1:16686/search ``` -------------------------------- ### Hiding Component Information in Traces Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/05-monitor/01-trace.md Shows how to hide information about specific components (e.g., JEDIS, HTTP, JDBC) in the trace by setting the `OTEL_INSTRUMENTATION__ENABLED` environment variable to `false`. This allows filtering out unnecessary details from the trace. ```txt OTEL_INSTRUMENTATION_JEDIS_ENABLED=false ``` -------------------------------- ### Adding Rill Flow Interfaces Dependency (XML) Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/develop/01-plugin/02-create-plugin.md This XML snippet demonstrates how to add the rill-flow-interfaces dependency to your plugin project using Maven. This dependency provides the necessary interfaces for creating Rill Flow plugins. ```xml com.weibo.api.video.task rill-flow-interfaces ``` -------------------------------- ### Adding Parameters to Callback URL in Rill Flow Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/best-practice/03-work-with-servless.md This YAML snippet shows how to add extra parameters to the trigger_url. This allows passing additional context to the callback endpoint when the task completes. ```yaml inputMappings: - target: $.input.data.trigger_url source: $.tasks.task1.trigger_url?context=%7B%22key%22%3A%20%22value%22%7D ``` -------------------------------- ### Mapping Callback URL as Task Parameter in Rill Flow Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/best-practice/03-work-with-servless.md This YAML snippet demonstrates how to map the callback URL of a task (task1) to an input parameter (trigger_url) of another task within a Rill Flow workflow. This allows the receiving task to be notified upon completion of task1. ```yaml inputMappings: - target: $.input.data.trigger_url source: $.tasks.task1.trigger_url ``` -------------------------------- ### i18n Script Commands Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/README.md These commands are used for internationalization (i18n) of the Rill Flow documentation. They download and upload translation files using Crowdin. ```Shell npm run crowdin download npm run crowdin upload ``` -------------------------------- ### Configuring Rill Flow Kubernetes Deployment with External Redis and Jaeger Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/02-deploy.md This command configures the Rill Flow deployment to use external Redis and Jaeger services instead of the default in-cluster components. It disables the default Redis and Jaeger deployments and sets the necessary environment variables. ```shell helm upgrade --install rill-flow rill-flow/rill-flow -n=rill-flow --create-namespace \ --set redis.enabled=false \ --set rillFlow.backend.env.rillFlowDescriptorRedisHost=${redis_host} \ --set rillFlow.backend.env.rillFlowDescriptorRedisPort=${redis_port} \ --set rillFlow.backend.env.rillFlowDefaultRedisHost=${redis_host} \ --set rillFlow.backend.env.rillFlowDefaultRedisPort=${redis_port} \ --set jaeger.enabled=false \ --set rillFlow.backend.env.rillFlowTraceEndpoint=${jaeger_endpoint} \ --set rillFlow.backend.env.rillFlowTraceQueryHost=${jaeger_query_server} ``` -------------------------------- ### Configure Prometheus.yml for Rill Flow Monitoring Source: https://github.com/rill-flow/rill-flow.github.io/blob/main/docs/user-guide/05-monitor/02-prometheus.md This YAML configuration file sets up Prometheus to scrape metrics from the Rill Flow application. It defines the scrape interval, job name, metrics path, and target endpoint. ```YAML global: scrape_interval: 15s scrape_configs: - job_name: "Rill Flow" metrics_path: '/actuator/prometheus' static_configs: - targets: ['host.docker.internal:8080'] ```