epics-containers / ibek

IOC Builder for EPICS and Kubernetes
https://epics-containers.github.io/ibek
Apache License 2.0
10 stars 4 forks source link

Rendering of jinja in definition arguments fails for DB macros #174

Closed gilesknap closed 1 month ago

gilesknap commented 5 months ago

e.g.

  - type: pmac.dls_pmac_asyn_motor
    Controller: PPMAC1
    DESC: X
    M: :{{ DESC }}
    P: "{{ Controller.P }}"

Causes the DB template eloss_autohome_records.template to (part) render like this:

# disable motor when homing
record(calcout, "BL01J-MO-PPMAC-01:X:SDIS") {
#  field(INPA, "{{ Controller.P }}:HM:HOMING CP")
}

It should be:

# disable motor when homing
record(calcout, "BL01J-MO-PPMAC-01:X:SDIS") {
#  field(INPA, "PPMAC1:HM:HOMING CP")
}
marcelldls commented 1 month ago

I tried to deploy an IOC with such a definition and it still seems to be an issue. The faulty substitution can be seen in the produced epics/runtime/ioc.subst. I have been trying to make a test case for this (https://github.com/epics-containers/ibek/tree/render-db-macros). When I comment out the PVI entry in the support.yaml I can produce ioc.subst and it seems to render fine

However im trying to include pvi now and this is where I get stuck. However it seems to be where the issue is. Any thoughts? https://github.com/epics-containers/ibek/actions/runs/9222929130/job/25375104334#step:5:133

marcelldls commented 1 month ago

I tried to deploy an IOC with such a definition and it still seems to be an issue. The faulty substitution can be seen in the produced epics/runtime/ioc.subst. I have been trying to make a test case for this (https://github.com/epics-containers/ibek/tree/render-db-macros). When I comment out the PVI entry in the support.yaml I can produce ioc.subst and it seems to render fine

However im trying to include pvi now and this is where I get stuck. However it seems to be where the issue is. Any thoughts? https://github.com/epics-containers/ibek/actions/runs/9222929130/job/25375104334#step:5:133

I skipped all the .bob file stuff and now I do get it to run - but it seems to render fine here aswell. More investigation needed

gilesknap commented 1 month ago

Hi Marcel, are you working from main branch? I've made a recent fix wrt Jinja rendering that could possibly be related. See 3.0.0b4.

marcelldls commented 1 month ago

This is using ioc-pmac. I did just try updating the version of ibek in the dev container and that solves the issue. Lets close this issue and update the generic IOC?

gilesknap commented 1 month ago

@marcelldls can we close this and ref ibek>=3.0.0b4 I understood that you saw this go away with that version - just making sure that is what you meant.

marcelldls commented 1 month ago

Indeed - just to clarify I updated to 3.0.0b4 and the issue was resolved

gilesknap commented 1 month ago

This is fixed in https://github.com/epics-containers/ibek/releases/tag/3.0.0b4