Manifest
Definitions
Tip
Use a manifest to send datasets to an Octue service as a question (for processing) - the service will send an output manifest back with its answer if the answer includes output datasets.
Key features
Send datasets to a service
Get an Octue service to analyse data for you as part of a larger analysis.
from octue.resources import Child
child = Child(
id="octue/wind-speed:2.1.0",
backend={"name": "GCPPubSubBackend", "project_name": "my-project"},
)
answer, question_uuid = child.ask(input_manifest=manifest)
See here for more information.
Receive datasets from a service
Access output datasets from an Octue service from the cloud when you’re ready.
manifest = answer["output_manifest"]
manifest["an_output_dataset"].files
>>> <FilterSet({<Datafile('my_file.csv')>, <Datafile('another_file.csv')>})>
Hint
Datasets in an output manifest are stored in the cloud. You’ll need to keep a reference to where they are to access them - the output manifest is this reference. You’ll need to use it straight away or save it to make use of it.
Download all datasets from a manifest
Download all or a subset of datasets from a manifest.
manifest.download()
>>> {
"my_dataset": "/path/to/dataset"
}
Note
Datasets are downloaded to a temporary directory if no paths are given.
Further information
Manifests of local datasets
You can include local datasets in your manifest if you can guarantee all services that need them can access them. A use
case for this is, for example, a supercomputer cluster running several octue
services locally that process and
transfer large amounts of data. It is much faster to store and access the required datasets locally than upload them to
the cloud and then download them again for each service (as would happen with cloud datasets).
Warning
If you want to ask a child a question that includes a manifest containing one or more local datasets, you must
include the allow_local_files
parameter. For example, if you have an
analysis object with a child called “wind_speed”:
input_manifest = Manifest(
datasets={
"my_dataset_0": "gs://my-bucket/my_dataset_0",
"my_dataset_1": "local/path/to/my_dataset_1",
}
)
answer, question_uuid = analysis.children["wind_speed"].ask(
input_values=analysis.input_values,
input_manifest=analysis.input_manifest,
allow_local_files=True,
)