Daniel Bertozzi · Aug 10

Applying a production to namespace in docker image

Hi all

I'm testing migrating our existing installers (without ZPM) using the docker dev template as a basis with a commercial image and licence key.

So far everything builds as I expect, but the one issue I have is the production doesn't apply itself automatically.

In my iris.script I have custom installer that uses this manifest below but it does not observe the last three steps

<Namespace Name="${DataNamespace}" Create="no">
  <Invoke name="Credentials" Class="GOJ.IrisApp.Install.ApplicationLayer" Method="AddCredentials" CheckStatus="1">
   <Arg name ="Namespace" Value="${DataNamespace}" />
   <Arg name ="Environment" Value="${Environment}" />
  <Invoke Class="GOJ.IrisApp.Install.ApplicationLayer" Method="AddLookupTables" CheckStatus="1" >
   <Arg name ="Namespace" Value="${DataNamespace}"/>
   <Arg name ="Environment" Value="${Environment}" />
  <Invoke Class="GOJ.IrisApp.Install.ApplicationLayer" Method="AddSchedules" CheckStatus="1" >
   <Arg name ="Namespace" Value="${DataNamespace}"/>
   <Arg name ="Environment" Value="${Environment}"/>
  <Invoke Class="GOJ.IrisApp.Install.DefaultSettings" Method="Load" CheckStatus="1" >
   <Arg name ="Namespace" Value="${DataNamespace}"/>
   <Arg name ="Environment" Value="${Environment}"/>
  <Compile Class="${ProductionName}" Flags="ckb" IgnoreErrors="0" />
  <Invoke Class="Ens.Director" Method="SetAutoStart" CheckStatus="1" >
   <Arg Value="${ProductionName}" />
  <Invoke Class="Ens.Director" Method="StartProduction" CheckStatus="1" >
   <Arg name ="ProductionName" Value="${ProductionName}"/>

As a workaround I do a compile in iris.script as a last step - this make the production visible in the auto start dropdown without me needing to compile it.

   //TODO: Not working in installer
    zn "IRISAPP"
    do $SYSTEM.OBJ.Compile("GOJ.IrisApp.Production*","ckb")

But I still need to log onto the management portal and apply the production and autostart my namespace manually OR I can use the commands in terminal below:

do ##class(Ens.Director).SetAutoStart("GOJ.IrisApp.ProductionDev")
do ##class(Ens.Director).StartProduction("GOJ.IrisApp.ProductionDev")

I tried to add these to the end of iris.script but nothing happens. Is there another place in the process I should try and run this so I can automate it?

Articles that i've looked at:

InterSystems Open Exchange (dev template using)

Production is not auto starting while using container | InterSystems (alternative method



Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.1 (Build 209U) Tue May 31 2022 12:15:45 EDT [Health:3.5.0]
0 162
Discussion (2)1
Log in or sign up to continue

I would start by observing the output of these two commands when run from a Dockerfile:

set sc = ##class(Ens.Director).SetAutoStart("GOJ.IrisApp.ProductionDev")
write $system.Status.GetErrorText(sc)
set sc = ##class(Ens.Director).StartProduction("GOJ.IrisApp.ProductionDev")
write $system.Status.GetErrorText(sc)

I figured it out. Code was fine but production wasn't starting due to a licencing not applying. Turns out coping key to iris build folder wasn't enough - once placed a copy in the/usr/irissys/mgr/ that allowed the production to run. That perhaps problem explains the issue I was having with ZPM also because the key wasn't applying until a later stage from the build location. I need to review the way we handle the licences but this will get me running for the moment.


WORKDIR /home/irisowner/irisbuild

COPY iris.key /usr/irissys/mgr/iris.key
COPY iris.key iris.key