Deploying a user task to KAPPA-Automate#

After debugging and testing your user task locally, you can publish it to KAPPA-Automate.

To do so, first navigate to the Automation section, select the User Tasks option on the left and then click the Create button.

Fill the required information on the General tab, then move to the Parameters tab, then turn on the Advanced mode option in the upper-right corner.

Copy-paste the content of your YAML file into the Initial parameters input on the left of the Parameters tab. You can also fill the Javascript input with your javascript content if you have one. Then click on validate and if you don’t see any error message, you can navigate to the Script tab.

Make sure the Scripting language selector value is Python and copy-paste your code to the window.

Click on the Validate button, it used to do a quick syntax check, but now there is still the validate button but it does nothing.

With the Package selector you can add packages to your user task. See the next section on how to deploy a package. The most common use is the built-in one, Computation and Math Libraries (Linux), which contains numpy, pandas, scipy, scikit-learn and their dependencies. If you need one of this Python packages in your user task, select this KAPPA-Automate package. You can also add a custom python package by zipping your python package and click on the + next to the Package selector and upload your zip.

Note

If you create a custom package with your user task, let’s call it “example_package” (the folder will have this name), then in your Python you must write import example_package to be able to use it. But it also means that the name of the zip or the name of the KAPPA-Automate package does not matter to run your user task, so feel free to use another name or the same name.

Once your user task definition is created, you can create some instances in your well. Navigate to the well in your field and click on the User Task button. Select your user task in the drop-down list, the inputs should be bound automatically but you also change them. Press Create button, wait few moments and navigate to the newly created user task that can now be found under your well node. Output of this user task should match the one that was created by a local execution.

See also

For more detailed information about user tasks in KAPPA-Automate, please refer to the official documentation.