IoT architectures – automation stunts with .net framework, part 2

Part 2: Let’s go with containers

This is the second of six articles about how an IoT project with certain constraints and prerequisites was implemented. This time it is about trying to create windows containers with a massive setup of a proprietary piece of software.

How to host that?

Sure containers as hyped as useful. Putting everything in containers seems to be quite natural. Why sticking to anything else? Let’s have a look onto the advantages though:

  • Portability between different platforms and clouds—it’s truly write once, run anywhere.

  • Efficiency through using far fewer resources than VMs and delivering higher utilization of compute resources

  • Agility that allows developers to integrate with their existing DevOps environment.

  • Higher speed in the delivery of enhancements. Containerizing monolithic applications using microservices helps development teams create functionality with its own life cycle and scaling policies.

  • Improved security by isolating applications from the host system and from each other.

  • Faster app start-up and easier scaling.

  • Flexibility to work on virtualized infrastructures or on bare metal servers

  • Easier management since install, upgrade, and rollback processes are built into the Kubernetes platform.

That all sounds great. The first point is actually partly untrue at least for windows containers, there are prerequisites. Anyway, let’s have a look onto Azure services and pick the right one for our task. What is available for hosting, deployment, maintenance of containers and which one is the best choice?

Hosting choices on Azure for containers

IF YOU WANT TO USE THIS
Simplify the deployment, management, and operations of Kubernetes Azure Kubernetes Service (AKS)
Quickly create powerful cloud apps for web and mobile App Service
Easily run containers on Azure without managing servers Container Instances
Cloud-scale job scheduling and compute management Batch
Develop microservices and orchestrate containers on Windows or Linux Service Fabric
Store and manage container images across all types of Azure deployments Container Registry
Run fully managed OpenShift clusters, jointly operated with Red Hat Azure Red Hat OpenShift

AKS: Does it make sense to use AKS for at least three types of containers? Even if it is necessary to have a lot of instances, it seems to be some kind of overengineering. As I cannot estimate how many containers instances I need, I am unsure if the complexity of an AKS is going to pay out.

App Service: The only container instance that probably could have an http endpoint is the scheduler. Reader and Writer are unattended and work via messages, so no need. Actually it is possible to host containers, but if you don’t have an http endpoint, health probes will fail. That means, the container is going to be restarted as App Service “thinks” the container is unresponsive. This is something I learned later.

Container Instances: Had a short look. This sounds promising esp. due to the early stage of implementation. With a container registry, automatic deployment is possible, I do not need to care about network, ingest, security within an AKS. So let’s go with this service.

Batch: Actually I didn’t see this service when I started the implementation. Would have been a good idea at least to replace the scheduler. Not sure about the compute capabilities. I’ll have a look onto this service in a later project.

Service Fabric: I used Service Fabric some years before. Still 30% of all Azure services run on Service Fabric, so don’t underestimate the power and flexibility of this framework. You know, great power comes with great responsibility. Service Fabric is as AKS too complex for this simple solution. For production system, at least 5 nodes are necessary, definition and running services is specific and need a lot of configuration.

Container Registry: Sure, I need it :-).

Open Shift: Always wanted to try OpenShift, but for this project it doesn’t seem to be the right choice to go into “testing mode”. Actually customer pays and this kind of eval is not included, unluckily.

Windows containers, pure fun

For creation of a windows container, I need a windows environment. I do work on a mac, so I got a VM in our data center for doing. This is Windows Server 2016. Is that a good idea? I am not sure.

Let’s start with the more simple Docker file definition. asp.net core can run pretty much everywhere and it isn’t as large as the actual windows server core image. Looks like this.

[pastacode lang=”bash” manual=”%23%20Indicates%20that%20the%20windowsservercore%20image%20will%20be%20used%20as%20the%20base%20image.%0AFROM%20mcr.microsoft.com%2Fdotnet%2Fcore%2Faspnet%3A3.1%0A%0A%23%20Metadata%20indicating%20an%20image%20maintainer.%0ALABEL%20maintainer%3D%22holger.leichsenring%40henkel.com%22%0A%0AEXPOSE%2080%0A%23%20copy%20binaries%0ACOPY%20%22.%5Cbin%5CDebug%5Cnetcoreapp3.1%5Cpublish%22%20%22c%3A%5Capp%22%0A%0AWORKDIR%20%22C%3A%5Capp%22%0A%0ACMD%20%5B%20%22Henkel.Osi2Hdf.Writer.exe%22%20%5D%0A%0A%0A” message=”” highlight=”” provider=”manual”/]

