Absolute paths in ADL files in userapps break remote MEDM
The remote MEDM system is great, however it is currently critically impacted by a large number of absolute path references in the ADL files (MEDM screens) that cannot be resolved easily either via https://{lho,llo}epics.ligo-{wa,la}.caltech.edu/<path>
or from the remote user's filesystem. For example [ref]:
composite {
object {
x=551
y=249
width=159
height=31
}
"composite name"=""
"composite file"="/var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl; IFO=$(IFO), SYSTEM=SR3_CAGE_SERVO"
}
The /var/opt/conda/base/envs/cds/lib/...
path is specific to the CDS system in the control room and breaks the functionality of the screen when viewed remotely.
medm
spits out many blocks like this:
compositeFileParse: Cannot locate file
filename: /var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl; IFO=H1, SYSTEM=SUS_PR3
locateResource '/var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl'
isNetworkRequest /var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl
canAccess('/var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl', 4) = -1
searching for '/var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl' in 'https://lhoepics.ligo-wa.caltech.edu/'
isNetworkRequest https://lhoepics.ligo-wa.caltech.edu///var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl
cmdBuffer = "/usr/bin/curl -sw '%{http_code}' https://lhoepics.ligo-wa.caltech.edu///var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl"
canAccess('https://lhoepics.ligo-wa.caltech.edu///var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl', 4) = -1
Could not find '/var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl'
locateResource(/var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl...) returning 0
locateResourceFromParent, first on pass on /var/opt/conda/base/envs/cds/lib/python3.9/site-packages/guardian/medm/screens/GRD_MICRO.adl returned 0
Not continuing to evaluate path, locateResourceFromParent returning 0
It would be excellent to remove these absolute references in one of the following ways:
-
Use a relative path reference to
GRD_MICRO.adl
:"composite file"="GRD_MICRO.adl;..."
and rely on
$EPICS_DISPLAY_PATH
to resolve the absolute path in the control room or on the remote user's file system. -
Use a macro substitution:
"composite file"="$(GUARD_MEDM_PATH)/GRD_MICRO.adl;..."
allowing CDS in the control room, or the remote MEDM user, to control the path.
-
Use a fixed absolute path reference, e.g.
/usr/share/guardian/
(which is used in a number of places), which is then resolved by the remote EPICS webserver.
This is an ordered list (most preferred first), but am happy with any solution that works for remote MEDM users. I understand that the preferential ordering is almost exactly the same as the 'most disruptive to least disruptive' ordering in terms of changes to the ADL files in userapps.