Question
· 5 hr ago

How the installed IPM package can know where it were installed?

Hi developers!

There is a very neat variable in IPM ${ipmdir} that lets packages be installed on a particular IRIS server and ensures that the data and resources they bring don't mess around as ${ipmdir} variable during the installation transforms into:

iris installation dir/ipm/package_name/version/whatever_you_install_here

It is very convenient, e.g., to bring some data and resource files that can be useful during the installation setup, e.g., via FILECOPY. Indeed, suppose you bring some csv_file, e.g. titanic.csv via FILECOPY as:

<FileCopy Name="data/titanic.csv" Target="${ipmdir}data/titanic.csv"/>

or even the whole folder of data in the source code repo into the package:

<FileCopy Name="data/" Target="${ipmdir}data/"/>

And in the case of Iris in Docker it resides in:

/usr/irissys/ipm/package_name/1.0.0/data/titanic.csv

This is all great, but is there any way for the installed code to determine the location of the data files? It'd be neat to let the installed app know somehow where is the data that came with it? Could it be the method in the IPM client that will resolve ${ipmdir} for the app? 

Or at least, it'd be great to let it be used on module.xml level where ${ipmdir} is supposed to be used, e.g., to be passed to an invoke method as an argument. But the issue is that it looks like <Arg></Arg> element expects literals only, but not parameters? Filed the issue already.

Product version: IRIS 2025.3
Discussion (0)1
Log in or sign up to continue