Skip to main content

Framework to create containers for DataCybernetic's PineXQ computing platform

Project description

PineXQ ProCon Framework

Computations in DC-Cloud are done by Workers running inside a ProcessingContainer, or short "ProCon", which is also the name of the framework. ProCon provides an unobtrusive wrapper around function definitions without introducing new semantics, allowing for a clean definition of the computational task, while handling all cloud-related communication and data-management transparently in the background. This removes the code and configuration required from the function implementation.

Installation

To install the package use the pip command, to either install from a package feed:

pip install pinexq-procon

Creating a container

To publish a function in a container it has to be a method of a class inheriting from the Step class.

from pinexq.procon.step import Step # import package

class MyStepCollection(Step):  # define the container class
    def calculate_square(self, x: float) -> float:  # define a step function
        """Calculate the square of x

        :param x: a float number
        :returns: the square of x
        """
        return x ** 2

    # More step functions can go in the same class    

if __name__ == '__main__':  # add script guard
    MyStepCollection()  # run the container - this will spawn the cli

It is mandatory to annotate the types of parameters and return value. Docstrings are optional, but highly recommended.

The documentation has a detailed section about implementing processing-steps.

Running a Step-function locally

The Python file with the container is itself a cli-tool. You get a list of all available commands with the --help parameter.

python ./my_step_file.py --help

With the run option you can call a function in the container directly and the result is written to the console.

python ./my_step_file.py run --function calculate_square --parameters "{'x': 5}"
25

You can find full list of available commands in the cli documentation. All possible parameters and environment variables are listed here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinexq_procon-2.7.2-py3-none-any.whl (67.2 kB view details)

Uploaded Python 3

File details

Details for the file pinexq_procon-2.7.2-py3-none-any.whl.

File metadata

  • Download URL: pinexq_procon-2.7.2-py3-none-any.whl
  • Upload date:
  • Size: 67.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pinexq_procon-2.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b16a12ceeb0927c6e99cdd04b745f8b64c7bacfb6ad5802c15791ca06bcb9e0
MD5 a3f05044989262c67fbe6b964880377f
BLAKE2b-256 ffe4eb0c0daaf4de05911d7812fc7f7e7bed8e2fe28d9d7cae8a630687aecc2c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page