Hi, apologies if this is covered somewhere, or I missed this in the examples in Github!
For the recipe that @dlynch is building, we will at some point need to process data either with Paraview or a VTK library/package.
Which of these would be the best way to approach this? I assume the second?
Hi @adammer, Iโm working on the document for writing Recipes and sorry that itโs taking longer than expected.
The short answer is that each command runs inside a [Docker] container and as long as you can create an image for the library you can execute it on Pollination. In your case you can use VTK or ParaViewโs Docker image. The place to set up the image is the Plugin
.
Here is the longer answer:
A Recipe is a collection of DAG
s and a DAG
is a collection of task
s. Each task
uses a Function
as a template. And each Function
is part of a Plugin
. When you execute a command - it technically getโs executed inside the Function
and the Function
uses Plugin
โs [Docker] image to execute the task!
This means you need to create a Plugin
with those Functions
and use the Paraview
or VTK
docker image for that plugin.
I know that I introduced so many concepts in two paragraphs. Letโs use honeybee-energy
as an example. Itโs a plugin that includes several functions for energy
simulation Recipes. Here is the repository:
If you check the __init__.py
file you will see that the image
for this plugin is set to ladybugtools/honeybee-energy
.
# this is a facny way to get the version for the docker image
# the results is something like ladybugtools/honeybee-energy:1.69.2
image_id = get_docker_image_from_dependency(
__package__, 'honeybee-energy', 'ladybugtools'
)
__pollination__ = {
'config': {
'docker': {
'image': image_id,
'workdir': '/home/ladybugbot/run'
}
}
}
This is also reflected on the plugin page on Pollination.
Perfect! I should have checked more recipes
That should work, then.
1 Like
Not your fault! We should have a better documentation. Iโm half way there. We were not expecting someone to be so brave to want to write a recipe right away! Thank you for being patient with us. Getting there โฆ