From 6200cbe6009329264c0975656160cf1c64c94ae6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Date: Mon, 2 Oct 2023 18:29:33 -0700 Subject: [PATCH] 1.2.2 logs and documentation (#38) * Accept a list of server in the BPMN list * Documentation * Change image to ghcr.io/camunda-community-hub/process-execution-automator:latest --- README.md | 6 +- doc/applicationreference/README.md | 43 ++- doc/docker/README.md | 4 +- doc/flowscenario/README.md | 23 -- doc/kubernetes/README.md | 2 +- doc/loadtestscenario/README.md | 277 ++++++++++++++++-- doc/loadtestscenario/Tutorial.md | 8 +- doc/loadtestscenario/ku-c8CrawlUrl.yaml | 2 +- .../resources/C8CrawlUrl.bpmn | 13 +- .../test_1/test-1-c8CrawlUrlMultiple.yaml | 16 +- .../test_2/test-2-c8CrawlUrlMultiple.yaml | 16 +- .../test_3/test-3-c8CrawlUrlMultiple.yaml | 16 +- .../test_4/test-4-c8CrawlUrlMultiple.yaml | 16 +- doc/scenarioreference/README.md | 8 +- .../README.md | 26 +- .../docker-compose-automator.yaml | 4 +- k8s/README.md | 4 +- k8s/pa-verification.yaml | 20 +- k8s/processautomator.yaml | 2 +- pom.xml | 4 +- .../org/camunda/automator/AutomatorAPI.java | 9 +- .../org/camunda/automator/AutomatorCLI.java | 95 +++--- .../automator/bpmnengine/BpmnEngine.java | 10 +- .../BpmnEngineConfigurationInstance.java | 48 +-- .../bpmnengine/BpmnEngineFactory.java | 9 +- .../camunda7/BpmnEngineCamunda7.java | 13 +- .../camunda8/BpmnEngineCamunda8.java | 29 +- .../bpmnengine/dummy/BpmnEngineDummy.java | 14 +- ...tionBpmEngine.java => BpmnEngineList.java} | 138 ++++++--- .../ConfigurationServersEngine.java | 44 ++- .../automator/definition/Scenario.java | 6 +- .../definition/ScenarioDeployment.java | 4 +- .../automator/engine/RunParameters.java | 8 +- .../camunda/automator/engine/RunResult.java | 4 +- .../camunda/automator/engine/RunScenario.java | 12 +- .../automator/engine/SchedulerExecution.java | 4 +- .../flow/RunScenarioFlowServiceTask.java | 6 +- .../flow/RunScenarioFlowStartEvent.java | 4 +- .../engine/flow/RunScenarioWarmingUp.java | 4 +- .../engine/unit/RunScenarioUnit.java | 10 +- .../engine/unit/RunScenarioVerification.java | 2 +- .../automator/services/AutomatorStartup.java | 16 +- src/main/resources/application.yaml | 19 +- .../java/automatorapi/TestSimpleUserTask.java | 5 +- 44 files changed, 663 insertions(+), 360 deletions(-) delete mode 100644 doc/flowscenario/README.md rename doc/{unitscenario => unittestscenario}/README.md (73%) rename src/main/java/org/camunda/automator/configuration/{ConfigurationBpmEngine.java => BpmnEngineList.java} (65%) diff --git a/README.md b/README.md index f6092f1..0e6d8ad 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ The unit scenario describes one process instance execution. Creation and user ta This functionality is used to run regression tests, coverage tests, or just advance process instances in the process for the development. -Visit (Unit Scenario)[doc/unitscenario/README.md] +Visit [Unit Scenario](doc/unitscenario/README.md) ### Load test (flowscenario) @@ -89,12 +89,12 @@ The flow scenario has a duration and objective to verify. You can specify objectives: produce 1000 Process Instances, end 500 process instances, and produce 300 tasks in a user task. -Visit (Load Test Scenario)[doc/loadtestscenario/README.md] and the (Load test Tutorial) [doc/loadtestscenario/Tutorial.md] +Visit [Load Test Scenario](doc/loadtestscenario/README.md) and the [Load test Tutorial](doc/loadtestscenario/Tutorial.md) ## Scenario This section references all the information to build a scenario. -Visit (Scenario reference)[doc/scenarioreference/README.md] +Visit [Scenario reference](doc/scenarioreference/README.md) ## Connect to a server diff --git a/doc/applicationreference/README.md b/doc/applicationreference/README.md index 8edee71..30520b3 100644 --- a/doc/applicationreference/README.md +++ b/doc/applicationreference/README.md @@ -1,9 +1,9 @@ # Application reference -This document gives the different parameter to use the application +This document gives the different parameters to use the application. -These parameters can be used in a the propertie file (YAML, PROPERTIE) or as a parameter -in the docker/kubernetes file. +These parameters can be used in the properties file (YAML, PROPERTIES) or as a parameter +in the docker/Kubernetes file. For example, for a variable `automator.startup.scenarioPath`, you can define this like @@ -26,7 +26,7 @@ env: ## general -This section is dedicated to get main information +This section is dedicated to getting the primary information. | Parameter | Explanation | Type | Default | |---------------------|----------------------------------|----------|---------| @@ -36,15 +36,15 @@ This section is dedicated to get main information ## Startup -These variable pilot the application at startup. +These variables pilot the application at startup. -The policy Execution give action to execute at the startup: -* DEPLOYPROCESS: scenario presents in the scenario are deployed. They must be accessible in the scenarioPath. -This scenario path must be accessible by the image: using a PVC or a ConfigMap (See the Kubernetes part) -* WARMINGUP: If the scenario declare a warming, this phase is executed -* CREATION: if the scenario declare a process instance creation, this phase is executed -* SERVICETASK: if the scenario declare service simulation task, they are executed. If a `filterService` is declared, only service matching the filter are executed -* USERTASK: If the scenario declare user task, they are executed. +The policy Execution gives action to execute at the startup: +* DEPLOYPROCESS: The scenario presented in the scenario is deployed. They must be accessible in the scenarioPath. + This scenario path must be accessible by the image using a PVC or a ConfigMap (See the Kubernetes part) +* WARMINGUP: If the scenario declares a warming, this phase is executed +* CREATION: if the scenario declares a process instance creation, this phase is executed +* SERVICETASK: if the scenario declares service simulation task, they are executed. If a `filterService` is declared, only services matching the filter are executed +* USERTASK: If the scenario declares user task, they are executed. | Parameter | Explanation | Type | Default | |---------------------------------------------|-------------------------------------------------------------------------------------------|--------|---------| @@ -57,11 +57,11 @@ This scenario path must be accessible by the image: using a PVC or a ConfigMap ( ### Load scenario from file -A scenarioPath and a multiple scenarioFile are given, and are loaded from this part. +A scenarioPath and a multiple scenarioFile are given and are loaded from this part. ### Load scenario from resource Passing the scenario file to a running container is more challenging. -Check the (Kubernetes manual)[doc/kubernetes/README.md] to see in detail. +In detail, check the (Kubernetes manual)[doc/kubernetes/README.md]. The idea is: * to load the scenario in a config map @@ -73,11 +73,10 @@ The idea is: ## Servers -This section declared a list of servers. Each server has a name. In scenario, server are using: scenario declare the -scenario must be executed on the server "Diamond". +This section declared a list of servers. Each server has a name. In a scenario, servers are using: it must be executed on the server "Diamond". This section declared how to connect the server "Diamond": is that a Camunda7 server or Camunda 8? What are the properties to connect to the server? -There is two ways to declare a list of server: +There ed is two ways to declare a list of server: a ServerString Connection. This is a list of ,CAMUNDA_7|CAMUNDA_8,()* @@ -87,21 +86,21 @@ For Camunda 7: ,CAMUNDA_7, ``` -For Camunda 8 Self manage +For Camunda 8 to Self-manage ``` -,CAMUNDA_8,ZeebeGatewayAddress,OperateUserName,OperateUserPassword,OperateUrl +,CAMUNDA_8,ZeebeGatewayAddress,OperateUserName,OperateUserPassword,OperateUrl,ExecutionThreads,MaxJobActive; ``` For Camunda 8 Saas: ``` -,CAMUNDA_8_SAAS,zeebeCloudRegister,zeebeCloudRegion,zeebeCloudClusterId,zeebeCloudClientId,clientSecret,OperateUserName,OperateUserPassword,OperateUrl +,CAMUNDA_8_SAAS,zeebeCloudRegister,zeebeCloudRegion,zeebeCloudClusterId,zeebeCloudClientId,clientSecret,OperateUserName,OperateUserPassword,OperateUrl,ExecutionThreads,MaxJobActive ``` -# other way to provide the list of server connection -In the YAML, the list of server can by giving +# Another way to provide the list of server connection +In the YAML, the list of servers can be done by giving ``` automator.servers: diff --git a/doc/docker/README.md b/doc/docker/README.md index cd95bdc..3ed6ab7 100644 --- a/doc/docker/README.md +++ b/doc/docker/README.md @@ -4,7 +4,7 @@ ## Manual ```` -> docker build -t pierreyvesmonnet/processautomator:1.0.0 . +> docker build -t myGithubID/processautomator:1.0.0 . -> docker push pierreyvesmonnet/processautomator:1.0.0 +> docker push myGithubID/processautomator:1.0.0 ```` diff --git a/doc/flowscenario/README.md b/doc/flowscenario/README.md deleted file mode 100644 index 2ba7b71..0000000 --- a/doc/flowscenario/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Flow Scenario -This section explain how to create a scenario to load a process. - - -## Goal -There is three goals: -* Create a lot of process instances, and see how your platform react. Does it handle the load? -* Generate a lot of process instances in one particular part of your process -* Generate a process instances and advance it at a specific part of the process - -The last operation is very usefull for a developper. -He wants to work on a particular task, but to arrive at this task, he has to execute user task or other service task. -And some other service task are not developped, so he needs to simulate the execution. - - -## Scenario definition - -Let use an example - - -ToDo - -## execute \ No newline at end of file diff --git a/doc/kubernetes/README.md b/doc/kubernetes/README.md index c62e071..3b98a9a 100644 --- a/doc/kubernetes/README.md +++ b/doc/kubernetes/README.md @@ -29,7 +29,7 @@ spec: spec: containers: - name: camunda-8-processautomator-service - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/doc/loadtestscenario/README.md b/doc/loadtestscenario/README.md index d996f69..928a963 100644 --- a/doc/loadtestscenario/README.md +++ b/doc/loadtestscenario/README.md @@ -1,36 +1,279 @@ # Load Test scenario -A load test scenario is different from a unit test. In a load test, the goal is to mimic the production: +A load test scenario is different from a unit test. -* in term on process instance creation -* in term of service task, using the real service task or simulate it +In a load test, the goal is to mimic the production: -A load test scenario will set up an environment, and run it for a delay (like 30 mn) and check -throuput objectives. This is for example a load test scenario +* in terms of process instance creation +* in terms of service tasks, using the actual service task or simulating it + +A load test scenario will set up an environment, run it for a delay (30 mn), and check through +objectives. This is, for example, a load test scenario. * Create 10 process instances par minutes in the process "Loan application" -* simulate the service task "GetCreditScore": each execution needs 2 minutes to complete. -Run 2 workers on this service task, and for each worker, 10 threads. -The worker will return in 80% a credit score lower than 500. -* Check the objective that 10 process instances can be completed every minutes +* simulate the service task "GetCreditScore": each execution needs 2 minutes. Run 2 workers on this + service task, and for each worker, 10 threads. The worker will return for 80% a credit score lower + than 500. +* Check the Objective that 10 process instances can be completed every minute -* Because the GetCreditScore is a 2 minutes execution, on the first two minutes, the throuput will be 0 -(no process instance will be completed), so a warmup of 3 minutes is necessary before monitoring -the objective +* Because the GetCreditScore is a 2-minute execution, on the first two minutes, the throughput will + be 0 + (no process instance will be completed), so a warmup of 3 minutes is necessary before monitoring + the Objective -Process Automator execute processes on a platform. Some services may be available on the platform, so -it is needed to simulate only the missing piece. On the opposite, if all services are available, the -scenario will just creates process instances and check objectives. +Process Automator executes processes on a platform. Some services may be available on the platform, +so it is needed to simulate only the missing piece. Conversely, if all services are available, the +scenario will just create process instances and check objectives. ## Tutorial -A complete example to run a scenario, and change the Zeebe Parameters to reach the expecting delay is -available in the (Tutorial)[Tutorial.md] + +A complete example of running a scenario and changing the Zeebe Parameters to reach the expected +delay is available in the (Tutorial)[Tutorial.md] ## Create process instance +A load test scenario creates process instances at a frequency. The goal is not to create one process +instance and to follow how it runs but to create multiple process instances. For example, 5 process +instances every 20 seconds. Or 100 process instances every second. + +It is possible to create process instances with different values: for example, 5 process instances +every 10 seconds with amount=100, and 6 process instances every 12 seconds with amount=150. + +The application uses the Spring Boot Scheduler function. So, at the frequency, it starts to create +process instances. If it doesn't finish the number of process instances at the end of the frequency, +it will not start a new thread; it will spend time creating the requester number. But then, waiting +to create the next batch is not delayed. + +To face a large number of creations, it is possible to start multiple threads at the same frequency. +Then, the number of process instances created is the * 2000" + }, + { + "label": "Ended", + "processId": "CrawlUrl", + "type": "ENDED", + "value": 4000, + "comment": "Same as creation" + }, + { + "label": "Ended (UserTask TheEnd) Verification", + "processId": "DiscoveryHostExtraction", + "type": "USERTASK", + "taskId": "Activity_HostExtraction_TheEnd", + "value": 150 + }, + { + "label": "Flow per minute", + "processId": "DiscoveryHostExtraction", + "type": "FLOWRATEUSERTASKMN", + "taskId": "Activity_HostExtraction_TheEnd", + "standardDeviation": 10, + "value": 15 + } + + ] +} +``` + +## Warmup + +A process can start with a 2-minute service task, followed by a 5-minute service task. + +To check the objective, the process must be warmup: in that situation, process instances must be +created, and it must wait 5 minutes to start to check the Objective. Otherwise, on a 10-minute test, +process instances ended will show up only after 7 minutes and are not representative. + +The warmup phase reacts as the expected behavior and will finish after a duration or when a +condition is met (mainly, one process instance ends or shows up in a user task). + +Objective records (rate, number of process instances available in a user task) starts after the +warmup. The duration begins after the warmup, too. + + +| Argument | Explanation | Default value | +|-----------------|---------------------------------------------------------|---------------| +| duration | maximum duration for the warming up. May finish before. | | +| useServiceTasks | All Service Tasks declared in the Flow are started | false | +| useUserTasks | All User Tasks declared in the Flow are started | false | +| operations | List of operations | | + +Operations contain elements to run during the warm-up. It may contain some operations like USERTASK, SERVICETASK, or STARTEVENT. + +To not duplicate USERTASK and SERVICETASK, the flag `useServiceTask` and/or `useUserTasks` can be set to true. + +On the operation, an endWarmingUp argument can be declared. This argument specifies a function. +When the function returns true, the operation is marked as "warm up" but continues to process. +When all operations are marked "Warm up" or the duration is over, the warm-up is finished, and the +load test start + +On operation, see the [scenario reference](doc/scenarioreference/README.md) for details on arguments + +The new argument is + +| Argument | Explanation | Default value | +|---------------|--------------------------------------------------------|---------------| +| endWarmingUp | Function to check if the operation is marked as ended | | + + +the [Scenario manual](doc/scenarioreference/README.md) for the list of all functions. \ No newline at end of file diff --git a/doc/loadtestscenario/Tutorial.md b/doc/loadtestscenario/Tutorial.md index 2dc997e..47de94d 100644 --- a/doc/loadtestscenario/Tutorial.md +++ b/doc/loadtestscenario/Tutorial.md @@ -141,7 +141,7 @@ Then, one service task simulator per service task and one for the user task. "modeExecution": "ASYNCHRONOUS" }, { - "type": "USER TASK", + "type": "USERTASK", "taskId": "Activity_Verify", "waitingTime": "PT10S", "modeExecution": "ASYNCHRONOUS", @@ -251,7 +251,7 @@ The main point is to provide the scenario to the pod. 1. Create a config map for the scenario ```` -doc/loadtestscenario/ +cd doc/loadtestscenario/ kubectl create configmap crawurlscnmap --from-file=resources/C8CrawlUrlScn.json ```` @@ -292,9 +292,9 @@ An alternative consists of placing the scenario under `src/resources/` and build Build the docker image via the build command. Replace `pierreyvesmonnet` with your docker user ID, ```` -docker build -t pierreyvesmonnet/processautomator:1.0.0 . +docker build -t myGithubID/processautomator:1.0.0 . -docker push pierreyvesmonnet/processautomator:1.0.0 +docker push myGithubID/processautomator:1.0.0 ```` diff --git a/doc/loadtestscenario/ku-c8CrawlUrl.yaml b/doc/loadtestscenario/ku-c8CrawlUrl.yaml index 7f8beb8..f926a9f 100644 --- a/doc/loadtestscenario/ku-c8CrawlUrl.yaml +++ b/doc/loadtestscenario/ku-c8CrawlUrl.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: ku-processautomator - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/doc/loadtestscenario/resources/C8CrawlUrl.bpmn b/doc/loadtestscenario/resources/C8CrawlUrl.bpmn index 93581d8..78ed496 100644 --- a/doc/loadtestscenario/resources/C8CrawlUrl.bpmn +++ b/doc/loadtestscenario/resources/C8CrawlUrl.bpmn @@ -1,6 +1,11 @@ - - + + + + + + + @@ -158,7 +163,7 @@ - + @@ -442,4 +447,4 @@ - + \ No newline at end of file diff --git a/doc/loadtestscenario/test_1/test-1-c8CrawlUrlMultiple.yaml b/doc/loadtestscenario/test_1/test-1-c8CrawlUrlMultiple.yaml index 7b9b584..9d33b51 100644 --- a/doc/loadtestscenario/test_1/test-1-c8CrawlUrlMultiple.yaml +++ b/doc/loadtestscenario/test_1/test-1-c8CrawlUrlMultiple.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: ku-processautomator-creation - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -73,7 +73,7 @@ spec: spec: containers: - name: ku-processautomator-retrievework - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -127,7 +127,7 @@ spec: spec: containers: - name: ku-processautomator-search - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -181,7 +181,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -236,7 +236,7 @@ spec: spec: containers: - name: ku-processautomator-verify - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -289,7 +289,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -343,7 +343,7 @@ spec: spec: containers: - name: ku-processautomator-filter - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -397,7 +397,7 @@ spec: spec: containers: - name: ku-processautomator-store - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/doc/loadtestscenario/test_2/test-2-c8CrawlUrlMultiple.yaml b/doc/loadtestscenario/test_2/test-2-c8CrawlUrlMultiple.yaml index 837dd4c..29397bf 100644 --- a/doc/loadtestscenario/test_2/test-2-c8CrawlUrlMultiple.yaml +++ b/doc/loadtestscenario/test_2/test-2-c8CrawlUrlMultiple.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: ku-processautomator-creation - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -74,7 +74,7 @@ spec: spec: containers: - name: ku-processautomator-retrievework - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -129,7 +129,7 @@ spec: spec: containers: - name: ku-processautomator-search - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -184,7 +184,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -240,7 +240,7 @@ spec: spec: containers: - name: ku-processautomator-verify - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -294,7 +294,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -350,7 +350,7 @@ spec: spec: containers: - name: ku-processautomator-filter - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -405,7 +405,7 @@ spec: spec: containers: - name: ku-processautomator-store - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/doc/loadtestscenario/test_3/test-3-c8CrawlUrlMultiple.yaml b/doc/loadtestscenario/test_3/test-3-c8CrawlUrlMultiple.yaml index 95dcdeb..13c69f3 100644 --- a/doc/loadtestscenario/test_3/test-3-c8CrawlUrlMultiple.yaml +++ b/doc/loadtestscenario/test_3/test-3-c8CrawlUrlMultiple.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: ku-processautomator-creation - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -74,7 +74,7 @@ spec: spec: containers: - name: ku-processautomator-retrievework - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -129,7 +129,7 @@ spec: spec: containers: - name: ku-processautomator-search - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -184,7 +184,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -239,7 +239,7 @@ spec: spec: containers: - name: ku-processautomator-verify - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -293,7 +293,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -348,7 +348,7 @@ spec: spec: containers: - name: ku-processautomator-filter - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -403,7 +403,7 @@ spec: spec: containers: - name: ku-processautomator-store - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/doc/loadtestscenario/test_4/test-4-c8CrawlUrlMultiple.yaml b/doc/loadtestscenario/test_4/test-4-c8CrawlUrlMultiple.yaml index 60dd5b7..65391d7 100644 --- a/doc/loadtestscenario/test_4/test-4-c8CrawlUrlMultiple.yaml +++ b/doc/loadtestscenario/test_4/test-4-c8CrawlUrlMultiple.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: ku-processautomator-creation - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -74,7 +74,7 @@ spec: spec: containers: - name: ku-processautomator-retrievework - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -129,7 +129,7 @@ spec: spec: containers: - name: ku-processautomator-search - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -184,7 +184,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -239,7 +239,7 @@ spec: spec: containers: - name: ku-processautomator-verify - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -293,7 +293,7 @@ spec: spec: containers: - name: ku-processautomator-message - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -348,7 +348,7 @@ spec: spec: containers: - name: ku-processautomator-filter - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -403,7 +403,7 @@ spec: spec: containers: - name: ku-processautomator-store - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/doc/scenarioreference/README.md b/doc/scenarioreference/README.md index 34dc5a0..d693510 100644 --- a/doc/scenarioreference/README.md +++ b/doc/scenarioreference/README.md @@ -30,7 +30,7 @@ It is possible to execute a multi-instance and give different values for each ex ## External operation -A scenario may consist of executing some task and then sending a Cancellation message or starting a +A scenario may consist of executing some tasks and then sending a Cancellation message or starting a process instance in a different process to get a Cancellation message. It is possible to describe this operation in a step. @@ -114,7 +114,7 @@ this operation in a step. | Name | Name of execution | "name": "This is the first run" | | policy | "STOPATFIRSTERROR" or "CONTINUE": In case of an error, what is the next move. Default is STOPATFIRSTERROR | "policy": "STOPATFIRSTERROR" | | numberProcessInstances | Number of process instances to create. Each process instance follows steps. | "numberProcessInstances": 45 | -| Number of threads | Number of threads to execute in parallel. Default is 1. | "numberOfThreads": 5 | +| Number of threads | Number of threads to execute in parallel. Default is 1. | "numberOfThreads": 5 | | execution | If false, the execution does not start. If not present, the default value is TRUE. | "execution" : false | Then, the execution contains a list of steps. @@ -255,7 +255,7 @@ Decide when the warmup can finish. If a duration is set and the properties are t The parameter is an expression. Possible functions are: -* UserTaskThreashold +**UserTaskThreshold** A task appears in a user task. The expression gives the Number of tasks expected to be true. Syntax: UserTaskThreshold( < ActivityId >,< Value >) @@ -265,7 +265,7 @@ Example: UserTaskThreshold(Activity_DiscoverySeedExtraction_TheEnd,7) ```` -* EndEventThreshold +**EndEventThreshold** If an end event is detected after the instant the scenario starts, then the warmup is ended. Syntax: EndEventThreshold(< ActivityId >,< Value >) diff --git a/doc/unitscenario/README.md b/doc/unittestscenario/README.md similarity index 73% rename from doc/unitscenario/README.md rename to doc/unittestscenario/README.md index 5db55ba..9adc0a7 100644 --- a/doc/unitscenario/README.md +++ b/doc/unittestscenario/README.md @@ -1,12 +1,22 @@ # Unit Scenario ## Goal +Verify a process reacts as expected. +There is multiple use case: +* When a process instance is created with the variable "amount=120", it follows the activity "getScore", and then "Review" +* Verify that the performance is still the same and a service task stays under 300 ms to be executed -### Verification +* Execute automatically multiple scenario to cover all the process. -![Process](doc/explanationProcess.png) +* As a developer, you want to debug a service task in the process; You need to create a process instance and "advance it" in the process until you reach the activity + + + +### Verification (path and performance) + +![Process](../explanationProcess.png) in a CD/CI, you want to verify that a process follows the same behavior in the same performance time. Running every day (or hours) or asking via an API call to replay a scenario is useful to @@ -34,15 +44,21 @@ advance the process instance where you want it. # Build a Scenario - +In progress + + +## Scenario definition + +## Generate from a real execution Automator can generate a scenario from a real execution. The user creates a process instance and executes it. It executes user tasks until the end of the process instance or at a certain point. Via the UI (or the API), the user gives the process instance. Automator queries Camunda Engine to collect the history of the process and, for each user task, which variable was provided. A new scenario is created from this example. +Note: this function is yet available -## Scenario definition +## execute -## execute \ No newline at end of file +In progress diff --git a/docker-processautomator/docker-compose-automator.yaml b/docker-processautomator/docker-compose-automator.yaml index b9d9924..04eb9a7 100644 --- a/docker-processautomator/docker-compose-automator.yaml +++ b/docker-processautomator/docker-compose-automator.yaml @@ -2,7 +2,7 @@ version: "3" services: processautomatorDiscovery: - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest container_name: processautomatorDiscovery ports: - "8380:8380" @@ -33,7 +33,7 @@ services: - operate processautomatorVerification: - image: pierreyvesmonnet/processautomator:1.0.0 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest container_name: processautomatorVerification ports: - "8381:8380" diff --git a/k8s/README.md b/k8s/README.md index 7ecec71..acdea65 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -4,9 +4,9 @@ at root, use ````yaml -docker build -t pierreyvesmonnet/processautomator:1.0.0 . +docker build -t myGithubId/processautomator:1.0.0 . -docker push pierreyvesmonnet/processautomator:1.0.0 +docker push myGithubId/processautomator:1.0.0 ```` Or use the image generated on camunda-hub diff --git a/k8s/pa-verification.yaml b/k8s/pa-verification.yaml index 90f6a9c..377debd 100644 --- a/k8s/pa-verification.yaml +++ b/k8s/pa-verification.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: pa-verification-creation - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -66,7 +66,7 @@ spec: spec: containers: - name: pa-verification-retrieve - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -113,7 +113,7 @@ spec: spec: containers: - name: pa-verification-checkurl - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -160,7 +160,7 @@ spec: spec: containers: - name: pa-verification-updateitem - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -207,7 +207,7 @@ spec: spec: containers: - name: pa-verification-download - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -254,7 +254,7 @@ spec: spec: containers: - name: pa-verification-fingerprint - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -301,7 +301,7 @@ spec: spec: containers: - name: pa-verification-getresult - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -348,7 +348,7 @@ spec: spec: containers: - name: pa-verification-obtaindescription - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -395,7 +395,7 @@ spec: spec: containers: - name: pa-verification-thresoldcheck - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS @@ -444,7 +444,7 @@ spec: spec: containers: - name: pa-verification-createpotentialclaim - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/k8s/processautomator.yaml b/k8s/processautomator.yaml index 05b6e79..ca8c3e0 100644 --- a/k8s/processautomator.yaml +++ b/k8s/processautomator.yaml @@ -20,7 +20,7 @@ spec: spec: containers: - name: camunda-8-processautomator-service - image: pierreyvesmonnet/processautomator:1.0.3 + image: ghcr.io/camunda-community-hub/process-execution-automator:latest imagePullPolicy: Always env: - name: JAVA_TOOL_OPTIONS diff --git a/pom.xml b/pom.xml index 81a1cd1..fcb6b90 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.camunda.community.automator process-execution-automator - 1.2.1-SNAPSHOT + 1.2.2 17 @@ -17,7 +17,7 @@ 5.9.1 2.0.3 - 3.1.3 + 3.1.4 diff --git a/src/main/java/org/camunda/automator/AutomatorAPI.java b/src/main/java/org/camunda/automator/AutomatorAPI.java index d02edd0..8f7fbe9 100644 --- a/src/main/java/org/camunda/automator/AutomatorAPI.java +++ b/src/main/java/org/camunda/automator/AutomatorAPI.java @@ -8,7 +8,7 @@ import org.camunda.automator.bpmnengine.BpmnEngine; import org.camunda.automator.bpmnengine.BpmnEngineFactory; -import org.camunda.automator.configuration.ConfigurationBpmEngine; +import org.camunda.automator.configuration.BpmnEngineList; import org.camunda.automator.definition.Scenario; import org.camunda.automator.engine.AutomatorException; import org.camunda.automator.engine.RunParameters; @@ -72,7 +72,7 @@ public Scenario loadFromInputStream(InputStream scenarioInputStream, String orig * @param engineConfiguration different engine configuration * @return the engine, null if no engine exist, an exception if the connection is not possible */ - public BpmnEngine getBpmnEngineFromScenario(Scenario scenario, ConfigurationBpmEngine engineConfiguration) + public BpmnEngine getBpmnEngineFromScenario(Scenario scenario, BpmnEngineList engineConfiguration) throws AutomatorException { try { @@ -124,9 +124,8 @@ public RunResult executeScenario(BpmnEngine bpmnEngine, RunParameters runParamet /* Deploy a process in the server */ /* ******************************************************************** */ - public BpmnEngine getBpmnEngine(ConfigurationBpmEngine engineConfiguration, - ConfigurationBpmEngine.BpmnServerDefinition serverDefinition) - throws AutomatorException { + public BpmnEngine getBpmnEngine(BpmnEngineList engineConfiguration, + BpmnEngineList.BpmnServerDefinition serverDefinition) throws AutomatorException { return BpmnEngineFactory.getInstance().getEngineFromConfiguration(engineConfiguration, serverDefinition); } diff --git a/src/main/java/org/camunda/automator/AutomatorCLI.java b/src/main/java/org/camunda/automator/AutomatorCLI.java index a2859f1..33fccb6 100644 --- a/src/main/java/org/camunda/automator/AutomatorCLI.java +++ b/src/main/java/org/camunda/automator/AutomatorCLI.java @@ -1,8 +1,9 @@ package org.camunda.automator; import org.camunda.automator.bpmnengine.BpmnEngine; -import org.camunda.automator.configuration.ConfigurationBpmEngine; +import org.camunda.automator.configuration.BpmnEngineList; import org.camunda.automator.definition.Scenario; +import org.camunda.automator.engine.AutomatorException; import org.camunda.automator.engine.RunParameters; import org.camunda.automator.engine.RunResult; import org.slf4j.Logger; @@ -27,7 +28,7 @@ public class AutomatorCLI implements CommandLineRunner { @Autowired AutomatorAPI automatorAPI; @Autowired - ConfigurationBpmEngine engineConfiguration; + BpmnEngineList engineConfiguration; public static void main(String[] args) { isRunningCLI = true; @@ -59,37 +60,37 @@ public static void main(String[] args) { /* ******************************************************************** */ private static void printUsage() { - System.out.println("Usage: