Skip to content

Proof of concept for running a PHP script without Docker#8922

Open
marcoAntonioNina wants to merge 8 commits into
developfrom
task/scriptrunner
Open

Proof of concept for running a PHP script without Docker#8922
marcoAntonioNina wants to merge 8 commits into
developfrom
task/scriptrunner

Conversation

@marcoAntonioNina

Copy link
Copy Markdown
Contributor

Run script without Docker.

ci:deploy
ci:package-collections:task/scriptrunner

…ce and WorkflowManagerInterface

- Introduced ScriptModuleInterface for module exposure in PHP scripts.
- Updated ServiceTaskImplementationInterface to allow an optional timeout parameter in the run method.
- Modified WorkflowManagerInterface to include a timeout parameter in the runServiceImplementation method.
…-process

- Introduced ScriptRuntime facade for managing script execution context and module registration.
- Added InProcessPhpRunner to run PHP scripts directly within the Laravel process.
- Updated ScriptRunner to support in-process execution based on script properties.
- Enhanced WorkflowManager and Script models to accommodate new functionality, including allow_in_process property.
- Implemented bootstrap for in-process execution and improved error handling for script execution.
- Introduced ScriptExecutionContext to encapsulate per-run context for script modules.
- The class includes properties for data, configuration, user, token ID, timeout, script ID, and source.
- This addition supports the in-process execution of PHP scripts by providing necessary context information.
- Introduced CoreServiceTask class to handle the execution of allowlisted PHP scripts without Docker or the script microservice.
- Implemented validation for script configuration, including script ID and user requirements.
- Added support for both module-based and bare execution modes.
- Enhanced error handling for various execution scenarios, ensuring robust configuration checks.
- Utilized ScriptRuntime and InProcessPhpRunner for executing scripts based on the defined context.
- Enhanced ScriptController to support a new `run_in_process` property for script previews, allowing execution via an in-process PHP runner when enabled.
- Updated TestScript job to handle the new `runInProcess` parameter, enabling direct script execution without Docker.
- Introduced `shouldPreviewInProcess` method to determine if in-process execution is applicable based on script properties and request flags.
- Added comprehensive unit tests to validate in-process execution scenarios and ensure proper handling of configuration and execution context.
- Implemented new test cases for CoreServiceTask to verify in-process script execution and error handling for various conditions.
@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-6d6000ec54.engk8s.processmaker.net

@processmaker-sonarqube

Copy link
Copy Markdown

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-6d6000ec54.engk8s.processmaker.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants