Name: tesseract
Owner: Oregon Health and Science University Computational Biology
Description: Python lib for remote code execution via the GA4GH TES API
Created: 2017-07-14 00:26:49.0
Updated: 2017-11-10 02:20:38.0
Pushed: 2017-11-22 22:18:28.0
Size: 65
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|---|---|
Kyle Ellrott | 2017-10-31 23:35:35.0 | 3 |
Adam Struck | 2018-01-16 21:41:06.0 | 43 |
Other Committers
User | Most Recent Commit | # Commits |
---|
tesseract is a library that enables the remote execution of python code on systems implementing the GA4GH Task Execution API.
__future__ import print_function
tesseract import Tesseract, FileStore
identity(n):
return n
say_hello(a, b):
return "hello " + identity(a) + b
FileStore("./test_store/")
Tesseract(fs, "http://localhost:8000")
th_resources(
cpu_cores=1, ram_gb=4, disk_gb=None,
docker="python:2.7", libraries=["cloudpickle"]
re = r.run(say_hello, "world", b="!")
lt = future.result()
t(result)
r.clone().with_resources(cpu_cores=4)
r2.run(say_hello, "more", b="cpus!")
f2.result()
t(r2)
If you provide a swift, s3, or gs bucket url to your FileStore
tesseract_
will attempt to automatically detect your credentials for each of these systems.
To setup your environment for this run the following commands:
gcloud auth application-default login
aws configure
source openrc.sh
If your function expects input files to be available at a given path then add:
th_input("s3://your-bucket/path/to/yourfile.txt", "/home/ubuntu/yourfile.txt")
The first argument specifies where the file is available, the second specifies where your function will expect to find the file.
If your function generates files during its run you can specify these files as shown below and tesseract will handle getting them uploaded to the designated bucket.
th_output("./relative/path/to/outputfile.txt")