reticle
Python 3.6+ library for submitting to AWS Batch interactively.
❯ pip install reticle
Features:
- Submit Batch jobs
Read the documentation at: reticle.readthedocs.io
End-to-end Example
The principle object for deploying jobs to AWS Batch is the Batch job definition. Every Batch job definition has a name, parameters, and some form of optional parameter validation.
from reticle.aws.batch import JobDefinition
from reticle.aws.s3 import S3Uri
class DemoJobDefinition(JobDefinition):
"""A Batch job definition for demonstrating our API.
Args:
input_object: The S3 URI to the input object.
"""
def __init__(self, input_object: S3Uri):
self.input_object = input_object
@property
def name(self) -> str:
"""Return the job definition name."""
return 'demo-job'
def validate(self) -> None:
"""Validate this parameterized job definition."""
if not self.input_object.object_exists():
raise f'S3 object does not exist: {self.input_object}'
We can now wrap the parameterized job definition in a Batch job and set a specific revision.
from reticle.aws.batch import BatchJob
definition = DemoJobDefinition(input_object='s3://bucket/object')
definition.at_revision('6')
job = BatchJob(definition)
Submitting this Batch job is easy, and introspection can be performed immediately:
response = job.submit(queue='prod')
When the job is in a RUNNING state we can access the job's Cloudwatch logs:
for log_event in job.log_stream_events():
print(log_event)
"""
LogEvent(timestamp="1543809952329", message="You have started up this demo job", ingestion_time="1543809957080")
LogEvent(timestamp="1543809955437", message="Configuration, we are loading from...", ingestion_time="1543809957080")
LogEvent(timestamp="1543809955437", message="Defaulting to approximate values", ingestion_time="1543809957080")
LogEvent(timestamp="1543809955437", message="Setting up logger, nothing to see here", ingestion_time="1543809957080")
"""
And if we must, we can cancel the job as long as we provide a reason:
job.terminate(reason='I was just testing!')
Metadata
Release files for reticle 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reticle-0.1.0.tar.gz | 5.4 kB | Without provenance | Details for reticle-0.1.0.tar.gz |
Release files / reticle-0.1.0.tar.gz
| Download URL | reticle-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3936d1d75b19b77d9ea66ebd9609ca04bbed76f4866cbd4ff98420faaa60787c
|
|
BLAKE2b-256 checksum How to use checksums |
a5b17e4935dcfd1bf5707203e074e52ef31d248744e2aa9cabc74984c18c9779
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
|
Security for reticle 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.