Skip to main content

Positron Networks

This package facilitates interacting with the Positron Supercompute infrastructure.

Installation

Install the package from PyPi:

pip install positron_networks

Getting Started

Log in to your account

positron login

Create a python file and decorate it.

from positron_networks import positron_sync

@positron_sync(
    institution="Positron",
    funding_group='Funding group 1',
    environment = 'T4 GPU',
    image = 'pytorch-training:2.2.0-cpu-py310-ubuntu20.04-ec2',
)
def main():
    print("Running my function")

if __name__ == "__main__":
    main()

Deploy the job

python main.py --positron-deploy

Positron CLI Usage

Explore the help dialogs.

positron --help

positron run-job --help

Job Types

Generic Job

Defined in job_config.yaml as a commands block.

Example at test/cli.

Run with positron run-job

Decorator Job

Defined as a python native decorator.

Example at test/decorator/test.py.

Run with python test.py --positron-deploy

Rather than specify configuration options in the src code, you can put them in job_config.yaml.

Example at test/decorator/with_config/.

Positron Job Runner

Located at app/positron_job_runner, this get's deployed as positron-job-runner and is used in the deployed container to launch the user's project.

Testing

See test/job_runner/.

Copy .env.example to .env and follow comments to populate the vars.

Run ./run-test.sh or ./run-test.bat. This script launches a prod-like container environment and runs the latest job-runner code from source.

Configuration

Ensure you have a configuration file located at ~/.positron/config.ini with the following structure:

[DEFAULT]
userauthtoken = your_user_auth_token

Troubleshooting

OS X

Error

NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'.

Solution

Install openssl

$ brew install openssl
$ brew --prefix openssl
> /opt/homebrew/opt/openssl@3

$ export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH" \
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" \
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" \
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"

$ openssl version
> OpenSSL 3.3.1 4 Jun 2024 (Library: OpenSSL 3.3.1 4 Jun 2024)

Reinstall python with new openssl lib

# install pyenv to use to install python
brew install pyenv

# Add this to your shell config (example .bashrc)
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"

source ~/.bashrc

# Install
CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install 3.9.6
pyenv global 3.9.6

Verify openssl will be used

python -c "import ssl; print(ssl.OPENSSL_VERSION)"
> OpenSSL 3.3.1 4 Jun 2024

Release

Update version in setup.py.

Commit with message: Update version: v<version>

Tag the repo with v<version>-alpha. This will publish to test.pypi and produce an alpha env compatible package.

Tag the repo with v<version>. This will publish to pypi and produce a beta env compatible package.

Installing For Environments

# DEV
pip install --force-reinstall --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre positron-networks

# ALPHA
pip install --force-reinstall --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ positron-networks

# BETA
pip install --force-reinstall positron-networks

License

This project is licensed under the Apache 2 License. See the LICENSE file for details.

Metadata

Release files for positron-networks 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for positron-networks 0.1.14
File Size Uploaded
positron_networks-0.1.14.tar.gz 21.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for positron-networks 0.1.14
File Interpreter ABI Platform
positron_networks-0.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 46.8 kB

Release files / positron_networks-0.1.14.tar.gz

Download URL positron_networks-0.1.14.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
983befffc1a6ecafbe645c041c87c4fb5d72cfb691eed38bf9c2510e2fc55331
BLAKE2b-256 checksum
How to use checksums
d714398f2c15f164d0036fde7686a7e16f7acc308d13d702df32e9631a940232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / positron_networks-0.1.14-py3-none-any.whl

Download URL positron_networks-0.1.14-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eb99f036aab33a8413b077b8d0f123495f54e9340f100a4c49c64d0d0888e01
BLAKE2b-256 checksum
How to use checksums
bd25b0a232f4b14e309442bd22c4108e26c6edd17b0858bb66b1ac1917a84fe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page