Okay, happy to start it up. What’s this error message? Ah, come on.

[pastacode lang=”bash” manual=”C%3A%5CWindows%5Csystem32%3Edocker%20pull%20mcr.microsoft.com%2Fwindows%2Fservercore%3A1607%201607%3A%20%0APulling%20from%20windows%2Fservercore%203889bb8d808b%3A%20Extracting%20%5B%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3E%5D%20%20%204.07GB%2F4.07GB%20%0A846a2223e9e7%3A%20Download%20complete%20failed%20to%20register%20layer%3A%20rename%0A%20C%3A%5CProgramData%5Cdocker%5Cimage%5Cwindowsfilter%5Clayerdb%5Ctmp%5Cwrite-set-148328921%0A%20C%3A%5CProgramData%5Cdocker%5Cimage%5Cwindowsfilter%5Clayerdb%5Csha256%5Cf358be10862ccbc329638b9e10b3d497dd7cd28b0e8c7931b4a545c88d7f7cd6%3A%20Access%20is%20denied.” message=”” highlight=”” provider=”manual”/]

The first time I started with Docker on Windows is long ago. I remembered having no fun at all. Have a look on Docker containers on Windows Server 2016 with Containers: HNS failed with error: Unspecified error orDocker containers on Windows 10: HNS failed with error : Unspecified error. Experiencing these issue had been on a physical machine, but that doesn’t make too much difference. I tried the same solutions, firstly, switch off the virus scan. Working in a large company means, this can take days for a small time window where I can check if it is the cause.

Switching off the virus scan solved the problem with downloading, but still it was not possible to create docker images. It always failed somewhere in the middle with Access Denied error messages as well. What does it mean?

Windows Server 2016 is unreliable for creating Docker images

Lots of things are processualized within large companies. Ugrading the image took days. But here we go, I finally was able to create the image for the Writer component. All fine.

.net Framework, Containers and a massive setup

Pretty optimistic me, I searched the internet and thought:

Come on, cannot be that hard to create a docker image for a .net framework lib!

I did what all guys do: I used my Google Fu to find the right thing. I thought I was successful, when I saw a docker image definition for the AFSDK lib of OSISoft. This is how the Dockerfile looks like.

[pastacode lang=”bash” manual=”%23%20escape%3D%60%0AFROM%20mcr.microsoft.com%2Fwindows%2Fservercore%3Altsc2019%0ASHELL%20%5B%22powershell%22%2C%20%22-Command%22%2C%20%22%24ErrorActionPreference%20%3D%20’Stop’%3B%20%24ProgressPreference%20%3D’SilentlyContinue’%3B%22%5D%0ARUN%20New-Item%20%22C%3A%2FPI%22%20-ItemType%20Directory%0ACOPY%20.%2FAFClient.zip%20C%3A%2FPI%2F%0ARUN%20Expand-Archive%20C%3A%2FPI%2FAFClient.zip%20C%3A%2FPI%2FAFClient%2F%0ACOPY%20.%2Fkst.ini%20C%3A%2FPI%2FAFClient%2F%0ACMD%20powershell” message=”” highlight=”” provider=”manual”/]

Uh, pretty scary. Powershell. Setups. Ah, come on. Will work. In his explanation the guy stated, this is what is going to be needed:

[pastacode lang=”bash” manual=”Make(run)%20a%20Container%20and%20execute%20powershell%20on%20it.Then%2C%0A%20%0A%0APS%3Ecd%20C%3A%5CPI%5CAFClient%0APS%3EStart-Process%20%22Setup.exe%22%20%22-f%20silent.ini%22%20-PassThru%20%7C%20Wait-Process%0A%0AWait%20a%20few%20minutes.%20After%20Installation%20finished%2C%20Test%20the%20connection%20to%20PIDA.%0A%20%0APS%3E%5BSystem.Reflection.Assembly%5D%3A%3ALoadWithPartialName(%22OSISoft.AFSDK%22)%0A%23AFSDK%20information%20will%20be%20displayed%0APS%3E%24PI%3DNew-Object%20OSIsoft.AF.PI.PIServers%0APS%3E%24PI.Connect()%0APS%3E%24PI.DefaultPIServer” message=”” highlight=”” provider=”manual”/]

