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:
Install git to your local computer
Install Docker Desktop
Ensure that Docker Desktop is running on your local machine
Modify the config.json file with your organization name (i.e., pratexo.com)
Procedure
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.
In your Git client or terminal on your local machine navigate to the template-feature-library directory.
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
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
Respond to the following prompts
Choose option #2: Pratexo: Generate a docker-kind feature manifest
Provide a name of your feature without spaces
“_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
example. gcr.io/<path>/<name>
Enter the image version tag
example: latest or 3.2.1
Provide a port number for the program that it should listen on
example: 8181
Note: If ingresses are required otherwise this step is optional
Refer to the documentation folder of the template-feature-library repository for changes that should be made to generated files
routing.md
Ui.schema.midlayer.md
<any others>?
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
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
Feedback sent
We appreciate your effort and will try to fix the article