Example usage
import time
from kabutopy.client import Client
# make a client instance with the base url of the kabuto service
client = Client("http://localhost:5000")
# registering a user
client.register("user", "password", "email@email.com")
# loging in with a user, the client keeps track of the cookies
client.login("user", "password")
# creating an image
# name: string
# dockerfile: raw string / open file / path to a file
# repo_url: string
# nocache: boolean
image = client.create_image("my_image", dockerfile="some file", repo_url=None, nocache=False)
# requesting the image status and image id will poll the server
# if the id is still empty, or is the status is PENDING
# it will update id, state and output if the state is SUCCESS
# it will update state, error and output if the state is FAIL
while image.status == 'PENDING':
sleep(1)
# creating a pipeline
# name: string
pipeline = client.create_pipeline("my_pipeline")
# creating a job
# command: string
# image: Image / int / string that is castable to int
# attachment: open file / path to a file (a list of these things also works when multiple files need to be uploaded)
# pipeline: Pipeline / int / string that is castable to int
job = client.create_job(command, image, attachments, pipeline)
# getting logs
# job: Job / int / string that is castable to int
# job_id: int / string that is castable to int
# you are able to get the logs trough the client
logs = client.get_job_logs(job)
# trough the job itself
# job_id: int / string that is castable to int
logs = job.get_logs()
# getting results
# job: Job / int / string that is castable to int
# trough the client
# will return None if the job has not yet started, is still running or has failed
result = client.get_job_results(job)
# trough the job itself
result = job.get_results()
Classes and Methods
Client:
register(user, password, email)
login(user, password)
create_image(name, dockerfile=None, repo_url=None, nocache=False) returns Image
create_pipeline(name) returns Pipeline
create_job(command, image, attachments, pipeline) returns Job
submit_pipeline(pipeline)
get_job_logs(job, log_id=None) returns Log
get_job_results(job, pipeline=None) returns None or ByteIO
load_image(self, eid) returns loaded Image
load_pipeline(self, eid) returns loaded Pipeline
load_job(self, eid, pipeline) returns loaded Job
Image:
classmethod:load(eid) returns loaded image
Pipeline:
submit()
classmethod:load(eid) returns loaded pipeline
Job:
get_logs(log_id=None) returns Log
get_results() returns None or ByteIO
classmethod:load(eid, pipeline) returns loaded job
Log:
readlines(raw=True) returns lines or (line_id, line) if raw is False
refresh()
Metadata
Release files for kabutopy 1.0.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 |
|---|---|---|---|---|
| kabutopy-1.0.0.tar.gz | 6.4 kB | Without provenance | Details for kabutopy-1.0.0.tar.gz |
Release files / kabutopy-1.0.0.tar.gz
| Download URL | kabutopy-1.0.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
519695f030bc57bfe5f4a6f0d7768dfb41ac81f0027d43d14264fef4854e11a4
|
|
BLAKE2b-256 checksum How to use checksums |
e58f9f8a55077cea0af18c3f2939616d35c17e460cc10a450d3f8ccdb1f7ac63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kabutopy 1.0.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.