To be honest, that sounds odd. Weird. I’ll find more adjectives.

Anyway, I need to have it in place, so I followed instructions. Having a windows 2019 server at least creation of docker images worked. And then I spent a lot of time on running this setup. It is not my perferred way of creation of Docker containers to have

  • a zip file that needs to be copied
  • then unzipped
  • installed via weird setup.ini file that is as long as the Bible
  • not seeing anything as a result in terminal. Setup just finishes with “success” or “failed”.
  • It is necessary to open the log to get the details.

Executing windows setups is pure love inside of docker containers (warning: Ironic mode)

Isn’t it funny when a setup tells you, it wants to restart the “machine” when being installed in a docker container?

Have a look onto the setup.ini

The setup needs to run silently. In Docker containers I wont be able to accept dialogs so double check the ini file. Let’s have a look. It’s massive.

[pastacode lang=”bash” manual=”%3B———————————————————————————————%0A%3B%20SILENT%20INSTALLATION%20INSTRUCTIONS%0A%3B%0A%3B%20To%20run%20a%20silent%20installation%2C%20use%20the%20-f%20option%20with%20Setup.exe%3A%0A%3B%0A%3B%20%20%20%20%20setup.exe%20-f%20silent.ini%0A%3B%0A%3B%20Prior%20to%20running%20the%20silent%20install%2C%20update%20the%20COMMANDLINE%20section%20listed%20below%20as%20needed.%0A%3B%20Refer%20to%20the%20CUSTOMIZATION%20OPTIONS%20section%20for%20a%20description%20of%20the%20properties%20that%20can%20be%20set.%0A%3B%0A%3B%20One%20of%20the%20customization%20options%20allows%20you%20to%20configure%20a%20separate%20KST_INI_FILE%20(refer%20to%20section%20’CUSTOMIZATION%20OPTIONS’%20below%20for%20additional%20information).%20%0A%3B%20The%20structure%20of%20KST_INI_FILE%20is%20shown%20below%20(only%20NUM_SERVERS%20and%20PI_SERVER%20are%20required)%3A%0A%3B%20%5BNUM_SERVERS%5D%0A%3B%20NUM%20%3D%20%23%23%0A%3B%20%5BPI_SERVER%5D%0A%3B%20%23%20%3D%20ServerName%0A%3B%20%5BPI_PATH%5D%0A%3B%20%23%20%3D%20ServerPath.osi.com%20-%20defaults%20to%20ServerName%0A%3B%20%5BPI_PORT%5D%0A%3B%20%23%20%3D%205450%20-%20defaults%20to%205450%20for%20PI3%2C%20545%20for%20PI2%0A%3B%20%5BPI_USER%5D%0A%3B%20%23%20%3D%20piadmin%20-%20defaults%20to%20pidemo%0A%3B%20%5BPI_DEFAULT_SERVER%5D%0A%3B%20%23%20%3D%20TRUE%20-%20should%20only%20be%20one%20server%20which%20is%20default%0A%3B%20%5BPI_SERVER_ID%5D%0A%3B%20%23%20%3D%20xxxxxxxxxx%20-%20not%20needed%0A%3B%20%5BPI_TYPE%5D%0A%3B%20%23%20%3D%203%20-%20defaults%20to%20PI3%20(2%2C%203%2C%20PI2%2C%20or%20PI3%20allowed)%0A%3B%20%5BPI_ALIAS%5D%0A%3B%20%23%20%3D%20AliasName%20-%20creates%20alias%20if%20specified%0A%3B———————————————————————————————%0A%5BSETUPKIT%5D%0ANAME%20%3D%20SetupAFClient2_x%0ADISPLAYNAME%20%3D%20PI%20AF%20Client%202018%20SP3%20Patch%201%0ASHOWSKIPPEDMODULES%20%3D%20FALSE%0AFEATUREUPGRADE%20%3D%20FALSE%0A%3B%20These%20suppress%20the%20setup%20wrapper%20dialogs%2C%20not%20those%20for%20the%20individual%20setup%20modules%0ASUPPRESSCOMPLETIONMESSAGE%20%3D%20FALSE%0ASUPPRESSPROGRESSMESSAGE%20%3D%20FALSE%0ASUPPRESSHEADERMESSAGE%20%3D%20TRUE%0ASUPPRESSDIALOGS%20%3D%20TRUE%0A%5BNUMSETUPMODULES%5D%0ANUM%20%3D%2013%0A%5BSETUPMODULES%5D%0A1%20%3D%20dotnet48Setup%0A%3B%20%20%20dotnet48Setup%20required%20by%20AFClient%0A2%20%3D%20PreInstallTasks%0A%3B%20%20%20PreInstallTasks%20required%20by%20pibufss.msi%20and%20pibufss_x64.msi%0A3%20%3D%20MSVC9SP1x86Redistrib%0A4%20%3D%20MSVC9SP1x64Redistrib%0A%3B%20%20%20MSRuntimes%20VS2008%20SP1%20required%20by%3A%20PIBufss%20(via%20the%20piapi).%20for%20×64%20installations%2C%20only%20need%20the%20×64%20runtimes.%0A5%20%3D%20MSRuntimesVS2019_x86%0A6%20%3D%20MSRuntimesVS2019_x64%0A%3B%20%20%20MSRuntimes%20VS2019%20(32-bit%20and%2064-bit)%20required%20by%3A%20MDA%20components%2C%20PIBufss%20(32%20bit%20and%2064%20bit)%2C%20and%20PINS%20utilities%20and%20dll’s%3A%20pictrdll.dll%2C%20pigetmsg.exe%2C%20piconfig.exe%2C%20pidiag.exe%0A7%20%3D%20PINS%0A%3B%20PINS%20or%20PISDK%20install%20is%20required%20by%3A%20PIBuffss%2C%20which%20is%20an%20optional%20component%20for%20AF%20Client.%20%20PINS%20is%20preferred%20over%20PI%20SDK%20unless%20you%20have%20a%20specific%20need%20for%20PI%20SDK.%0A%3B%20If%20PI%20SDK%20is%20needed%20for%20your%20application%2C%20then%20include%20both%20the%20PI%20SDK%2032-bit%20and%2064-bit%20installation%20kits%20here%2C%20and%20include%20the%20VS2015%20Update1%20(32%20bit%20and%2064%20bit)%20redist%20kits.%0A%3B%20Re-number%20the%20sections%20below%20this%20line%2C%20and%20update%20%5BNUMSETUPMODULES%5D%2C%20%5BUPGRADECOMMANDLINE%5D%2C%20and%20%5BUNSUPPORTED_OPERATING_SYSTEMS%5D%20sections.%0A8%20%3D%20PIBufss.msi%0A9%20%3D%20PIBufss_x64.msi%0A%3B%20%20%20PIBufss%20installs%20are%20optional%20for%20AFClient.%20%20Install%20if%20you%20require%20buffering.%20%20Buffering%20is%20recommended%20when%20writing%20to%20HA%20Data%20Archives.%0A10%20%3D%20AFClient_Net35%0A%3B%20AFClient_Net35_Check%20to%20check%20if%20the%20.net%203.5%20sdk%20feature%20was%20installed%0A11%20%3D%20AFClient_x86.msi%0A12%20%3D%20AFClient_x64.msi%0A%3B%20%20the%20AFClient%20installation%0A13%20%3D%20VSTOWrapper%0A%3B%20%20%20VSTOWrapper%20Required%20by%20PIBuilder%20in%20AFClient.%0A%5BCOMMANDLINE%5D%0A%3B%20dotnet48Setup%20-%20typical%20installation%20of%20.net%204.8.0%20will%20require%20a%20reboot.%20if%20you%20prefer%20the%20silent%20install%20to%20not%20reboot%20then%20add%20the%20%2Fnorestart%20option.%0A1%20%3D%20%2Fq%0A%3B%20PreInstallTasks%20%20(Must%20come%20after%20DotNet%204.8%20installation)%0A2%20%3D%20%0A%3B%20MSRuntimes%20VS2008%20SP1%20(32-bit%20and%2064-bit)%20%0A3%20%3D%20%2Fq%20%2Fnorestart%0A4%20%3D%20%2Fq%20%2Fnorestart%0A%3B%20MSRuntimes%20VS2019%20(32-bit%20and%2064-bit)%0A5%20%3D%20%2Fq%20%2Fnorestart%0A6%20%3D%20%2Fq%20%2Fnorestart%0A%3B%20PINS%20(32-bit%20%2F%2064%20bit%20support)%0A7%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20%2Fqn%0A%3B%20If%20PI%20SDK%20is%20needed%20for%20your%20application%2C%20use%20the%20following%20cmdline%20options%20for%20both%2032%20bit%20and%2064%20bit%20kits%3A%20%20%0A%3B%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20NOPISDKBUFFERING%3D1%20%2Fqn%0A%0A%3B%20PI%20Buffer%20Subsystem%20(32-bit%20and%2064%20bit)%0A8%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20CLEANUPKST%3D0%20%2Fqn%20%0A9%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20CLEANUPKST%3D0%20%2Fqn%0A10%20%3D%20SKIPFULLAFSDKCHECK%3D1%20ALLUSERS%3D1%20REBOOT%3DSuppress%20%2Fqn%0A%3B%20AFClient%20(32-bit%20or%2064-bit)%20CUSTOMIZATION%20OPTIONS%20%20%0A%3B%20%20AF_SERVER%3DmachineName%20%20%20Defines%20default%20Asset%20Server%20(new%20install%20only)%20%20%0A%3B%0A%3B%20%20Configuration%20options%20used%20to%20add%20a%20single%20PI%20Data%20Servers%20to%20the%20Known%20Servers%20Table%3A%0A%3B%20%20PI_SERVER%3DmachineName%20%20%20Defines%20default%20Data%20Server%20%0A%3B%20%20PI_USER%3Dpidemo%20%20%0A%3B%20%20PI_ALIAS%3DServerNameAlias%0A%3B%0A%3B%20%20Configuration%20options%20used%20to%20add%20multiple%20PI%20Data%20Servers%20to%20the%20Known%20Servers%20Table%3A%0A%3B%20%20IMPORT_KST%3D1%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Set%20to%201%20to%20configure%20multiple%20PI%20Data%20Servers.%0A%3B%20%20KST_INI_FILE%3D%22c%3A%5Ckst.ini%22%20%20%20%20Specify%20path%20to%20an%20ini%20file%20that%20defines%20the%20list%20of%20PI%20Data%20Servers%20to%20be%20added%20to%20the%20KST.%20%0A%3B%0A%3B%20Examples%3A%20%20(single%20server)%20%20%20%20–%3E%20%2013%20%3D%20%2Fqn%20REBOOT%3DSuppress%20ALLUSERS%3D1%20INSTALLDIR%3D%22C%3A%5CProgram%20Files%5CPIPC%22%20PI_USER%3Dpidemo%20PI_SERVER%3DServerName%20PI_ALIAS%3DServerNameAlias%0A%3B%20%20%20%20%20%20%20%20%20%20%20%20(kst.ini%20import)%20%20%20–%3E%20%2013%20%3D%20%2Fqn%20REBOOT%3DSuppress%20ALLUSERS%3D1%20INSTALLDIR%3D%22C%3A%5CProgram%20Files%5CPIPC%22%20IMPORT_KST%3D1%20KST_INI_FILE%3D%22c%3A%5Ckst.ini%22%0A%3B%0A%3B%20%20REMOVE_KST%3D1%20%20This%20option%20will%20permanently%20delete%20the%20Known%20Servers%20Table%20(KST)%2C%20and%20should%20only%20be%20set%20if%20other%20PI%20Products%20that%20use%20the%20KST%20are%20not%20installed.%0A%3B%0A%3B%20%20NOPISDKBUFFERING%3D1%20Specify%20this%20option%20to%20update%20the%20PISDK%20buffering%20setting.%20If%20the%20value%20is%20not%20specified%20then%20no%20changes%20are%20made%20to%20users%20configuration.%0A%3B%0A%3B%20%20ONLYSHOWSERVER%3D1%20%20Specifies%20the%20install%20to%20suppress%20all%20dialogs%20except%20DLG_DefaultServer_Info.%20(default%200%20does%20nothing)%0A%3B%0A%3B%20%20AFSDKONLY%3D1%20Specifies%20the%20install%20to%20ONLY%20install%20FD_AFSDK%20on%20a%20clean%20install%2C%20or%20upgrade%20existing%20components%20if%20AFClient%20already%20installed.%0A%3B%0A%3B%20%20SENDTELEMETRY%3D1%20%20%20Specifies%20participation%20in%20the%20PI%20System%20Customer%20Feedback%20Program%20if%20set%20to%201.%20Default%20value%20during%20silent%20installation%20is%200.%0A%3B%0A%3B%20%20SHUTDOWN_OPTIONS%3D2%20%20%20Specifies%20for%20silent%20install%20to%20not%20shutdown%20services%20and%20applications%20that%20have%20the%20AFSDK.dll%20file%20locked%20and%20in%20use%20at%20the%20time%20of%20the%20upgrade.%20%0A%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20The%20default%20behavior%20is%20to%20shutdown%20and%20restart%20applications%20that%20have%20the%20AFSDK.dll%20file%20in%20use%20to%20prevent%20user%20from%20having%20to%20reboot%20box%20at%20end%20of%20installation.%0A%3B%09%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20If%20SHUTDOWN_OPTIONS%3D2%20and%20this%20was%20an%20upgrade%20and%20the%20AFSDK.dll%20file%20was%20in%20use%2C%20then%20an%20automatic%20reboot%20will%20occur%20unless%20the%20REBOOT%3DSuppress%20option%20is%20set.%0A%3B%0A%3B%20%20SKIPLAUNCHCONDITIONS%3D1%20Set%20this%20option%20to%20bypass%20verification%20of%20pre-requistes%20and%20allow%20the%20msi%20to%20install%20even%20when%20a%20condition%20is%20not%20met.%20Setting%20this%20value%20is%20NOT%20a%20recommended%20installation.%0A%3B%20%20%0A%3B%20%20ADDLOCAL%20%20Following%20list%20of%20features%20are%20possible%2C%20property%20is%20case%20sensitive%20and%20does%20not%20allow%20space%3A%0A%3B%09%09FD_AFSDK%09%09%09%09Installs%20the%20AFSDK%20and%20AFRegPlugIn%3B%20it%20is%20required%0A%3B%09%09FD_AFExplorer%09%09%09Installs%20PI%20System%20Explorer%2C%20AFImport%2C%20and%20AFExport%0A%3B%09%09FD_AFBuilder%09%09%09Installs%20the%20PI%20Builder%20add-in%20to%20Excel%0A%3B%09%09FD_AFDocs%09%09%09%09Installs%20the%20help%20files%20%0A%3B%09%09FD_AFAnalysisMgmt%09%09Installs%20the%20Management%20UI%20components.%20The%20default%20behavior%20is%20to%20not%20install%20this%20feature.%0A%3B%09%09FD_AFCollectiveManager%09Installs%20the%20AF%20Collective%20manager.%20The%20default%20behavior%20is%20to%20not%20install%20this%20feature.%20%0A%3B%09%09ALL%09%09%09%09%09%09Installs%20all%20features%0A%3B%20%20%0A11%20%3D%20%2Fqn%20REBOOT%3DSuppress%20ALLUSERS%3D1%20ADDLOCAL%3DFD_AFSDK%2CFD_AFExplorer%2CFD_AFBuilder%2CFD_AFDocs%20CLEANUPKST%3D0%0A12%20%3D%20%2Fqn%20REBOOT%3DSuppress%20ALLUSERS%3D1%20ADDLOCAL%3DFD_AFSDK%2CFD_AFExplorer%2CFD_AFBuilder%2CFD_AFDocs%20CLEANUPKST%3D0%0A%3B%20VSTOWrapper%0A13%20%3D%20%2Fq%20%2Fnorestart%0A%5BUPGRADECOMMANDLINE%5D%0A%3B%20If%20PI%20SDK%20is%20needed%20for%20your%20application%2C%20use%20the%20following%20upgrade%20command%20line%20options%20for%20both%2032%20bit%20and%2064%20bit%20kits%3A%20%0A%3B%20%3D%20REINSTALL%3DALL%20REINSTALLMODE%3Dvemus%0A%5BDISPLAYNAME%5D%0A3%20%3D%20Microsoft%20Visual%20C%2B%2B%202008%20Redistributable%20×86%0A4%20%3D%20Microsoft%20Visual%20C%2B%2B%202008%20Redistributable%20×64%0A%5BVERSION%5D%0A%5BCHECKFORINSTALLEDONLY%5D%0A%5BUNSUPPORTED_OPERATING_SYSTEMS%5D%0A%3B———————————————————————————————————–%0A%3B%20Defined%20Operating%20Systems%0A%3B%20(Win95%2C%20Win98%2C%20WinME%2C%20WinNT%2C%20Win2K%2C%20%20WinXP%2C%20WinNET%2C%20VistaNoSp%2C%20VistaSp1%2C%20Win2008NoSp%2C%20Win2008Sp1%2C%20Win2008R2NoSp)%0A%3B%0A%3B%20If%20Operating%20System%20listed%20with%20NO%20SP%2C%20then%20not%20supported%20on%20that%20OS%20regardless%20of%20SP%20version%20installed.%0A%3B%20If%20Operating%20System%20listed%20with%20SP%2C%20then%20that%20particular%20OS%20has%20a%20service%20pack%20requirement.%20%0A%3B%0A%3B%20A%200%20entry%20denotes%20that%20the%20setup%20can%20not%20run%20on%20the%20given%20operating%20systems.%0A%3B%20Entries%20that%20corresponds%20to%20an%20entry%20in%20the%20%5BSETUPMODULES%5D%20section%20denotes%0A%3B%20that%20the%20particular%20setup%20module%20will%20be%20skipped%20on%20the%20given%20operating%20system%0A%3B———————————————————————————————————–%0A0%20%3D%20Win95%2C%20Win98%2C%20WinME%2C%20WinNT%2C%20Win2K%2C%20WinXP%2C%20WinNET%2C%20Vista%2C%20Win2008NoSp%2C%20Win2008Sp1%2C%20Win2008Sp2%2C%20Win2008SP2_X64_CORE%2C%20Win7NoSp%2C%20Win7Sp1%2C%20Win2008R2NoSp%2C%20Win2008R2Sp1%2C%20Win2008R2SP1_X64_CORE%2C%20Win8NoSp%2C%20Win8Sp1%2C%20Win8Sp2%0A2%20%3D%20CORE%0A3%20%3D%20X64%0A4%20%3D%20X86%0A6%20%3D%20X86%0A8%20%3D%20X64%0A9%20%3D%20X86%0A11%20%3D%20X64%0A12%20%3D%20X86%0A%3BMSI’s%20or%20Setup%20wrapper%20Dll’s%20can%20write%20to%20this%20section%20to%20dynamically%20change%20%0A%3Bthe%20command%20line%20for%20an%20MSI%20at%20setup%20runtime.%0A%5BRUNTIME_PARAMETERS%5D%0A%3BThis%20section%20is%20used%20by%20the%20pre-install%20tasks%20and%20post-install%20tasks.%0A%5BPIBUFSS%5D” message=”” highlight=”” provider=”manual”/]

