splight-runner


Namesplight-runner JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummarySplight Runner
upload_time2025-02-19 15:06:13
maintainerNone
docs_urlNone
authorSplight Dev
requires_python<4.0,>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Splight Runner

---

The `splight-runner` package is a tool for running processes that may interact 
with the **Splight Engine** in order to report monitoring information of the 
process.

## Description

The `splight-runner` main functionality is to run different kinds of *Python* 
processes related in some way to the **Splight Engine**, for example,
*components* that were developed using the **Splight Library**. 

For this reason, the different features in the runner are for reporting the 
status of the process and centralizing logs to be accessed through the 
**Splight Engine**. So the `splight-runner` is used when the process is 
launched from the **Splight Engine**, this means that it should not be used 
during the development of the component even though the process will be
running under the `splight-runner`.

## Usage

The package has different commands that can be used. Here you can find a list
of all the commands with a short description and how to use them.

### Running Components

The first command is used for running components that use the **Splight Library**. 
The command is
```bash
splight-runner run-component <path>/main.py --component-id=<component_id>
```
This command will execute the component whose main file is called `main.py` and 
will modify some default functioning in order to report the status of the component and
send the logs of the component to the **Splight Engine**. In the next sections, you can 
find how these modifications are done by the `splight-runner`.

In order to this command work as expected some environment variables are needed. 
The following are the list of variables that should be configured before running the 
command:
```bash
SPLIGHT_ACCESS_ID=<access_id>
SPLIGHT_SECRET_KEY=<secret_key
SPLIGHT_PLATFORM_API_HOST=https://api.splight-ai.com
COMPONENT_ID=<component_id>
```
Some of the variables are pointing to the production environment, but if you are 
interested in using another environment like "integration" or maybe a local 
environment you need to modify the corresponding variable value.

It is important to mention that the `splight-runner` should be used for components that
use the **Splight Lib** and **Splight CLI** grater than version `4.0.0`. For components
with older versions we can't ensure the proper functioning.

## Structure

You may be asking what the `splight-runner` does in order to do whatever it does.
Well, that's not an easy question to respond but let's try to explain a little bit.

So far, the package has two main functionalities, sending logs and reporting status. 
With the two features we already have a lot of magic is happening, but maybe in the future
we will add some more.

`splight-runner` works as a wrapper around the process that will be executed, 
this means some configurations are done, so the process in question is executed.

For example, when the command `run-component` is used, the environment variable
`PYTHONPATH` is modified in order to include the directory where the file `sitecustomize.py`
of the `splight-runner` is located. That file is a *Python* configuration file that can 
be used to customize the behavior of Python's site module. The site module is 
responsible for setting up Python's runtime environment, including configuring 
paths, importing modules, and performing other site-specific tasks.

So, using this file we can modify the default behaviors of libraries, for example, we 
can modify the import process of modules or libraries in order to change or add
a new behavior. This way we can modify the `logging` module and intercept 
the logging process to show the logs messages and also send the logs messages
to the **Splight Engine**. Some similar implementation is used for 
reporting the component's status. 


## Development and Contributing

Since the main goal of the tool is to be used for running different kinds of 
`Python` processes, is mandatory not to interfere with the process's 
dependencies, this should be considered when adding new features for the 
`splight-runner`. This is the reason why some basic functionalities 
are implemented in the source code and not imported from a third-party 
library, for example, a command parser for the different commands was created 
in the code and no library was used like `click` or `typer`.

The package is fully dockerized, for testing new features you can use the 
docker image that can be build with 
the command
```bash
make build
```
For running the docker container the command is
```bash
make start
```
and to stop the container:
```bash
make stop
```

It is important to note that testing new features in the `splight-runner` is 
not an easy task, you may need to modify the docker-compose file in order to 
include new volumes.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "splight-runner",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Splight Dev",
    "author_email": "dev@splight-ae.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/87/993a2adc854813c51b8e7244bfbaad11d1e933b8f75f2cf25b14ca2adbcf/splight_runner-1.1.0.tar.gz",
    "platform": null,
    "description": "# Splight Runner\n\n---\n\nThe `splight-runner` package is a tool for running processes that may interact \nwith the **Splight Engine** in order to report monitoring information of the \nprocess.\n\n## Description\n\nThe `splight-runner` main functionality is to run different kinds of *Python* \nprocesses related in some way to the **Splight Engine**, for example,\n*components* that were developed using the **Splight Library**. \n\nFor this reason, the different features in the runner are for reporting the \nstatus of the process and centralizing logs to be accessed through the \n**Splight Engine**. So the `splight-runner` is used when the process is \nlaunched from the **Splight Engine**, this means that it should not be used \nduring the development of the component even though the process will be\nrunning under the `splight-runner`.\n\n## Usage\n\nThe package has different commands that can be used. Here you can find a list\nof all the commands with a short description and how to use them.\n\n### Running Components\n\nThe first command is used for running components that use the **Splight Library**. \nThe command is\n```bash\nsplight-runner run-component <path>/main.py --component-id=<component_id>\n```\nThis command will execute the component whose main file is called `main.py` and \nwill modify some default functioning in order to report the status of the component and\nsend the logs of the component to the **Splight Engine**. In the next sections, you can \nfind how these modifications are done by the `splight-runner`.\n\nIn order to this command work as expected some environment variables are needed. \nThe following are the list of variables that should be configured before running the \ncommand:\n```bash\nSPLIGHT_ACCESS_ID=<access_id>\nSPLIGHT_SECRET_KEY=<secret_key\nSPLIGHT_PLATFORM_API_HOST=https://api.splight-ai.com\nCOMPONENT_ID=<component_id>\n```\nSome of the variables are pointing to the production environment, but if you are \ninterested in using another environment like \"integration\" or maybe a local \nenvironment you need to modify the corresponding variable value.\n\nIt is important to mention that the `splight-runner` should be used for components that\nuse the **Splight Lib** and **Splight CLI** grater than version `4.0.0`. For components\nwith older versions we can't ensure the proper functioning.\n\n## Structure\n\nYou may be asking what the `splight-runner` does in order to do whatever it does.\nWell, that's not an easy question to respond but let's try to explain a little bit.\n\nSo far, the package has two main functionalities, sending logs and reporting status. \nWith the two features we already have a lot of magic is happening, but maybe in the future\nwe will add some more.\n\n`splight-runner` works as a wrapper around the process that will be executed, \nthis means some configurations are done, so the process in question is executed.\n\nFor example, when the command `run-component` is used, the environment variable\n`PYTHONPATH` is modified in order to include the directory where the file `sitecustomize.py`\nof the `splight-runner` is located. That file is a *Python* configuration file that can \nbe used to customize the behavior of Python's site module. The site module is \nresponsible for setting up Python's runtime environment, including configuring \npaths, importing modules, and performing other site-specific tasks.\n\nSo, using this file we can modify the default behaviors of libraries, for example, we \ncan modify the import process of modules or libraries in order to change or add\na new behavior. This way we can modify the `logging` module and intercept \nthe logging process to show the logs messages and also send the logs messages\nto the **Splight Engine**. Some similar implementation is used for \nreporting the component's status. \n\n\n## Development and Contributing\n\nSince the main goal of the tool is to be used for running different kinds of \n`Python` processes, is mandatory not to interfere with the process's \ndependencies, this should be considered when adding new features for the \n`splight-runner`. This is the reason why some basic functionalities \nare implemented in the source code and not imported from a third-party \nlibrary, for example, a command parser for the different commands was created \nin the code and no library was used like `click` or `typer`.\n\nThe package is fully dockerized, for testing new features you can use the \ndocker image that can be build with \nthe command\n```bash\nmake build\n```\nFor running the docker container the command is\n```bash\nmake start\n```\nand to stop the container:\n```bash\nmake stop\n```\n\nIt is important to note that testing new features in the `splight-runner` is \nnot an easy task, you may need to modify the docker-compose file in order to \ninclude new volumes.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Splight Runner",
    "version": "1.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c0decf09643004184cfe8c0e035250c8da9e7f29672b5e837ee051762437055c",
                "md5": "30458504774d491aeb1e0cbf7936d650",
                "sha256": "bea9814526c2acfd78e2f9218167130d90d4442d15dc2839a44bbc8eeec7bfff"
            },
            "downloads": -1,
            "filename": "splight_runner-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30458504774d491aeb1e0cbf7936d650",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 20807,
            "upload_time": "2025-02-19T15:06:12",
            "upload_time_iso_8601": "2025-02-19T15:06:12.198566Z",
            "url": "https://files.pythonhosted.org/packages/c0/de/cf09643004184cfe8c0e035250c8da9e7f29672b5e837ee051762437055c/splight_runner-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ca87993a2adc854813c51b8e7244bfbaad11d1e933b8f75f2cf25b14ca2adbcf",
                "md5": "244bf688bd7b96e8642fd8cfd24eab44",
                "sha256": "db814a0aa426b1700a88fcbc5b8813126baa6712518951a9f741aecef4a9b76f"
            },
            "downloads": -1,
            "filename": "splight_runner-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "244bf688bd7b96e8642fd8cfd24eab44",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 14615,
            "upload_time": "2025-02-19T15:06:13",
            "upload_time_iso_8601": "2025-02-19T15:06:13.858002Z",
            "url": "https://files.pythonhosted.org/packages/ca/87/993a2adc854813c51b8e7244bfbaad11d1e933b8f75f2cf25b14ca2adbcf/splight_runner-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-19 15:06:13",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "splight-runner"
}
        
Elapsed time: 1.95446s