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

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.

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.13.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

positron_networks-0.1.13-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: positron_networks-0.1.13.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for positron_networks-0.1.13.tar.gz
Algorithm Hash digest
SHA256 5f6b7b5fb57ba20f5be01d0a8995b0b17b53dfb212a718631a26a3a3d7a23ebe
MD5 203c9862f25431a9a73a60ae9044a68f
BLAKE2b-256 c1944f33ca97eb246dce74df8c53239b9142c660afd1954b841e625bb75c998e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for positron_networks-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 ace4eb1435df2c1d48b09257c548f29d0b5addff0ee61e941d7fe5b9ab3eacc5
MD5 96a6247bf3feb38f14ff41b367d2c8cb
BLAKE2b-256 cf6bd3eab32164c29ea4ce1aec364cd72dc5c9f031a2c1b8c90d178b9f6b038a

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