Introduction
Abyss allows the creation of Widgets. We provide a convenient way to deploy your Widgets, make them accessible to all, and monetize their consumption. Virtually any Python project can be turned into a Widget with just a few simple steps.
Python Project Requirements
To successfully create a Widget, ensure that your Python project meets the following requirements:
- 512mb or less in total memory: Keep track of your project's memory footprint. Larger total memory support will be made available in the future.
- Python 3.10: Ensure that your Widget is compatible with Python 3.10 for your Widget to run successfully.
- 4vCPU and 4RAM: Ensure that your Widget requires no more than 4vCPU and 4RAM as this is the compute provided for each Widget. More compute will be made available in the future.
- run.py file: Your Python project must contain a
run.py
file in the root directory. This file will serve as the entry point, it will be executed at Widget run. - Package Dependencies: Include a
requirements.pip
file in the root directory listing all the Python packages required by your Python project. Similarly, for any apt packages, include arequirements.system
file with the names of the packages. - Input Handling: Your Widget will accept inputs in Python via the assignment of environment variables, for example,
information = os.environ.get('info')
, where info is the name of the environment variable. When running your Widget, values will be assigned to these environment variables usingfields.json
, which you can easily generate through the TEST FIELDS button while creating the interface for your widget. - Output Handling: Ensure that your project contains an
output
folder in the root directory. During the Widget's execution, all outputs must be generated as files in this folder, they will be passed to the user. Even if your Widget is not designed to create files, include a “receipt” or a friendly message.
Creating the Interface
When creating your Widget, you will design and build an interface for users to interact with your Widget. Abyss offers a diverse range of input field types to accommodate various data input scenarios:
- Text Field: A single-line input field for short text entries. Ideal for brief information.First name
- Text Area: A multi-line input field for longer text entries. Suitable for detailed information.Comment
- Number Field: Perfect for quantities, measurements, or any data that requires numeric input.Width
- Radio Group: A set of radio buttons where users can select only one option from a predefined list. Useful for single-choice questions.Favorite pet
- Checkbox: A versatile input, which allows users to select one or multiple options from a list. Making it suitable for both single and multiple-choice questions. such as selecting hobbies or preferences.Favorite sports
- Select: A dropdown menu where users can choose one option from a list. This is useful for selecting items from a long list without cluttering the interface.Ice cream flavor
- Date: An input field for selecting a date. Users can pick day/month/year conveniently.Event datemmddyyyy
Completing the WIDGET creation process
Activating your Widget and making it accessible to users consists of the following steps:
- Test Run: After your Widget is created, you will be expected to execute a test run of your Widget. This ensures that everything functions as intended.
- Review Process: After a successful test run, your Widget will undergo a review process within 24 hours. You will receive a notification of approval or if any further actions are required to finalize the deployment of your Widget.
Editing your Widget
If you wish to make changes to your Widget's Python project, consider this:
- Reactivation: Editing the Python project of your Widget will necessitate reactivation by executing a test run.
- Review Timeframe: Keep in mind that the review process may take up to 24 hours. Plan accordingly when making edits to your Widget.