Skip to main content

SDK library to communicate with ComputeHorde Facilitator

Project description

compute-horde-facilitator-sdk

Installation

pip install compute-horde-facilitator-sdk

Usage

Register at https://facilitator.computehorde.io and generate an API Token.

Example:

import time

from compute_horde_facilitator_sdk.v1 import FacilitatorClient

computehorde = FacilitatorClient(
    token=...,
)

job = computehorde.create_docker_job(
        docker_image='backenddevelopersltd/gen_caption_v2',
        input_url='https://raw.githubusercontent.com/backend-developers-ltd/'
                  'ComputeHorde-examples/master/input_shapes.zip'
        # The zip file will be extracted within the Docker container to the /volume directory
)

while True:
    job = computehorde.get_job(job['uuid'])
    if job['status'] in ['Completed', 'Failed']:
        break
    time.sleep(10)

print(f'Job finished with status: {job["status"]}. Stdout is: "{job["stdout"]}",'
      f' output_url is {job["output_download_url"]}')
# During job execution, any files generated in the /output directory will be incorporated into the final job result, 
# which can be downloaded from the url printed above. Full STDOUT and STDERR will also be there.

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

compute_horde_facilitator_sdk-0.0.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file compute_horde_facilitator_sdk-0.0.3.tar.gz.

File metadata

File hashes

Hashes for compute_horde_facilitator_sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 78fa1a47314ac1c261ae3108c5c20f4d575119ab8a058ff36749b2c5aebb08d6
MD5 960d5ec8040b33e07ce725f4a8630a0a
BLAKE2b-256 b00b1c5f403cabd76350c1003f5e46a1337a4f9d12af72a78ca4386549307845

See more details on using hashes here.

File details

Details for the file compute_horde_facilitator_sdk-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for compute_horde_facilitator_sdk-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c1262361036f6d6e939911d053beab42ef7e3c75259bca3763b83017dfc712c6
MD5 cd47007925ca7fddd0871b9703f2b9de
BLAKE2b-256 d9dc429427306a23a30fba22a77e50d7553aeea5b07b9cd01785bdca7dbe0b53

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