Are these guys kidding? Millions of options. Actually I could have used that face from Jim Carrey all over the place. Sometimes it is good that webcam doesn’t capture the face when doing this weird stuff.

At least some comments in that file! You can imagine, I checked a lot of variations:

  • which ones are necessary for the program to work correctly?
  • how can I prevent the setup’s demand for restarts?
  • where are restarts probably necessary? This is maybe necessary for installing .net 4.8. So get the right image and skip this installation… and so on.

Finally I arrived with this definition of the setup.ini:

[pastacode lang=”bash” manual=”%5BSETUPKIT%5D%0ANAME%20%3D%20SetupAFClient2_x%0ADISPLAYNAME%20%3D%20PI%20AF%20Client%20%0ASHOWSKIPPEDMODULES%20%3D%20FALSE%0AFEATUREUPGRADE%20%3D%20FALSE%0ASUPPRESSCOMPLETIONMESSAGE%20%3D%20TRUE%0ASUPPRESSPROGRESSMESSAGE%20%3D%20TRUE%0ASUPPRESSHEADERMESSAGE%20%3D%20TRUE%0ASUPPRESSDIALOGS%20%3D%20TRUE%0A%0A%5BNUMSETUPMODULES%5D%0ANUM%20%3D%207%0A%0A%5BSETUPMODULES%5D%0A%23%201%20%3D%20PreInstallTasks%0A%23%202%20%3D%20MSVC9SP1x64Redistrib%0A%23%203%20%3D%20MSRuntimesVS2015u2_x64%0A%23%203%20%3D%20PINS%0A%23%204%20%3D%20AFClient_x64.msi%0A%23%205%20%3D%20PIBufss_x64.msi%0A%23%206%20%3D%20VSTOWrapper%0A%23%201%20%3D%20dotnet48Setup%0A%0A1%20%3D%20PreInstallTasks%0A2%20%3D%20MSVC9SP1x64Redistrib%0A3%20%3D%20MSRuntimesVS2019_x64%0A4%20%3D%20PINS%0A5%20%3D%20AFClient_Net35%0A6%20%3D%20AFClient_x64.msi%0A7%20%3D%20VSTOWrapper%0A%0A%5BCOMMANDLINE%5D%0A%23%201%20%3D%20%0A%23%202%20%3D%20%2Fq%20%2Fnorestart%0A%23%203%20%3D%20%2Fq%20%2Fnorestart%0A%23%203%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20%2Fqn%0A%23%204%20%3D%20%2Fqn%20REBOOT%3DSuppress%20ALLUSERS%3D1%20ADDLOCAL%3DFD_AFSDK%2CFD_AFExplorer%2CFD_AFBuilder%2CFD_AFDocs%20IMPORT_KST%3D1%20KST_INI_FILE%3D%22C%3A%5CPI%5CAFclient%5Ckst.ini%22%0A%23%205%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20%2Fqn%0A%23%206%20%3D%20%2Fq%20%2Fnorestart%0A%0A%23%201%20%3D%20%2Fq%0A1%20%3D%20%0A2%20%3D%20%2Fq%20%2Fnorestart%0A3%20%3D%20%2Fq%20%2Fnorestart%0A4%20%3D%20ALLUSERS%3D1%20REBOOT%3DSuppress%20%2Fqn%0A5%20%3D%20SKIPFULLAFSDKCHECK%3D1%20ALLUSERS%3D1%20REBOOT%3DSuppress%20%2Fqn%0A6%20%3D%20%2Fqn%20REBOOT%3DSuppress%20ALLUSERS%3D1%20ADDLOCAL%3DFD_AFSDK%2CFD_AFExplorer%2CFD_AFBuilder%2CFD_AFDocs%20CLEANUPKST%3D0%0A7%20%3D%20%2Fq%20%2Fnorestart%0A%0A%5BUPGRADECOMMANDLINE%5D%0A%5BDISPLAYNAME%5D%0A%5BVERSION%5D%0A%5BCHECKFORINSTALLEDONLY%5D%0A%5BUNSUPPORTED_OPERATING_SYSTEMS%5D%0A%5BRUNTIME_PARAMETERS%5D%0A%5BPIBUFSS%5D%0A” message=”” highlight=”” provider=”manual”/]

Giving up

I really spent a lot of time.

Implementing the functionality was done in 1.5 weeks. Doing the infrastructure automation took already two days and was completely unsatisfying.

I didn’t make it. There was always a weird error message in setup logs, that was not understandable. I had been pretty creative. Lots of variations. When it takes to much time…

When consuming too much time for a task it looks like you need help

So I contacted the support of OSISoft asking for a docker image from the provider. This was pretty interesting and more a political than a technical issue. OSISoft already has a REST-based Http interface in place that can be used for the same reasons. And I would have loved to use that. But it generates a lot of costs, so it was not feasible to switch to http. God, this would have been eased everything, also the implementation. Anyway.

I always tough times, when I need to confess that something doesn’t work. I tend to spend even more time. Try to kill the issue with more time and effort. Sometimes that does work, but mostly it doesn’t. And then I even spend more time.

It is like to spend money on a project that it is known it is doomed to fail but because there had been an investment it is hard to stop

Okay, change direction. Docker will not work with .net Framework and this massive old-school setup. Let’s have another look onto different options in the next article.

How can .net framework be hosted?

  • Cloud Services
  • Service Fabric
  • Windows Service on a VM

All not the options I wanted, but life’s hard. Follow me to the next one. Even darker.