I am trying to make Elyra to use a custom Jinja template for my custom component. I have tried modifying Elyra's configuration file for this two items:
c.ElyraApp.template_paths = ['/home/templates']
c.ExtensionApp.template_paths = ['/home/templates']
Unfortunately none of them work, and I am not sure if they are not intended to be used like this or if I am configuring them wrong. The only way I was able to do so was by modifying the template listed in templates/airflow/
unfortunately that is persistent.
Also as far as I can see in the source code, the path is just hard coded, so not sure if it is actually configurable?
# Load template from installed elyra package
loader = PackageLoader('elyra', 'templates/airflow')
from here.
Currently the reason to change the template is to add volume mounts to the pods. But it would be handy to be able to specify my own template in the future if other things would need to be changed. Any ideas?
To accomplish this you'll have to modify the included Jinja template and rebuild Elyra and JupyterLab, because the template source file location is intentionally not configurable. Even though there are certain scenarios where it might be sufficient to update only the template file to customize the generated DAG code, there are many others that would also require changes to the Elyra code to collect additional input data and to pass it to the renderer.
Elyra already does haven an open requirement to add support for volume mounts to the pipeline editor.