Written by

Developer at Government of Jersey
Question Daniel Bertozzi · 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

<NamespaceName="${DataNamespace}"Create="no"><Invokename="Credentials"Class="GOJ.IrisApp.Install.ApplicationLayer"Method="AddCredentials"CheckStatus="1"><Argname ="Namespace"Value="${DataNamespace}" /><Argname ="Environment"Value="${Environment}" /></Invoke><InvokeClass="GOJ.IrisApp.Install.ApplicationLayer"Method="AddLookupTables"CheckStatus="1" ><Argname ="Namespace"Value="${DataNamespace}"/><Argname ="Environment"Value="${Environment}" /></Invoke><InvokeClass="GOJ.IrisApp.Install.ApplicationLayer"Method="AddSchedules"CheckStatus="1" ><Argname ="Namespace"Value="${DataNamespace}"/><Argname ="Environment"Value="${Environment}"/></Invoke><InvokeClass="GOJ.IrisApp.Install.DefaultSettings"Method="Load"CheckStatus="1" ><Argname ="Namespace"Value="${DataNamespace}"/><Argname ="Environment"Value="${Environment}"/></Invoke><CompileClass="${ProductionName}"Flags="ckb"IgnoreErrors="0" /><InvokeClass="Ens.Director"Method="SetAutoStart"CheckStatus="1" ><ArgValue="${ProductionName}" /></Invoke><InvokeClass="Ens.Director"Method="StartProduction"CheckStatus="1" ><Argname ="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 installerzn"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]

Comments

Eduard Lebedyuk · Aug 10, 2022

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)
0
Daniel Bertozzi · Aug 11, 2022

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.0FROM $IMAGE

WORKDIR /home/irisowner/irisbuild
COPY iris.key /usr/irissys/mgr/iris.key
COPY iris.key iris.key
0