We have an application which uses AFSDK to query elements and attributes from PI AF and we were wondering if it was possible to containerize this application. Its OK if its on Windows containers.
Unfortunately the currently shipping version of the AF SDK will not work in a container. We are looking into whether there are enough customer demand for this. Can you provide some additional details on what your application does and what you hope to achieve with containerization?
We have an application that relies on PIAF SDK to automate the creation of AF Attributes data analyses. This application will have multiple instances globally and we were looking into containerization to improve deployment routines.
Thank you for the information. Just for clarification, can you explain what "data analyses" means?
Hi Stephen Kwan ! I have the same question. Can you explain in more technical details the reason why PI AFSDK do not work within an Docker container?
Well maybe "will not work" is too strong. A better description is that it's currently not supported by OSIsoft. If you call tech support, they won't be able to help you.
AF SDK currently requires the full version of .NET, thus it would only work in a Windows container. A typical AF SDK application uses Windows Active Directory, therefore your application would have to account for that in a containers deployment.
So, considering that OSISoft does not support it for the AF SDK, we can still do that using the PI Web API, right? Or will the same issue happen?
I thought you would like to know that we found a way to do this. Turns out that AFSDK installer comes with a file to run the installation silently (silent.ini), so you can follow the steps (reference:
Let me clarify my previous response. We currently do not support AF SDK applications running in a container. While you can install AF SDK in a container, as you have pointed out, but the applications that use the AF SDK may or may not work properly.
I had to research function of AFSDK on docker container with my work.I tried to install it And I could connect to PIDA & get current value of tag as a test.So I share how to do it.
(Sorry for my poor english...)
System Configuration for this test
Docker Server OS : Windows 10 pro (OS running on Nested Hyper-V VM)AFSDK Version : PI AFClient 2018 SP3 Patch1Base image of container : mcr.microsoft.com/windows/servercore:ltsc2019PIDA Version : 2015R2 with KB01332 (running on HOST OS) ->(Make sure TCP/5450 is permitted and PITrust for Docker Container is established)
Preparation & Docker Image BuildDownload AFClient installer and extract all.Edit "silent.ini" (refer to my ini file I attached it.).Select All files&silent.ini and right-click->Send->Zip file. Then rename it as "AFClient.zip".Make a new text file and name it as "kst.ini" and edit it (refer to my ini file).Download my dockerfile.Make sure AFClient.zip & kst.ini & dockerfile are located in same folder.Then build a Docker Image.
AFSDK Installation & Testing on Docker ContainerMake(run) a Container and execute powershell on it.Then, PS>cd C:\PI\AFClient PS>Start-Process "Setup.exe" "-f silent.ini" -PassThru | Wait-ProcessWait a few minutes.After Installation finished, Test the connection to PIDA. PS>[System.Reflection.Assembly]::LoadWithPartialName("OSISoft.AFSDK") #AFSDK information will be displayed PS>$PI=New-Object OSIsoft.AF.PI.PIServers PS>$PI.Connect() PS>$PI.DefaultPIServer #If PIDA information is displayed, AFSDK installation (test) is succeeded.
Then, try to run your AFSDK application.(I tried to get value from PIDA with my test App and succeeded).*Installation of AFSDK will failed if its step wrote in dockerfile
I don't try
1.Connect to PIAF2.Get AF Elements or others3.Write Value to PIDA(Maybe writing value is needed to setup buffer connection with PIPowershell or other)
Never forget that OSIsoft doesn't support AFSDK on Docker in this time.
(I hope AFSDK on docker container is supported in a future.)
Retrieving data ...