A Python client for FairCompute API
Project description
Fair Compute Python Client
Fair is a Python client for Fair Compute API. It allows to schedule jobs, monitor their status and retrieve results.
Creating Fair Account
To use FairCompute Python Client you need to have a Fair account. Please sign up at https://faircompute.com.
Launching a job
To launch a job, create a FairClient
instance and call run
method.
from fair import FairClient
client = FairClient('http://faircompute:8000', '<email>', '<password>')
client.run(image='alpine', command=['echo', 'hello fair compute'])
Developing Fair
This section is for developers of FairCompute Python client library.
Prerequisites
Create virtual environment and install requirements.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Testing
By default, testing is done against client running on localhost, so you need to start the server and at least one compute node locally. To start the server locally see https://github.com/faircompute/faircompute#running-locally.
Project is using pytest for testing. To run all tests:
pytest
To run tests against remote server, set FAIRCOMPUTE_SERVER_URL
, FAIRCOMPUTE_USER_EMAIL
and FAIRCOMPUTE_USER_PASSWORD
environment variables:
FAIRCOMPUTE_SERVER_URL=http://faircompute:8000 FAIRCOMPUTE_USER_EMAIL=<email> FAIRCOMPUTE_USER_PASSWORD=<password> pytest
Uploading to PyPI
Please follow the instructions at https://packaging.python.org/tutorials/packaging-projects/
rm -rf dist
python3 -m build
python3 -m twine upload --repository testpypi dist/*
python3 -m twine upload dist/*
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
Hashes for faircompute-0.20.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26f336f249af81cab2e3a417180c613cd88de41f40c2281212f7d2c011b27463 |
|
MD5 | aee709e4400ce0db73ea22d1952ba647 |
|
BLAKE2b-256 | e631517c6c0b4d313f9101a22f66d694a086b957ec110b74503b6137b4fec4cf |