Skip to main content

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

  1. 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()
  1. 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

positron_networks-0.1.10.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

positron_networks-0.1.10-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file positron_networks-0.1.10.tar.gz.

File metadata

  • Download URL: positron_networks-0.1.10.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for positron_networks-0.1.10.tar.gz
Algorithm Hash digest
SHA256 a0059949149b38175e34c99ee3aefa546edeeea6c15fcab68dc97a4b2b7ffae6
MD5 4efa37fd27f938f3054530fcb807d2b5
BLAKE2b-256 8e6ac17038773330588e914baa9904739d2b5e97d98c2a0cf47e379b165b912b

See more details on using hashes here.

File details

Details for the file positron_networks-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for positron_networks-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 45729e1b9a1eae7a0891edafc533086436d47123d43c690374de62a9b219cb72
MD5 2db50efdce708c594991f6fb65832db6
BLAKE2b-256 d1ff59ae8412e55b61ea122e2452af2f05e27660c46da055bd0a1abd31efc015

See more details on using hashes here.

Supported by

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