Feature Studio - Step 2: How to add a feature

Created by Peter Norwood, Modified on Sun, 4 Jun, 2023 at 9:50 PM by Stuart Cowen

The Feature Studio uses a simple text-based wizard called Code Generator (aka “codegen”) that dynamically builds framework code and configuration files for new software features based on responses provided by the developer. If the developer is familiar with GitHub and has a containerized features plus knowledge of ports used and which other software it can connect with, a new feature can be imported into the Pratexo Studio in a matter of seconds. 

Pre-installations

Install the following tools and repositories on your local computer:

  1. Install git to your local computer

  2. Install Docker Desktop

  3. Ensure that Docker Desktop is running on your local machine

  4. Modify the config.json file with your organization name (i.e., pratexo.com)

Procedure

  1. Clone the template-feature-library repository from Github

    • git clone git@github.com:pratexo/template-feature-library.git

    • Note:  This will clone an repository that has no features, but contains the tools necessary to build a feature. Forking has been disabled on the repo so it is only necessary to clone it.

  2. In your Git client or terminal on your local machine navigate to the template-feature-library directory.

  3. Run the code generator utility with the following command: 

    • docker-compose -f pratexo/codegen/docker-compose.yaml run codegen

    • A text-base wizard will appear in the terminal

Generate a Python-based Analytics Feature

  1. Respond to the following prompts

    • Choose option #1: Pratexo: Python-based Analytics

    • A feature framework will be automatically created called toanothertopic_withsource_docker

Generate a Docker-kind Feature Manifest

  1. Respond to the following prompts

    • Choose option #2: Pratexo: Generate a docker-kind feature manifest

    • Provide a name of your feature without spaces

      1. _docker” will be appended to this name

    • Provide a version number if anything other than 1.0.0 - hit enter

    • Enter the number of the category that this feature is most likely to fit under

    • Enter the container image location and its name

      1. example.  gcr.io/<path>/<name>

    • Enter the image version tag

      1. example: latest or 3.2.1

    • Provide a port number for the program that it should listen on

      1. example: 8181

      2. Note: If ingresses are required otherwise this step is optional

  2. Refer to the documentation folder of the template-feature-library repository for changes that should be made to generated files 

    1. routing.md

    2. Ui.schema.midlayer.md

    3. <any others>?

  3. Add and commit files to the Git repository

    • git add –all

    • git commit -m “<short message describing the addition>”

    • git push


NOTE: This will synchronize the changes in the local repository with the repository in GitHub and automatically start the build and seeding process to merge it as a feature in the Pratexo Design Studio

  • Wait about 5-10 minutes for this process to complete

  • This only works in the DEV2 environment at the moment


  1. Create a new architecture or modify an existing one and use the new feature.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article