-
Notifications
You must be signed in to change notification settings - Fork 23
05. Deployed Packages
As of version 0.4.0, IPM supports Deployed packages. Deployed packages are the packages that will contain only compiled code, without any traces of the original source code, suitable for proprietary projects.
Example of module.xml with Sample.Demo
package defined as having to be deployed.
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Document name="demo.ZPM">
<Module>
<Name>demo</Name>
<Version>1.0.0</Version>
<Description>DEMO.</Description>
<Keywords>demo</Keywords>
<SourcesRoot>src</SourcesRoot>
<Resource Name="Sample.Demo.PKG" Deploy="true"/>
</Module>
</Document>
</Export>
Development of such modules remains the same as for non-deployed modules.
zpm "load /home/irisowner/demo"
IPM will load such a module in development mode, ignore Deploy flags, and keep all source code.
Some classes, such as isc.rest subclasses, define projection methods that execute at compile-time and store metadata in external globals. If these classes are included in a package marked with Deploy="true", the metadata (which would be stored in an IRIS.dat file) is not packaged. As a result, after installation, the required projection metadata may be missing.
Why this matters: These globals are not automatically included during packaging. The installed deployed package may not function as expected if it depends on this metadata.
Workarounds: Avoid deploying classes with projection logic, or export required globals as part of the packaging process, and import them during installation if needed.
This ensures projection metadata is preserved in environments where the deployed module is installed.
To publish module as deployed, no additional actions needed, just publish it as usual.
zpm:USER>publish demo
[USER|demo] PrepareDeploy START
[USER-PACKAGE-429287|demo] PrepareDeploy SUCCESS
[USER-PACKAGE-429287|demo] Reload START (/home/irisowner/zpm/packages/demo/)
[USER-PACKAGE-429287|demo] Reload SUCCESS
[demo] Module object refreshed.
[USER-PACKAGE-429287|demo] Validate START
[USER-PACKAGE-429287|demo] Validate SUCCESS
[USER-PACKAGE-429287|demo] Compile START
[USER-PACKAGE-429287|demo] Compile SUCCESS
[USER-PACKAGE-429287|demo] Activate START
[USER-PACKAGE-429287|demo] Configure START
[USER-PACKAGE-429287|demo] Configure SUCCESS
[USER-PACKAGE-429287|demo] Activate SUCCESS
[USER-PACKAGE-429287|demo] Package START
[USER-PACKAGE-429287|demo] MakeDeployed START
[USER-PACKAGE-429287|demo] MakeDeployed SUCCESS
[USER|demo] Package SUCCESS
[USER|demo] Register START
[USER|demo] Register SUCCESS
[USER|demo] Publish START
[USER|demo] Publish SUCCESS
IPM recognizes that the package has some resources to be deployed, and creates a new temporary namespace, which loads the package and does deployment, so it will remove all the source code for resources marked as Deploy=true
. The final package file will contain only compiled code. With the additional option -DPublishTo=test
, you can set which registry to use for publishing. And override the version number from module.xml -DNewVersion=1.0.0
Installation is as usual, but you will not be able to install deployed package, or any package in production mode if you already have the package installed in development mode.
zpm:USER>install demo
ERROR! Cannot install 'demo' over previously installed in developer mode
You would need to uninstall the package installed in development mode, or use a clean namespace or instance for it.
It's important to remember that deployed package does not have source code, so, the packaging should be completed on a specific version of IRIS that which developer support. The registry supports multiple platform versions for one specific version of the package, so, during installation IPM will request a version for the platform. To compare versions it uses only major and minor parts of the IRIS version, e.g. 2022.2, 2021.1. When you will try to install the package on an unsupported version of IRIS, will get the error
zpm:USER>install test/demo
ERROR! Deployed package 'demo' 1.0.0 not supported on this platform 2022.1.
Successful install on supported platform
zpm:USER>install test/demo
[USER|demo] Reload START (/usr/irissys/mgr/.modules/USER/demo/1.0.0/)
[USER|demo] Reload SUCCESS
[demo] Module object refreshed.
[USER|demo] Validate START
[USER|demo] Validate SUCCESS
[USER|demo] Compile START
[USER|demo] Compile SUCCESS
[USER|demo] Activate START
[USER|demo] Configure START
[USER|demo] Configure SUCCESS
[USER|demo] Activate SUCCESS