Question
· Aug 10, 2022

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>
  <Invoke Class="GOJ.IrisApp.Install.ApplicationLayer" Method="AddLookupTables" CheckStatus="1" >
   <Arg name ="Namespace" Value="${DataNamespace}"/>
   <Arg name ="Environment" Value="${Environment}" />
  </Invoke>
  <Invoke Class="GOJ.IrisApp.Install.ApplicationLayer" Method="AddSchedules" CheckStatus="1" >
   <Arg name ="Namespace" Value="${DataNamespace}"/>
   <Arg name ="Environment" Value="${Environment}"/>
  </Invoke>
  <Invoke Class="GOJ.IrisApp.Install.DefaultSettings" Method="Load" CheckStatus="1" >
   <Arg name ="Namespace" Value="${DataNamespace}"/>
   <Arg name ="Environment" Value="${Environment}"/>
  </Invoke>
  <Compile Class="${ProductionName}" Flags="ckb" IgnoreErrors="0" />
  <Invoke Class="Ens.Director" Method="SetAutoStart" CheckStatus="1" >
   <Arg Value="${ProductionName}" />
  </Invoke>
  <Invoke Class="Ens.Director" Method="StartProduction" CheckStatus="1" >
   <Arg name ="ProductionName" Value="${ProductionName}"/>
  </Invoke>
 </Namespace>

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")
    halt

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:

zn "IRISAPP"
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
 

Thanks


Dan

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]
Discussion (2)1
Log in or sign up to continue

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.

ARG IMAGE=containers.intersystems.com/intersystems/irishealth:2022.1.0.209.0
FROM $IMAGE

WORKDIR /home/irisowner/irisbuild

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