Open
Description
It might be useful to create a Python SDK for CodaLab. This would make it easier to run jobs in a matrix, or automate repeatable tasks, or even just interact with CodaLab in general -- and it would probably work better than having to create a CLI wrapper as mentioned in #2350.
Perhaps usage of it would look something like this:
import codalab
# run a bundle
uuid = codalab.run("echo hello world")
codalab.wait(uuid)
print(codalab.cat(uuid))
# upload a file
with open("input.txt") as f:
codalab.upload(f)
# run matrix jobs and wait for all bundles to finish
uuids = []
for i in range(0, 100):
uuids.push(codalab.run("echo hello world {}".format(i)))
codalab.wait(uuids)
Other benefits of such an integration:
- This would make it really easy to call CodaLab from a Jupyter notebook -- essentially, it would be an interactive job runner at that point.
- Once the Python SDK is ready, we could in fact refactor the CLI to use the CodaLab Python SDK. This would not only reduce code duplication, but would also make our codalab tests faster / easier to create / more readable, because we could move our tests to directly use the Python SDK instead of always using the CLI (and keep just a base set of tests to test CLI integration).
- In the long run, the SDK model is good if we ever were to expand to other languages.