Skip to content

Customizing Docker Script Executors

Nolan Ehrstrom edited this page Apr 30, 2020 · 25 revisions

Issue: https://github.com/ProcessMaker/processmaker/issues/2887

Video: https://drive.google.com/file/d/1RTh4I8SzF8XjrFXBZJB7ZU1XOQmUGKrW/view

Deployment

  1. The following PRs must be merged

  2. Put php, lua, and node on Packagist. Republish the others.

  3. Update composer.json versions for php, lua, node after published to packagist.

  4. Remove "Temporary until packages are deployed" commands in .circleci/config.yml

On the servers after code is updated to 4.0.4:

  1. Make sure there are no files in core (except /storage) that should not be there. Some PHP files were removed in 4.0.4
  2. Make sure the data sources and saved search packages are the newest versions.
  3. Clear cache php artisan optimize:clear
  4. Core now has 3 new packages specified in composer.json: 'docker-executor-php', 'docker-executor-lua', 'docker-executor-node'
  5. Run composer install to get these new packages installed.
  6. Run the installers for each installed language. At a minimum, that will be php, lua, and node. Check if the instance has other docker-executor-* packages installed. The installer will need to get run for each installed language.
    php artisan docker-executor-php:install
    php artisan docker-executor-lua:install
    php artisan docker-executor-node:install
    php artisan docker-executor-java:install
    php artisan docker-executor-csharp:install
    php artisan docker-executor-python:install
    

Testing

  • Verify that base images were automatically built and deployed to docker hub as processmaker4/executor-{lang}

Setup

  1. Install any executors you would like on the instance with composer require processmaker/docker-executor-{lang}
  2. The install script for each language must be re-run from core, even if the language was previously installed. For example: php artisan docker-executor-php:install

Usage

In an instance of PM4, click on Admin on the top menu, then Script Executors on the side menu.

Add any docker commands to customize the executor. For example, in the PHP script executor, you can add the google api by adding the line RUN composer require google/apiclient:^2.0

Known Issues

  • C# SDK will not build. FilesApi.cs and RequestFilesApi.cs are attempting to send a List<System.IO.Stream> to ParameterToFile() which only accepts System.IO.Stream. I don't know if this is an annotation problem or a bug in openapi. SDK has been commented out in the default dockerfile for the csharp package. Issue to enable it later: https://github.com/ProcessMaker/docker-executor-csharp/issues/1
  • SDK Builder is using openapitools/openapi-generator-cli:v4.2.2 (set in ProcessMaker/BuildSdk.php). v4.2.3 is available but breaks the Java sdk. (v4.2.3 does not seem to fix the above C# issue anyway)