Hello,
I'm trying to build a Linux Docker container so as to be able to automate runs for parametric analysis, e.g., figure out how certain simulation outputs change based on changes on inputs. I don't want to run the UI - I just want to run it in headless mode.
Below is the Dockerfile I used to create the Docker image. It has...
Ubuntu 20.04 as a base
Python version: 3.8.10
Mono version: 6.12.0.122
DWSIM version: 7.1.2
pythonnet version: 2.5.2
FROMubuntu:20.04RUNaptupdateRUNaptupgrade-y# Set timezone variables for tzdataENVTZ=Asia/KolkataRUNln-snf/usr/share/zoneinfo/$TZ/etc/localtime&&echo$TZ>/etc/timezone# Install python, pip, vi and wgetRUNaptinstall-yvimpython3python3-pipwget# Install mono based on https://www.mono-project.com/download/stable/#download-linRUNaptinstall-ygnupgca-certificatesRUNapt-keyadv--keyserverhkp://keyserver.ubuntu.com:80--recv-keys3FA7E0328081BFF6A14DA29AA6A19B38D3D831EFRUNecho"deb https://download.mono-project.com/repo/ubuntu stable-focal main"|tee/etc/apt/sources.list.d/mono-official-stable.listRUNaptupdateRUNaptinstall-ymono-complete# Install pythonnetRUNpipinstallpythonnet# Download and install DWSIMRUNwgethttps://downloads.sourceforge.net/project/dwsim/DWSIM/DWSIM%207.1/7.1.2/dwsim_7.1.2-amd64.debRUNaptinstall-y./dwsim_7.1.2-amd64.deb
Within the running container, I use this python file to try and create a flowsheet. It is based on the sample code in section 34.5.5 of the user guide - but it does not have the pythoncom import because I can't install pywin32 on linux.
When I try and run this file though, it crashes when the Automation2 object is being initialised:
InitializingDWSIMAutomationInterface...*Assertionatassembly.c:1939,condition`is_ok(hook_error)' not met, function:mono_assembly_invoke_load_hook_internal, (null) assembly:/usr/lib/mono/4.5/mscorlib.dll type:ReflectionTypeLoadException member:(null)=================================================================NativeCrashReporting=================================================================GotaSIGABRTwhileexecutingnativecode.Thisusuallyindicatesafatalerrorinthemonoruntimeoroneofthenativelibrariesusedbyyourapplication.==================================================================================================================================Nativestacktrace:=================================================================0x7f63571ab13b-/lib/libmonosgen-2.0.so.1:0x7f63571ab4cd-/lib/libmonosgen-2.0.so.1:0x7f63571363c7-/lib/libmonosgen-2.0.so.1:0x7f63571aa6bc-/lib/libmonosgen-2.0.so.1:0x7f635790b210-/lib/x86_64-linux-gnu/libc.so.6:0x7f635790b18b-/lib/x86_64-linux-gnu/libc.so.6:gsignal0x7f63578ea859-/lib/x86_64-linux-gnu/libc.so.6:abort0x7f6357098384-/lib/libmonosgen-2.0.so.1:0x7f635737f4e5-/lib/libmonosgen-2.0.so.1:0x7f635739a8ae-/lib/libmonosgen-2.0.so.1:0x7f635739af63-/lib/libmonosgen-2.0.so.1:monoeg_assertion_message0x7f63572182e3-/lib/libmonosgen-2.0.so.1:0x7f6357219176-/lib/libmonosgen-2.0.so.1:0x7f635721b343-/lib/libmonosgen-2.0.so.1:0x7f635720b2d5-/lib/libmonosgen-2.0.so.1:0x7f635720b3cf-/lib/libmonosgen-2.0.so.1:0x7f635720d075-/lib/libmonosgen-2.0.so.1:0x7f63572158b1-/lib/libmonosgen-2.0.so.1:0x7f635721a5ed-/lib/libmonosgen-2.0.so.1:0x7f635721c00d-/lib/libmonosgen-2.0.so.1:0x7f635721ce29-/lib/libmonosgen-2.0.so.1:mono_assembly_load_reference0x7f6357224dfb-/lib/libmonosgen-2.0.so.1:mono_class_from_typeref_checked0x7f63572250d5-/lib/libmonosgen-2.0.so.1:mono_class_get_checked0x7f635722a0bd-/lib/libmonosgen-2.0.so.1:0x7f6357225105-/lib/libmonosgen-2.0.so.1:mono_class_get_checked0x7f635724a17d-/lib/libmonosgen-2.0.so.1:0x7f635724a307-/lib/libmonosgen-2.0.so.1:0x7f6357261c1c-/lib/libmonosgen-2.0.so.1:0x403fd468-Unknown=================================================================TelemetryDumper:=================================================================Pkilling0x140064592635648xfrom0x140064645420864xEnteringthreadsummarizerpausefrom0x140064645420864xFinishedthreadsummarizerpausefrom0x140064645420864x.Aborted
I've tried to run a couple of troubleshooting tests as specified on a couple of the other topics but I'm not familiar with mono or C# so I don't know if I'm doing them right. I'm not sure if I'm missing a package or whether there's some sort of incompatibility between the software versions I'm using. Any thoughts on what's going wrong? Any help would be greatly appreciated.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm trying to build a Linux Docker container so as to be able to automate runs for parametric analysis, e.g., figure out how certain simulation outputs change based on changes on inputs. I don't want to run the UI - I just want to run it in headless mode.
Below is the Dockerfile I used to create the Docker image. It has...
Ubuntu 20.04 as a base
Python version: 3.8.10
Mono version: 6.12.0.122
DWSIM version: 7.1.2
pythonnet version: 2.5.2
Within the running container, I use this python file to try and create a flowsheet. It is based on the sample code in section 34.5.5 of the user guide - but it does not have the pythoncom import because I can't install pywin32 on linux.
When I try and run this file though, it crashes when the Automation2 object is being initialised:
I've tried to run a couple of troubleshooting tests as specified on a couple of the other topics but I'm not familiar with mono or C# so I don't know if I'm doing them right. I'm not sure if I'm missing a package or whether there's some sort of incompatibility between the software versions I'm using. Any thoughts on what's going wrong? Any help would be greatly appreciated.
Thanks!
I also tried the test file located here (with a minor modification for the path of the file to be loaded): https://github.com/DanWBR/DWSIM.Automation.Test.macOS/blob/master/DWSIM.Automation.Test.macOS/Program.cs
within the container. This did initialize the automation interface, but then gave a whole bunch of other errors: