Run experiments on the Positron Cloud
Project description
Positron Networks
This package facilitates interacting with the Positron Supercompute infrastructure.
Installation
Install the package from PyPi:
pip install positron_networks
Positron CLI Usage
Generate a local auth configuration.
python -m positron_networks login
This will prompt you to open your browser, verify a code, and log in to the Positron Networks application using your username and password. Upon successful completion, a configuration file will be generated with your API key.
Python Decorator Usage
A Python decorator to handle deploying your code into the Positron Cloud.
Command Line Arguments
-l, --local
: Run the script on your local machine. Overwrites--positron-deploy
.--positron-deploy
: Deploy your script into Positron Cloud.--stream-stdout
: Stream the stdout from Positron Cloud back to your CLI.--debug
: Get more detailed error messages.
Example
- Define your function and apply the
@positron_sync
decorator with the necessary parameters:
from positron-networks import positron_sync
@positron_sync(
funding_group='your_funding_group_id',
image_name='your_image_name',
environment_id='your_environment_id',
workspace_dir='your_workspace_dir',
entry_point='your_entry_point_script'
)
def my_function():
print("Running my function")
if __name__ == "__main__":
my_function()
- Run your script with the desired arguments:
python your_script.py --positron-deploy --stream-stdout
Configuration
Ensure you have a configuration file located at ~/.positron/config.ini
with the following structure:
[DEFAULT]
UserAuthToken=your_user_auth_token
Detailed Error Messages
To enable detailed error messages, run your script with the --debug
flag:
python your_script.py --positron-deploy --debug
Handling Interruptions
The script handles SIGINT
(Ctrl+C) gracefully, allowing for proper cleanup and exit.
License
This project is licensed under the Apache 2 License. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file positron_networks-0.1.9.tar.gz
.
File metadata
- Download URL: positron_networks-0.1.9.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 781c376307338e2457398d413130d274a102ea89f98afdb2d2754d2b24dece67 |
|
MD5 | a50449ca50c5f8ac9d0555f128536a16 |
|
BLAKE2b-256 | 3f77303da522780e676b2eedc46bb2d63a682a727e8b81c93b7867a7e4ada208 |
File details
Details for the file positron_networks-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: positron_networks-0.1.9-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d632109915b3681fafc95a2fab5abf3b0d75ed1efe5fe9de5d0e4cf53aea2992 |
|
MD5 | 033cca6f89ccc26631588a1304258f61 |
|
BLAKE2b-256 | 3245f0d4052db62e2894cc6348bab2d6d4bb989484bbac6614638c353ab05afd |