Custom Containerized Functions

Create custom Containerized containers to use as functions in Flow_Studio.

Add or Configure a Containerized Function

To create a containerized function:

  1. Navigate to the Automations overview page and select Containerized Functions.
  2. Click Create new Containerized Function.

  3. Fill in the configuration form:

    • Enter name for the function.
    • Click Add
      • Select Open file to upload an image from a file system.
        • Select the Container image (supported extensions .tar, .tgz, and .tar.gz) to upload from the file system and click Open
      • Select the registry to import an image from a containerized registry. 

        Uploading an image from a Docker registry or Google Drive may be solution when trying to upload a very large file and your local internet upload speed is not as fast as desired.

        Learn more from Docker about using registries.

        • Fill out the following fields:
          • Registry address
          • Image repository
          • Image tag
        • Check the box if credentials are required and enter a user name and password.
        • Click Download image.
      • Select Google Drive to import an image from Google Drive.

        If the Google Drive button is not functional, it is possible that your deployment domain needs to be known by Google for Hero Platform_. In this case, contact your customer service representative or to resolve the issue.

    • Adjust the sliding bar for CPU consumption. (by cores)

      • When a containerized function is added to a Flow, before starting the Flow requests usage of the number of cores set in the containerized function configuration. If the number of cores set in the containerized function(s) configuration exceeds the number of cores available on the Hero Platform_ instance, the Flow will not start.

      • Lowering the CPU usage slows down containerized container execution.

    • Adjust the sliding bar for memory (RAM) allocation for the function.
      • 10 GB maximum. 
    • Enter the container port number.
    • Enter the initial delay value in seconds for amount of time to between when container starts and when the Flow begins to use it.
      • The setting helps prevent containers from failing/timing out when additional time is needed to load the function application within the container.
    • Advanced Settings
      • Enter the max retry attempts before failing.
      • Enter the timeout setting (in seconds).
      • Select the API version used to create the containerized image.

        • v1 API has been deprecated but older customer containerized functions are still supported by Hero Platform_.
        • v2 API gives Hero Platform_ users the ability to create multiple output fields from a single input field. 
    • Click Add field to enter an input field name(s) and assign it a data type. 
    • Click Add field to enter an output field name(s) and assign it a data type. 

      The containerized function must include the Input variable names/data types it expects to process and the Output variable names/data types it will return. These Input and Output variable names/data types need to be in accordance with the request and response Fields used in your containerized image and are required when adding a containerized function in Hero Platform_.

    • Click OK to save the custom containerized function.

Binary Data Support

Developers of containerized functions can use binary data as Input and as Output fields.

  • Containerized functions can read/write files from folders that Hero Platform_ has permission to access.
  • By default, the folder is: “/binary”.
  • The value of the Input/Output field in the path to the file is: “/binary/<file name>.txt”.

View Saved Containerized Function

To view a list of the containerized functions in Hero Platform_:

  1. Click the heading titled Containerized Container on the Administration home page.
  2. A list is displayed of all containerized functions saved in Hero Platform_.

Clicking the gear icon under the Settings heading allows for editing, cloning, or deleting the function. 

Delete a Containerized Image

Deleting the containerized function does not delete the uploaded containerized image.

To delete a containerized image:

  1. Click the heading titled Containerized Container on the Administration home page.
  2. Click Create new Containerized Function.
  3. Open the drop-down menu for the Containerized Image field.
  4. Click the X next to the containerized image to delete.

Use a Containerized Function in a Flow

To access a containerized function in Flow Studio:

  1. Click the add button in the Flow.
  2. Under the heading Containerized function, select the containerized function.

  3. Map Input and Output fields.
    Nested input fields are supported.
  4. Mark the execution mode:
    • Stop execution on failure:
    • Resume execution on failure:
      • On both Strict and Forgiving mode tuple that fails to process is not dropped and the Flow continues.
      • Error message (String) and Success (Boolean) fields are displayed.
        • Failed execution -  If a tuple fails, the failure error messages are returned and Success fields marked as false.
        • Successful execution - If a tuple is processed successfully,  the failure error message fields are returned as Null and Success fields are marked as true.