From 4aa5ac7c852d6db9572b4d8d902be35edee24e5c Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:31:02 +0200 Subject: [PATCH 1/3] feat: add Docker Compose files for testing PyMAPDL - Add comprehensive Docker testing infrastructure - Include multi-profile Docker Compose configuration - Add testing Dockerfile with multiple build targets - Support both local and remote MAPDL testing scenarios - Reorganize Docker MAPDL files structure --- .gitignore | 22 +- docker/MAPDL/.dockerignore | 430 ++++++++++++++++++++++++++++++ docker/MAPDL/Dockerfile | 224 ++++++++++++++++ docker/MAPDL/docker-compose.yml | 142 ++++++++++ docker/MAPDL/make_container.rst | 121 +++++++++ docker/testing/Dockerfile | 217 +++++++++++++++ docker/testing/docker-compose.yml | 253 ++++++++++++++++++ docker/testing/mylocal.ip | 1 + docker/testing/start.sh | 27 ++ 9 files changed, 1426 insertions(+), 11 deletions(-) create mode 100644 docker/MAPDL/.dockerignore create mode 100644 docker/MAPDL/Dockerfile create mode 100644 docker/MAPDL/docker-compose.yml create mode 100644 docker/MAPDL/make_container.rst create mode 100644 docker/testing/Dockerfile create mode 100644 docker/testing/docker-compose.yml create mode 100644 docker/testing/mylocal.ip create mode 100644 docker/testing/start.sh diff --git a/.gitignore b/.gitignore index d36f8c19b86..39de7b26a6f 100755 --- a/.gitignore +++ b/.gitignore @@ -42,21 +42,21 @@ doc/source/images/auto-generated/* # Testing +./Testing/ +.benchmarks/ +.coverage +.pytest_cache/ +.tox/ +*,cover +coverage.xml factory/ -Testing/ -UnitTesting/ -TODO +test-output.xml test.sh -.pytest_cache/ tests/.coverage -tests/htmlcov tests/cyclic/htmlcov -.coverage -*,cover -.benchmarks/ -test-output.xml -coverage.xml -.tox/ +tests/htmlcov +TODO +UnitTesting/ \#* .\#* diff --git a/docker/MAPDL/.dockerignore b/docker/MAPDL/.dockerignore new file mode 100644 index 00000000000..a863ab65268 --- /dev/null +++ b/docker/MAPDL/.dockerignore @@ -0,0 +1,430 @@ +# Files that can be ignored when building MAPDL 2025R1 +# ---------------------------------------------------- +# +# This file is used to specify files and directories that should be ignored by Docker when +# copying files. +# It is similar to .gitignore but specific to Docker. Each line specifies a pattern for files or +# directories to ignore. Lines starting with # are comments and are ignored. +# +# If your docker image does not work properly, check this file to see if you are ignoring files that +# should be included. +# +# NOTE: This files noted here are also ignored when copying between stages in the Dockerfile. +# +.workdir +*_Certified_artifactory/ +*_Certified_artifactory/**/* +*_docker +*_docker/**/* +**/ACP +**/Addins +**/Additive +**/aisol/.clean_ansoft_env.sh +**/aisol/.workbench +**/aisol/AGP +**/aisol/AUTODYN +**/aisol/bin +**/aisol/BladeModeler +**/aisol/CADIntegration +**/aisol/CommonFiles +**/aisol/DesignSpace +**/aisol/dll +**/aisol/EDServices +**/aisol/FEModeler +**/aisol/iceecad_gridcut +**/aisol/lib/linx64/ANSMWGDI +**/aisol/lib/linx64/CREDITS +**/aisol/lib/linx64/libacml_mp.so +**/aisol/lib/linx64/libacml_mv.so +**/aisol/lib/linx64/libaddress_sorting.so +**/aisol/lib/linx64/libans_gil.so +**/aisol/lib/linx64/libans.autodyn.adbatch.so +**/aisol/lib/linx64/libans.autodyn.results_api.so +**/aisol/lib/linx64/libans.cadint.assemblycontainer251.so +**/aisol/lib/linx64/libans.cadint.assemblycontainerdrawing251.so +**/aisol/lib/linx64/libans.cadint.assemblycontainerdrawingold251.so +**/aisol/lib/linx64/libans.cadint.assemblycontainerserializer251.so +**/aisol/lib/linx64/libans.cadint.assemblycontainertesselation251.so +**/aisol/lib/linx64/libans.cadint.assemblycontainervirtualhelper251.so +**/aisol/lib/linx64/libans.cadint.autovt.so +**/aisol/lib/linx64/libans.cadint.brepcomponent251.so +**/aisol/lib/linx64/libans.cadint.brepcomponentmeshinghelper251.so +**/aisol/lib/linx64/libans.cadint.brepcomponenttesselation251.so +**/aisol/lib/linx64/libans.cadint.brepgeometry251.so +**/aisol/lib/linx64/libans.cadint.brepserializer251.so +**/aisol/lib/linx64/libans.cadint.virtualtopo.so +**/aisol/lib/linx64/libans.modelmanager.core.so +**/aisol/lib/linx64/libans.modelmanager.engine.pm.so +**/aisol/lib/linx64/libans.modelmanager.modeladapter.pm.so +**/aisol/lib/linx64/libans.modelmanager.referencemanager.so +**/aisol/lib/linx64/libans.modelmanager.rollmarkmanager.pm.so +**/aisol/lib/linx64/libans.simulation.mechanical.engine.geometry.assemblymodeling.so +**/aisol/lib/linx64/libans.simulation.mechanical.engine.geometry.graphics.so +**/aisol/lib/linx64/libans.simulation.mechanical.engine.geometry.queryengine.so +**/aisol/lib/linx64/libans.simulation.mechanical.engine.geometry.straightlinebody.so +**/aisol/lib/linx64/libAns.X17.APDL.so +**/aisol/lib/linx64/libAns.X17.DPFBridge.so +**/aisol/lib/linx64/libAns.X17.Fluent.so +**/aisol/lib/linx64/libAns.X17.LSDYNA.so +**/aisol/lib/linx64/libAns.X17.Math.so +**/aisol/lib/linx64/libAns.X17.SIMP.so +**/aisol/lib/linx64/libAnsFile.so +**/aisol/lib/linx64/libAnsSupportedInterface.so +**/aisol/lib/linx64/libcadoe.so +**/aisol/lib/linx64/libcares.so +**/aisol/lib/linx64/libcares.so.2.4.1 +**/aisol/lib/linx64/libcoinmetis.so.1 +**/aisol/lib/linx64/libcoinmumps.so.1 +**/aisol/lib/linx64/libComponentSystem.so +**/aisol/lib/linx64/libCUEUnits.so +**/aisol/lib/linx64/libFMACIS_XC.so +**/aisol/lib/linx64/libFMClientServer_WB.so +**/aisol/lib/linx64/libFMCommon_JT.so +**/aisol/lib/linx64/libFMCommon_WB.so +**/aisol/lib/linx64/libFMCommon_XC.so +**/aisol/lib/linx64/libFMCore_JT.so +**/aisol/lib/linx64/libFMCore_WB.so +**/aisol/lib/linx64/libFMCore_XC.so +**/aisol/lib/linx64/libFMDataConversion_JT.so +**/aisol/lib/linx64/libFMDataConversion_WB.so +**/aisol/lib/linx64/libFMDataConversion_XC.so +**/aisol/lib/linx64/libFMJTOpen_JT.so +**/aisol/lib/linx64/libFMMaestro_WB.so +**/aisol/lib/linx64/libFMModelKernel_JT.so +**/aisol/lib/linx64/libFMModelKernel_WB.so +**/aisol/lib/linx64/libFMModelKernel_XC.so +**/aisol/lib/linx64/libFMTGKernel_JT.so +**/aisol/lib/linx64/libFMTGKernel_WB.so +**/aisol/lib/linx64/libFMTGKernel_XC.so +**/aisol/lib/linx64/libFMWB_WB.so +**/aisol/lib/linx64/libgfortran.so +**/aisol/lib/linx64/libgfortran.so.5 +**/aisol/lib/linx64/libgmp.so.10 +**/aisol/lib/linx64/libgpr.so +**/aisol/lib/linx64/libgrpc.so +**/aisol/lib/linx64/libgrpcpp_channelz.so +**/aisol/lib/linx64/libhdf5* +**/aisol/lib/linx64/libifcore.so.5 +**/aisol/lib/linx64/libifport.so.5 +**/aisol/lib/linx64/libimf.so +**/aisol/lib/linx64/libintlc.so.5 +**/aisol/lib/linx64/libiomp5.so +**/aisol/lib/linx64/libipopt.so.1 +**/aisol/lib/linx64/libirc.so +**/aisol/lib/linx64/libLinearAlgebraEigen.so +**/aisol/lib/linx64/libmainwinplugin.so +**/aisol/lib/linx64/libmappingkerneldll.so +**/aisol/lib/linx64/libmessagehandler.so +**/aisol/lib/linx64/libmono-2.0.so.1 +**/aisol/lib/linx64/libmpi.so.1 +**/aisol/lib/linx64/libpgbind.so +**/aisol/lib/linx64/libpgc.so +**/aisol/lib/linx64/libpgf90_rpm1.so +**/aisol/lib/linx64/libpgf90.so +**/aisol/lib/linx64/libpgf902.so +**/aisol/lib/linx64/libpgf90rtl.so +**/aisol/lib/linx64/libpgftnrtl.so +**/aisol/lib/linx64/libpgmp.so +**/aisol/lib/linx64/libPrimeMesh.so +**/aisol/lib/linx64/libprotobuf-lite.so +**/aisol/lib/linx64/libprotobuf-lite.so.3.10.1.0 +**/aisol/lib/linx64/libprotobuf.so +**/aisol/lib/linx64/libprotoc.so +**/aisol/lib/linx64/libprotoc.so.3.10.1.0 +**/aisol/lib/linx64/libpsassemblyrep.so +**/aisol/lib/linx64/libpsbodyshop.so +**/aisol/lib/linx64/libpsgeneric.so +**/aisol/lib/linx64/libpsiges.so +**/aisol/lib/linx64/libpsinterop.so +**/aisol/lib/linx64/libpskernel.so +**/aisol/lib/linx64/libpspropertiesbase.so +**/aisol/lib/linx64/libpspropertiesbrepimporter.so +**/aisol/lib/linx64/libpsstep.so +**/aisol/lib/linx64/libpsxcore.so +**/aisol/lib/linx64/libpsxiges.so +**/aisol/lib/linx64/libpsxlatorbase.so +**/aisol/lib/linx64/libpsxmil.so +**/aisol/lib/linx64/libpsxstep.so +**/aisol/lib/linx64/libQ3DRBFSolver.so +**/aisol/lib/linx64/libquadmath.so.0 +**/aisol/lib/linx64/libStreamBased.so +**/aisol/lib/linx64/libStride.so +**/aisol/lib/linx64/libsvml.so +**/aisol/lib/linx64/libtbbmalloc.so.2 +**/aisol/lib/linx64/libtg.so +**/aisol/lib/linx64/libzmq.so.4 +**/aisol/lib/linx64/LICENSE +**/aisol/lib/linx64/LICENSE/**/* +**/aisol/MotionSolver +**/aisol/Samples +**/aisol/StartPage +**/aisol/WBAddins +**/aisol/WBMWRegistry +**/ans_uninstall251 +**/ansys/bin/.change_ansysdir2022r2 +**/ansys/bin/.change_ansysdir251 +**/ansys/bin/about.admin +**/ansys/bin/ans_admin +**/ansys/bin/ans_admin251 +**/ansys/bin/ansconnect +**/ansys/bin/ansconnect251 +**/ansys/bin/anshelp +**/ansys/bin/anshelp251 +**/ansys/bin/ansslurm +**/ansys/bin/ansslurm251 +**/ansys/bin/anstclsh +**/ansys/bin/anstclsh251 +**/ansys/bin/ansuge +**/ansys/bin/ansuge251 +**/ansys/bin/answish +**/ansys/bin/answish251 +**/ansys/bin/ansysts +**/ansys/bin/ansysts251 +**/ansys/bin/bintst +**/ansys/bin/bintst251 +**/ansys/bin/launcher +**/ansys/bin/launcher251 +**/ansys/bin/launchertcl +**/ansys/bin/launchertcl251 +**/ansys/bin/linx64/.ansys_installed +**/ansys/bin/linx64/lsdyna_dp_mpp.e +**/ansys/bin/linx64/lsdyna_dp.e +**/ansys/bin/linx64/lsdyna_sp_mpp.e +**/ansys/bin/linx64/lsdyna_sp.e +**/ansys/bin/linx64/lsl2a_dp.e +**/ansys/bin/linx64/lsl2a.e +**/ansys/bin/lsdyna +**/ansys/bin/lsdyna251 +**/ansys/bin/lsl2a +**/ansys/bin/lsl2a251 +**/ansys/bin/lsrun +**/ansys/bin/lsrun251 +**/ansys/bin/nlhist +**/ansys/bin/nlhist251 +**/ansys/bin/rdresu +**/ansys/bin/rdresu251 +**/ansys/bin/rdsubs +**/ansys/bin/rdsubs251 +**/ansys/bin/ResRdDemo +**/ansys/bin/ResRdDemo251 +**/ansys/bin/ResWrDemo +**/ansys/bin/ResWrDemo251 +**/ansys/bin/userprog +**/ansys/bin/userprog251 +**/ansys/bin/wrtres +**/ansys/bin/wrtres251 +**/ansys/bin/wrtsub +**/ansys/bin/wrtsub251 +**/ansys/bin/xansadmin.tcl +**/ansys/data +**/ansys/docu/ansadmin.hlp +**/ansys/docu/LS-DYNA_Manual* +**/ansys/gui/en-us/images +**/ansys/gui/en-us/matlib +**/ansys/gui/en-us/resources +**/ansys/gui/en-us/toolbars +**/ansys/lib/analytics +**/ansys/lib/linx64/gpu +**/ansys/lib/linx64/libz.a +**/ansys/lib/scripts +**/ansys/syslib/CPython +**/ansys/syslib/daal/*.a +**/ansys/syslib/daal/libJavaAPI.so* +**/ansys/syslib/daal/libonedal_dpc.so* +**/ansys/syslib/PyQt +**/builddate.txt +**/CADConfigLogs +**/commonfiles/AAS/bin/linx64/AasAgentDotNetCore.dll +**/commonfiles/AAS/bin/linx64/AnsysSessionManager.idl +**/commonfiles/AAS/bin/linx64/APECSwizard.scm +**/commonfiles/AAS/bin/linx64/APECSwizardtool.scm +**/commonfiles/AAS/bin/linx64/CoFluentUnit.idl +**/commonfiles/AAS/bin/linx64/cowrapper.scm +**/commonfiles/AAS/bin/linx64/ExceptionHolderServer +**/commonfiles/AAS/bin/linx64/fluent_journal_unsteady.jou +**/commonfiles/AAS/bin/linx64/fluent_journal.jou +**/commonfiles/AAS/bin/linx64/ICoMapdlUnit.idl +**/commonfiles/AAS/bin/linx64/libApecsCorbaManager.so +**/commonfiles/AAS/bin/linx64/libCFXDllLoader.so +**/commonfiles/AAS/bin/linx64/libCOWrapper.so +**/commonfiles/AAS/bin/linx64/libFluentExceptionClient.so +**/commonfiles/AAS/bin/linx64/libSimulationAasWrapper.so +**/commonfiles/AAS/bin/linx64/libTAO_Codeset.so +**/commonfiles/AAS/bin/linx64/libTAO_Codeset.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_CosProperty.so +**/commonfiles/AAS/bin/linx64/libTAO_CosProperty.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Activator_IDL.so +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Activator_IDL.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Activator.so +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Activator.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Client.so +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Client.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Locator.so +**/commonfiles/AAS/bin/linx64/libTAO_ImR_Locator.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_IORTable.so +**/commonfiles/AAS/bin/linx64/libTAO_IORTable.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_Messaging.so +**/commonfiles/AAS/bin/linx64/libTAO_Messaging.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_PI_Server.so +**/commonfiles/AAS/bin/linx64/libTAO_PI_Server.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_Svc_Utils.so +**/commonfiles/AAS/bin/linx64/libTAO_Svc_Utils.so.3.0.2 +**/commonfiles/AAS/bin/linx64/libTAO_Valuetype.so +**/commonfiles/AAS/bin/linx64/libTAO_Valuetype.so.3.0.2 +**/commonfiles/AAS/bin/linx64/MapdlaaS +**/commonfiles/AAS/bin/linx64/master_journal.jou +**/commonfiles/AAS/bin/linx64/Newtonsoft.Json.dll +**/commonfiles/AAS/bin/linx64/scale001.jpg +**/commonfiles/AAS/bin/linx64/SimulationAasDotNetStandard.dll +**/commonfiles/AAS/bin/linx64/steer.scm +**/commonfiles/branch.txt +**/commonfiles/CAD/examples +**/commonfiles/CAD/Hoops +**/commonfiles/CAD/Parasolid +**/commonfiles/CAD/Siemens +**/commonfiles/CAD/Spatial +**/commonfiles/CAD/TechSoft3D +**/commonfiles/CFX +**/commonfiles/configs +**/commonfiles/CPython +**/commonfiles/DebugControl +**/commonfiles/ensight_components +**/commonfiles/examples +**/commonfiles/fluids +**/commonfiles/Fonts +**/commonfiles/globalsettings +**/commonfiles/help +**/commonfiles/images +**/commonfiles/installer +**/commonfiles/IronPython +**/commonfiles/language/de +**/commonfiles/language/en-us/CAD +**/commonfiles/language/en-us/launcher +**/commonfiles/language/fr +**/commonfiles/language/ko +**/commonfiles/language/zh +**/commonfiles/launcher +**/commonfiles/launcherQt +**/commonfiles/MainWin +**/commonfiles/MPI +**/commonfiles/registry +**/commonfiles/Stride +**/commonfiles/SystemCoupling +**/commonfiles/Textures +**/commonfiles/tools +**/commonfiles/UnitsLibrary +**/commonfiles/WBAddinConfiguration +**/dcs +**/dpf +**/Electronics +**/Framework +**/Images +**/install.id +**/installer +**/licensingclient/linx64/ansysls_client +**/licensingclient/linx64/ClientSettings +**/licensingclient/linx64/libFlxComm64.so.2020.12 +**/licensingclient/linx64/libFlxCore64.so.2020.12 +**/licensingclient/linx64/LicensingSettings +**/licensingclient/linx64/LicensingSettingsUtility +**/licensingclient/linx64/lmutil +**/meshing/Prime +**/ProductConfig.sh +**/RSM +**/SEC +**/SystemCoupling +**/Tools +**/tp/7zip +**/tp/AMD/BLIS/v3.2.1 +**/tp/AMD/BLIS/v4.1.0 +**/tp/AMD/BLIS/v4.1.1 +**/tp/angular-nvd3 +**/tp/angular-ui-context-menu +**/tp/angular-ui-tree +**/tp/angularjs +**/tp/angularjs* +**/tp/angularui +**/tp/bootstrap +**/tp/CUEUnits +**/tp/d3 +**/tp/ffmpeg +**/tp/hdf5/1_12_2/linx64/bin +**/tp/hdf5/1_12_2/linx64/include +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_cpp-serial.a +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_hl_cpp-serial.a +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_hl-serial.a +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_tools-serial.a +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_tools-serial.so +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_tools-serial.so.200 +**/tp/hdf5/1_12_2/linx64/lib/libhdf5_tools-serial.so.200.1.1 +**/tp/hdf5/1_12_2/linx64/lib/libhdf5-serial.a +**/tp/hdf5/1_12_2/linx64/lib/libhdf5.settings +**/tp/hdf5/1_12_2/linx64/lib/pkgconfig +**/tp/hdf5/1_12_2/linx64/share +**/tp/IntelMKL/2020.0.166 +**/tp/IntelMKL/2021.3.0 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_avx.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_avx2.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_avx512.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_blacs_intelmpi_ilp64.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_blacs_intelmpi_ilp64.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_blacs_openmpi_ilp64.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_blacs_openmpi_ilp64.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_cdft_core.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_cdft_core.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_gf_ilp64.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_gf_ilp64.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_gf_lp64.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_gf_lp64.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_intel_ilp64.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_intel_ilp64.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_mc.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_mc3.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_pgi_thread.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_pgi_thread.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_rt.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_rt.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_scalapack_ilp64.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_scalapack_ilp64.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_sequential.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_sequential.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_sycl.so* +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_tbb_thread.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_tbb_thread.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_vml_avx.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_vml_avx2.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_vml_cmpt.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_vml_def.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_vml_mc.so.2 +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/libmkl_vml_mc3.so +**/tp/IntelMKL/2023.1.0/linx64/lib/intel64/locale +**/tp/jquery +**/tp/MPI/Intel/2018.3.222 +**/tp/MPI/Intel/2019.12.320 +**/tp/MPI/Intel/2021.10.0 +**/tp/MPI/Intel/2021.11.0 +**/tp/MPI/Intel/2021.13/linx64/lib/debug +**/tp/MPI/Intel/2021.13/linx64/lib/mpi/debug +**/tp/MPI/Intel/2021.13/linx64/lib/release/libmpi.a +**/tp/MPI/Intel/2021.13/linx64/lib/release/libmpi.dbg +**/tp/MPI/Intel/2021.13/linx64/libfabric/lib/mpi +**/tp/MPI/Intel/2021.13/linx64/libfabric/lib/release +**/tp/MPI/Intel/2021.5.0 +**/tp/MPI/Intel/2021.6.0 +**/tp/MPI/Intel/2021.8.0 +**/tp/MPI/OpenMPI/5.0.0 +**/tp/ngInfiniteScroll +**/tp/nss +**/tp/nvd3 +**/tp/openjre +**/tp/qt +**/tp/qt* +**/tp/signalr +**/tp/zlib +*swo +*swp +Dockerfile +install_licconfig.log +install.err +install.log +workdir \ No newline at end of file diff --git a/docker/MAPDL/Dockerfile b/docker/MAPDL/Dockerfile new file mode 100644 index 00000000000..e860b18b3cf --- /dev/null +++ b/docker/MAPDL/Dockerfile @@ -0,0 +1,224 @@ + +################################# +FROM ubuntu:22.04 as BUILDER +################################# +# Builder stage. +# Used to download and install the MAPDL +# To be built using: +# +# $ TAG=builder +# $ docker build -t $TAG --build-arg VERSION=251 --target BUILDER . + +################################# +# ARGUMENTS +# --------- +# In case you want to build a specific version +ARG VERSION + +################################# +# Download MAPDL +# -------------- +# This stage is highly dependent on your environment. +# Do you have the MAPDL installer in a directory? +# Then... +COPY /path/to/MAPDL/installer_files /MAPDL + +# Or do you have a MAPDL installer in a remote server? +# Then... +RUN wget http://your.server.com/path/to/MAPDL_${VERSION} -O /MAPDL + +################################# +# Install MAPDL dependencies +# -------------------------- +# +RUN apt-get update && \ + apt-get install -y \ + curl \ + libgl1 \ + libglu1 \ + libgomp1 \ + libxcb-icccm4 \ + libxcb-image0 \ + libxcb-keysyms1 \ + libxcb-randr0 \ + libxcb-render-util0 \ + libxcb-render0 \ + libxcb-shape0 \ + libxcb-shm0 \ + libxcb-sync1 \ + libxcb-util1 \ + libxcb-xfixes0 \ + libxcb-xinerama0 \ + libxcb-xkb1 \ + libxi6 \ + libxkbcommon-x11-0 \ + libxkbcommon0 \ + libxm4 \ + openssh-client \ + && apt install -y software-properties-common \ + && add-apt-repository -y ppa:zeehio/libxp \ + && apt-get update \ + && apt-get install -y libxp6 \ + && rm -rf .dockerignore \ + && rm -rf Dockerfile \ + && rm -rf *.log \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +################################# +# Installing MAPDL +# ---------------- +# +RUN mkdir -p /ansys_inc && \ + chmod +x ./MAPDL/linx64/INSTALL && \ + sh ./MAPDL/linx64/INSTALL \ + -install_dir /ansys_inc \ + -nochecks -mechapdl -ansyscust -silent && \ + rm -rf /MAPDL + + +################################# +FROM ubuntu:22.04 as FINAL +################################# +# This is the final stage with the MAPDL installed, and the runtime +# dependencies. It also include some convenience features like: +# +# - Adding a user +# - Adding a working directory +# - Adding an alias to the ansys executable +# - Adding a license server (optional) +# - Adding locale (optional) +# +# To be built using: +# +# $ TAG='mapdl:latest' +# $ docker build -t $TAG --build-arg VERSION=251 --target FINAL . + +################################# +# Arguments +# --------- +# +ARG VERSION + +# Optional arguments +ARG USERNAME=mapdl +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +################################# +# Environment variables +# --------------------- +# Storing version in a env var +ENV ANSYS_VERSION=$VERSION + +# Location env var +ENV AWP_ROOT${VERSION}=/ansys_inc/v${VERSION} + +# Setting home directory +ENV HOME=/home/$USERNAME + +# Setting working directory +ENV WORKING_DIRECTORY=jobs + +# License server +# (Optional) +# ENV LICENSE_SERVER=111.222.333.444 +# ENV ANSYSLMD_LICENSE_FILE=1055@$LICENSE_SERVER + +# OpenMPI env vars +# Uncomment if you want to use OpenMPI with root user +# ENV OMPI_ALLOW_RUN_AS_ROOT=1 +# ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 + +# Setting other env vars +## For MAPDL awareness +ENV ON_DOCKER=TRUE +ENV DEBIAN_FRONTEND=noninteractive + +################################# +# Labels +# ------ +# +# LABELS +LABEL description="MAPDL on Ubuntu" +LABEL email="pyansys.core@ansys.com" + +# OCI LABELS +LABEL org.opencontainers.image.documentation="https://mapdl.docs.pyansys.com" + +################################# +# Installing dependencies +# ----------------------- +# Update packages before packing and +# installing dependencies +RUN apt-get update && \ + apt-get install -y \ + libgomp1 \ + libgl1 \ + libglu1 \ + libxm4 \ + libxi6 \ + openssh-client \ + +# libxp.so missing. This is a workaround +#https://bugs.launchpad.net/ubuntu/+source/libxp/+bug/1517884 +RUN apt install -y software-properties-common \ + && add-apt-repository -y ppa:zeehio/libxp \ + && apt-get update \ + && apt-get install -y libxp6 + +################################# +# Installing locale +# ----------------- +# Adding locales to avoid locale warnings. +# Depending on your environment, you might not need it +# or need to change the locale to your preferred one. +RUN apt-get install -y locales && \ + locale-gen 'en_US.UTF-8' && \ + update-locale LC_ALL='en_US.UTF-8' && \ + sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ + locale-gen && \ + echo -e '\nexport LANG=en_US.UTF-8\nexport LANGUAGE=en_US:en\nexport LC_ALL=en_US.UTF-8' >> ~/.bashrc + +################################# +# Cleaning +# -------- +# Removing unnecessary files and apt cache +RUN rm -rf .dockerignore \ + && rm -rf Dockerfile \ + && rm -rf *.log \ + && apt-get clean && rm -rf /var/lib/apt/lists/* \ + +################################# +# User configuration +# ------------------ +# Add username, create the working directory and make it accessible to any user +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \ + mkdir -p /home/$USERNAME/$WORKING_DIRECTORY \ + && \ + chown -R $USERNAME:$USERNAME /home/$USERNAME/$WORKING_DIRECTORY \ + && \ + chmod a+rwx /home/$USERNAME/$WORKING_DIRECTORY + +USER $USERNAME +WORKDIR /home/$USERNAME/$WORKING_DIRECTORY + +################################# +# Adding MAPDL alias +# ------------------ +# (Optional) Adding alias to ansys executable (for convenience) +# This allows you to run MAPDL using the command "ansys" or "ansysgrpc" +# instead of the full path. +RUN echo 'alias ansys="/ansys_inc/v$ANSYS_VERSION/ansys/bin/mapdl"' >> ~/.bashrc && \ + printf '#!/bin/bash\n/ansys_inc/v$ANSYS_VERSION/ansys/bin/mapdl "$@"' > /usr/bin/ansys && \ + chmod +x /usr/bin/ansys && \ + printf '#!/bin/bash\n/ansys_inc/v$ANSYS_VERSION/ansys/bin/mapdl -grpc "$@"' > /usr/bin/ansysgrpc && \ + chmod +x /usr/bin/ansysgrpc + +################################# +# Setting entrypoint and ports +# ---------------------------- +# +EXPOSE 50052 +ENTRYPOINT [ "bash", "-c", "/ansys_inc/v${ANSYS_VERSION}/ansys/bin/mapdl -grpc -dir ${WORKING_DIRECTORY}"] + diff --git a/docker/MAPDL/docker-compose.yml b/docker/MAPDL/docker-compose.yml new file mode 100644 index 00000000000..32d59b4da6a --- /dev/null +++ b/docker/MAPDL/docker-compose.yml @@ -0,0 +1,142 @@ +# This is a docker-compose file that will run Ansys MAPDL, and optionally DPF, in a container. +# You can connect to this instance through port 50052 and 50055 (for the MAPDL database feature). +# DPF server can be connected to using the port 50056. +# +# For the license, you need to provide the hostname of the license server using ``ANSYSLMD_LICENSE_FILE`` +# environment variable. +# +# REQUIREMENTS: +# ============= +# +# - Docker +# - MAPDL docker images +# - (Optional) DPF docker images +# +# USAGE +# ===== +# +# 1. You need two environment variables. One called `DOCKER_IMAGE` which contains the path to the +# Docker image, and another one called `ANSYSLMD_LICENSE_FILE` which points to the license server. +# For example: +# +# .. code:: bash +# +# export ANSYSLMD_LICENSE_FILE=1055@mylicenseserver +# export DOCKER_IMAGE=myregistry.com/myimage:mytag +# export DPF_DOCKER_IMAGE=myregistry.com/mydpfimage:mydpftag # optional +# +# Additionally you can also configure the following environment variables: +# +# - ``AWP_ROOT``: Set the environment variable ``AWP_ROOTXXX`` where XXX is the MAPDL version. +# For instance, MAPDL 2025R1 is 251. +# - ``AWP_ROOT_VALUE``: Set the value of the ``AWP_ROOTXXX`` environment variable, which normally points +# to the MAPDL installation directory. +# - ``DOCKER_USER``: It should match the username inside the container. You can obtain this value by executing +# ``echo $USER`` in a terminal inside the container. +# +# 2. Run the following command from the ``docker`` directory. +# +# .. code:: bash +# +# cd docker +# docker-compose up -d %service_name% +# +# This docker-compose file contains three services: +# +# - ``mapdl``: Core service. It runs an MAPDL instance with the gRPC server activated, and it open the +# specified port to allow incoming connections to it. +# - ``dpf``: DPF service which can be used for data processing. +# - ``mapdl-local``: Use this service to start an ubuntu docker image with MAPDL installed in it. +# It is said to be running as 'local' because it will mount the parent directory (``../``) in '/home/mapdl/pymapdl' +# This service allow VS Code to attach to it and do development inside the container. +# and it will override the entrypoint to run the 'bash' command. +# +# You can also specify multiple services: +# +# .. code:: bash +# +# docker-compose up -d mapdl dpf +# +# Or use profiles: +# +# +# .. code:: bash +# +# docker-compose --profile dpf up -d +# +# The following profiles are are available: +# +# - ``mapdl`` - Equivalent to run ``docker-compose up -d mapdl``. +# - ``mapdl-dpf`` - Equivalent to run ``docker-compose up -d mapdl dpf``. +# - ``local`` - Equivalent to run ``docker-compose up -d mapdl-local``. +# - ``local-dpf`` - Equivalent to run ``docker-compose up -d mapdl-local dpf``. +# - ``dpf`` - Equivalent to run ``docker-compose up -d dpf``. +# +# Optionally, you can specify the '-d' flag for detached mode (the container will run in the background). +# +# NOTES +# ===== +# +# - ``AWP_ROOT251`` is where Ansys 2025 R1 (v251) is installed. +# + +services: + mapdl: + profiles: + - mapdl + - mapdl-dpf + restart: always + shm_size: '8gb' + container_name: mapdl + mem_reservation: 8g + environment: + - ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE} + - ANSYS_LOCK=OFF + - ${AWP_ROOT:-AWP_ROOT251}=${AWP_ROOT_VALUE:-/ansys_inc} + ports: + - '50052:50052' + - '50055:50055' + image: ${DOCKER_IMAGE} + platform: linux/amd64 + entrypoint: "/bin/bash ansys -grpc" + + dpf: + profiles: + - dpf + - mapdl-dpf + - local-dpf + image: ${DPF_DOCKER_IMAGE} + platform: linux/amd64 + ports: + - '50056:50052' + restart: always + environment: + - ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE} + + mapdl-local: + profiles: + - local + - local-dpf + restart: always + shm_size: '8gb' + container_name: mapdl-local + mem_reservation: 8g + environment: + - ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE} + - ANSYS_LOCK=OFF + - ${AWP_ROOT:-AWP_ROOT251}=${AWP_ROOT_VALUE:-/ansys_inc} + # If also running the `mapdl` service, you need to set different ports + # to avoid conflicts. + ports: + - '50052:50052' + - '50055:50055' + platform: linux/amd64 + image: ${DOCKER_IMAGE} + # Mount the current directory to /home/${DOCKER_USER:-mapdl}/pymapdl + # This allows you to run the container and have access to the current directory + # from inside the container. + # This is useful for development purposes. + volumes: + - ../:/home/${DOCKER_USER:-mapdl}/pymapdl:cached + working_dir: /home/${DOCKER_USER:-mapdl}/pymapdl + entrypoint: /bin/sh -c "echo 'Container is ready. You can now attach to it.'; while sleep 1000; do :; done" diff --git a/docker/MAPDL/make_container.rst b/docker/MAPDL/make_container.rst new file mode 100644 index 00000000000..3751f4475a8 --- /dev/null +++ b/docker/MAPDL/make_container.rst @@ -0,0 +1,121 @@ + +Create your own MAPDL docker container +====================================== + +.. warning:: You need a valid Ansys license and an Ansys account to + follow the steps detailed in this section. + +You can create your own MAPDL docker container following +the steps given in this page. +This guide will use a local Ubuntu machine to generate the needed +files for the MAPDL container by installing Ansys products first +and then copy the generated files to the container. + + +Requirements +============ + +* A linux machine, preferable with Ubuntu 20.04 or later. + CentOS Linux distribution is not supported anymore. + This machine needs to have `Docker `_ installed. + +* A valid Ansys account. Your Ansys reseller should have + provide you with one. + +* The following provided files: + + * `Dockerfile `_ + * `.dockerignore `_ + + +Procedure +========= + +Download Ansys MAPDL installation files +--------------------------------------- + +Download latest Ansys MAPDL version from the customer portal +(`Current Release `_). +You need to have a valid Ansys account with access to +products downloads. + +If you lack of an Ansys account, please contact your +IT manager. + + +Install Ansys MAPDL product +--------------------------- + +To install Ansys MAPDL product on an Ubuntu machine you can follow +:ref:`install_mapdl` if you are using the graphical user interface +or :ref:`installing_ansys_in_wsl` for the command line interface. +The later approach can be reused with small changes in a +continuous integration workflow. + +To reduce the size of the final image, you might want to +install the minimal files by using: + +.. code:: console + + sh /path-to-mapdl-installer \ + -install_dir /path-to-install-mapdl/ \ + -nochecks -mechapdl -ansyscust -silent + +This command install Mechanical MAPDL (``-mechapdl``) and the +custom routines (``-ansyscust``) such as UPF. + +Please take note of where you are installing ANSYS because the +directory path is need in the following section. + +Build Docker image +------------------ + +To build the Docker image, you need to create a directory and copy +all the files you need in the image. + +The steps to copy those files and build the image are detailed in the following script, +which you should modify to adapt it to your needs. + +.. code:: dockerfile + + # Creating working directory + mkdir docker_image + cd docker_image + + # Copying the docker files + cp ./path-to-pymapdl/pymapdl/docker/Dockerfile . + cp ./path-to-pymapdl/pymapdl/docker/.dockerignore . + + # Creating env vars for the Dockerfile + export VERSION=242 # MAPDL version + export TAG="v242" # docker container tag + export MAPDL_PATH=/path_to_mapdl_installation/ansys_inc + + # Build Docker image + sudo docker build -t $TAG --build-arg VERSION=$VERSION --build-arg MAPDL_PATH=$MAPDL_PATH . + +Please notice that: + +* ``path-to-pymapdl`` is the path where PyMAPDL repository is located. +* ``path_to_mapdl_installation`` is the path to where you have locally installed ANSYS MAPDL. + +Not all the installation files are copied, in fact, the files ignored during the copying +are detailed in the file `.dockerignore `_. + +The Docker container configuration needed to build the container is detailed in the +`Dockerfile `_. + + +Summary +======= + + +* **Step 1:** Download latest Ansys MAPDL version from the customer portal + (`Current Release `_). + +* **Step 2:** Install Ansys MAPDL in a known folder. You can reuse your local + installation if it is updated and the machine is running the same Ubuntu + version as the targe Ubuntu docker version. + +* **Step 3:** Build the docker image with the provided Docker configuration files + and script. diff --git a/docker/testing/Dockerfile b/docker/testing/Dockerfile new file mode 100644 index 00000000000..44467219d36 --- /dev/null +++ b/docker/testing/Dockerfile @@ -0,0 +1,217 @@ +# PyMAPDL docker image that runs the tests. + +# Dummy default so there is no error if not set. +# It needs to be set here because we are using it +# later on the FROM. +ARG DOCKER_IMAGE=mapdl:latest + +####################################################### +FROM ubuntu:22.04 AS python-main +####################################################### + +ARG USE_LOCAL_REPO=yes +ARG PYTHON_VERSION=3.11 + +ENV USE_LOCAL_REPO=${USE_LOCAL_REPO} + +# Set workdir +WORKDIR /workspace + +# Install system dependencies +RUN apt-get update && \ + apt-get install -y \ + libgl1-mesa-glx \ + xvfb \ + libgomp1 \ + graphviz \ + git \ + openssh-client + +# Clone to install the libraries needed +RUN git clone https://github.com/ansys/pymapdl.git . + +RUN apt-get update && apt install -y \ + python${PYTHON_VERSION}-venv \ + python3-pip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Upgrade pip and install test dependencies +RUN \ + python${PYTHON_VERSION} -m pip install --upgrade pip && \ + pip install .[tests] + +# Configuration +# ------------- +# Variable for running as if it were on CICD while testing +ENV ON_CI=True +# Tu simulate running on local machine +ENV ON_LOCAL=False +# For tests that check if running on ubuntu. +ENV ON_UBUNTU=False +# Some tests check if running on student machines +ENV ON_STUDENT=False + +# PyMAPDL testing env vars +# ------------------------ +# To work without a screen. +ENV PYANSYS_OFF_SCREEN=True +# Enable debugging for PyMAPDL +ENV PYMAPDL_DEBUG_TESTING=True +# To connect to an already alive or remote MAPDL instance +ENV PYMAPDL_START_INSTANCE=False +# Set MAPDL port to connect to +ENV PYMAPDL_PORT=50052 + +# DPF testing +# ----------- +# Not testing against DPF +# +# To connect to a remote DPF server +ENV DPF_START_SERVER=False +# Simulate not having DPF +ENV HAS_DPF=False +# Not testing DPF-Results backend +ENV TEST_DPF_BACKEND=False +# MAPDL and DPF are running on the same container +ENV ON_SAME_CONTAINER=False + +# Pytest settings +# --------------- +ENV PYTEST_ARGUMENTS="-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers" + +# Setting entrypoint +# ------------------ +COPY start.sh / +RUN chmod +x /start.sh + +EXPOSE 50052 + +RUN git config --global --add safe.directory /workspace/pymapdl + +CMD [ "/bin/bash", "/start.sh" ] + +####################################################### +FROM python-main AS test-clone-pymapdl +####################################################### + +ENV USE_LOCAL_REPO=false + +####################################################### +FROM python-main AS test-local-pymapdl +####################################################### + +ENV USE_LOCAL_REPO=true + +# Remove cloned repo so the local repo can be mounted. +RUN rm -rf /workspace/* >/dev/null 2>&1 + +####################################################### +FROM ubuntu:22.04 AS mapdl-local +####################################################### + +ARG USERNAME=mapdl +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +ENV DEBIAN_FRONTEND=noninteractive +ENV USERNAME=$USERNAME + +# OS configuration +# ---------------- +# Installing dependencies +RUN apt-get update && \ + apt-get install -y \ + libgomp1 \ + libgl1 \ + libglu1 \ + libxm4 \ + libxi6 \ + openssh-client \ + && apt install -y software-properties-common \ + && add-apt-repository -y ppa:zeehio/libxp \ + && apt-get update \ + && apt-get install -y libxp6 \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +####################################################### +FROM ${DOCKER_IMAGE} AS mapdl-local-container-pymapdl +####################################################### +# +# WARNING: This container is designed to work using an Ubuntu base image. +# +ARG PYTHON_VERSION=3.11 + +# OS configuration +# ---------------- +# Installing dependencies +RUN apt-get update && \ + apt-get install -y \ + libgl1-mesa-glx \ + xvfb \ + libgomp1 \ + graphviz \ + git \ + openssh-client + +# Clone to install the libraries needed +RUN git clone https://github.com/ansys/pymapdl.git . + +RUN python3 --version || (apt-get update && apt install -y \ + python${PYTHON_VERSION}-venv \ + python3-pip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*) + +# Upgrade pip and install test dependencies +RUN \ + python3 -m pip install --upgrade pip && \ + pip install .[tests] + +# Configuration +# ------------- +# Variable for running as if it were on CICD while testing +ENV ON_CI=True +# To simulate running on local machine +ENV ON_LOCAL=True +# For tests that check if running on ubuntu. +ENV ON_UBUNTU=False +# Some tests check if running on student machines +ENV ON_STUDENT=False + +# PyMAPDL testing env vars +# ------------------------ +# To work without a screen. +ENV PYANSYS_OFF_SCREEN=True +# Enable debugging for PyMAPDL +ENV PYMAPDL_DEBUG_TESTING=True +# To connect to an already alive or remote MAPDL instance +ENV PYMAPDL_START_INSTANCE=False +# Set MAPDL port to connect to +ENV PYMAPDL_PORT=50052 + +# DPF testing +# ----------- +# Not testing against DPF +# +# To connect to a remote DPF server +ENV DPF_START_SERVER=False +# Simulate not having DPF +ENV HAS_DPF=False +# Not testing DPF-Results backend +ENV TEST_DPF_BACKEND=False +# MAPDL and DPF are running on the same container +ENV ON_SAME_CONTAINER=False + +# Pytest settings +# --------------- +ENV PYTEST_ARGUMENTS='-vvv -ra --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile --report-log-exclude-logs-on-passed-tests --strict-markers' + +# Setting entrypoint +# ------------------ +COPY start.sh / +RUN chmod +x /start.sh + +EXPOSE 50052 + +CMD [ "/bin/bash", "/start.sh" ] diff --git a/docker/testing/docker-compose.yml b/docker/testing/docker-compose.yml new file mode 100644 index 00000000000..a84d1c3750e --- /dev/null +++ b/docker/testing/docker-compose.yml @@ -0,0 +1,253 @@ +# PyMAPDL docker compose testing +# +# This docker compose file is used to test PyMAPDL against different MAPDL installations. +# It allows you to run tests against a local MAPDL installation, a cloned PyMAPDL +# repository, or a remote MAPDL installation. +# +# Required environment variables +# ------------------------------ +# +# - `ANSYSLMD_LICENSE_FILE` for the license server required in all MAPDL configurations +# - See each service definition for additional environment variables +# +# Available profiles +# ------------------ +# +# This docker compose works using profiles. The are many profiles, depending on the following +# configurations possible: +# +# - MAPDL acting as remote (`mapdl-remote`) or local (`mapdl-local`) +# - MAPDL from a container (`mapdl-xxx-container`) or from the host (`mapdl-xxx-host`) +# - PyMAPDL cloned from Github (`pymapdl-clone`) or from the host (`pymapdl-host`) +# +# Because of this configuration there are two main groups of profiles, based on MAPDL or PyMAPDL. +# +# - MAPDL profiles: +# - mapdl-remote-container +# - mapdl-remote-host +# - mapdl-local-container +# - mapdl-local-host +# +# - PyMAPDL profiles +# - pymapdl-clone +# - pymapdl-host +# +# You can specify each one with `--profile `. For instance: +# +# ``` +# docker compose --profile mapdl-remote-container --profile pymapdl-clone +# ``` +# +# which is equivalent to: +# +# ``` +# docker compose --profile mapdl-remote-container-pymapdl-clone +# ``` +# +# The full list of profiles already available for testing is: +# +# - [x] mapdl-remote-container-pymapdl-clone +# - [x] mapdl-remote-container-pymapdl-host +# - [x] mapdl-remote-host-pymapdl-clone +# - [x] mapdl-remote-host-pymapdl-host +# +# - [ ] mapdl-local-container-pymapdl-host +# - [ ] mapdl-local-host-pymapdl-host +# - [w] mapdl-local-container-pymapdl-clone +# - [w] mapdl-local-host-pymapdl-clone +# +# The list of profiles not implemented yet are: +# +# +# +# Example usage +# ------------- +# +# docker compose --profile local-repository --profile mapdl-container up +# + +name: pymapdl-testing + +services: + mapdl-remote-container: + # This service is used to run MAPDL in a remote container. + # + # Environment variables + # --------------------- + # - `ANSYSLMD_LICENSE_FILE` (mandatory) for the license server + # - `DOCKER_IMAGE` (mandatory) environment variable to specify the image to use. + # - `MAPDL_ENTRYPOINT` to specify the entrypoint for the container. + # - `MAPDL_EXEC_PATH` to specify the path to the MAPDL executable. + # - `MAPDL_EXTRA_ARGS` to specify any additional arguments for the MAPDL command. + # + container_name: mapdl + profiles: + - mapdl-remote-container + - mapdl-remote-container-pymapdl-clone + - mapdl-remote-container-pymapdl-host + - default + shm_size: '2gb' + restart: unless-stopped + hostname: mapdl + networks: + - pymapdl-net + environment: + - ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE} + - ANSYS_LOCK=OFF + image: ${DOCKER_IMAGE} + platform: linux/amd64 + # You might want to customize it + entrypoint: ${MAPDL_ENTRYPOINT:-"/bin/bash"} + command: [ + "${MAPDL_EXEC_PATH:-ansys}", + "-grpc", + "${MAPDL_EXTRA_ARGS:-}" + ] + working_dir: /workspace + volumes: + # Required for v261 onwards. + - ./mylocal.ip:/workspace/mylocal.ip:ro + + mapdl-remote-host: + # This service is used to run the local MAPDL instalation by mounting the volume + # inside the container. + # This is using an ubuntu container with the required dependencies to mount the directory + # where MAPDL is installed, and then run MAPDL. + # + # Environment variables + # --------------------- + # + # - `ANSYSLMD_LICENSE_FILE` (mandatory) for the license server. + # - `ANSYS_INC` (mandatory) the installation directory `ansys_inc` of MAPDL. + # - `MAPDL_EXEC_PATH` (mandatory) the path to the MAPDL executable. The default is `ansys`. + # - `MAPDL_ENTRYPOINT` (optional) the entrypoint to the MAPDL container. The default is `"/bin/bash"`. + # - `MAPDL_EXTRA_ARGS` (optional) any additional arguments for the MAPDL command. + # + container_name: mapdl + profiles: + - mapdl-remote-host + - mapdl-remote-host-pymapdl-clone + - mapdl-remote-host-pymapdl-host + shm_size: '2gb' + restart: unless-stopped + hostname: mapdl + networks: + - pymapdl-net + environment: + - ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE} + - ANSYS_LOCK=OFF + platform: linux/amd64 + build: + context: . + dockerfile: Dockerfile + target: mapdl-local + entrypoint: ${MAPDL_ENTRYPOINT:-"/bin/bash"} + command: ["${MAPDL_EXEC_PATH:-ansys}", "-grpc", "${MAPDL_EXTRA_ARGS:-}"] + volumes: + - ${ANSYS_INC:-/ansys_inc}:/ansys_inc:ro + + pymapdl-host: + # This service mount the local PyMAPDL repository and test it. + profiles: + - pymapdl-host + - mapdl-remote-container-pymapdl-host + - mapdl-remote-host-pymapdl-host + - mapdl-local-container-pymapdl-host + - mapdl-local-host-pymapdl-host + container_name: pymapdl-test + platform: linux/amd64 + networks: + - pymapdl-net + build: + context: . + dockerfile: Dockerfile + target: test-local-pymapdl + environment: + - PYMAPDL_IP=mapdl # Use the MAPDL service name + # If empty, it will use the default 'main' branch + - PYMAPDL_BRANCH=${PYMAPDL_BRANCH:-main} + working_dir: /workspace/pymapdl + volumes: + - ../../../:/workspace + + pymapdl-clone: + # This service clones the PyMAPDL repository and test against it. + profiles: + - pymapdl-clone + - mapdl-remote-container-pymapdl-clone + - mapdl-remote-host-pymapdl-clone + - mapdl-local-container-pymapdl-clone + - mapdl-local-host-pymapdl-clone + - default # Default profile + # container_name: pymapdl-test + platform: linux/amd64 + networks: + - pymapdl-net + build: + context: . + dockerfile: Dockerfile + target: test-clone-pymapdl + environment: + - PYMAPDL_IP=mapdl # Use the MAPDL service name + # If empty, it will use the default 'main' branch + - PYMAPDL_BRANCH=${PYMAPDL_BRANCH:-main} + + mapdl-local-container-pymapdl-clone: + # This service clones PyMAPDL inside the MAPDL container and run the tests. + # + # WARNING: It is very likely you will have to update your dockerfile according the specific + # ${DOCKER_IMAGE} you are using. + # + # Environment variables + # --------------------- + # + # - `ANSYSLMD_LICENSE_FILE` (mandatory) for the license server. + # + profiles: + - mapdl-local-container-pymapdl-clone + container_name: pymapdl-test + platform: linux/amd64 + networks: + - pymapdl-net + build: + context: . + dockerfile: Dockerfile + target: mapdl-local-container-pymapdl + args: + - DOCKER_IMAGE=${DOCKER_IMAGE} + environment: + # If empty, it will use the default 'main' branch + - PYMAPDL_BRANCH=${PYMAPDL_BRANCH:-main} + + mapdl-local-container-pymapdl-host: + # This service clones PyMAPDL inside the MAPDL container and run the tests. + # + # WARNING: It is very likely you will have to update your dockerfile according the specific + # ${DOCKER_IMAGE} you are using. + # + # Environment variables + # --------------------- + # + # - `ANSYSLMD_LICENSE_FILE` (mandatory) for the license server. + # + profiles: + - mapdl-local-container-pymapdl-host + container_name: pymapdl-test + platform: linux/amd64 + networks: + - pymapdl-net + build: + context: . + dockerfile: Dockerfile + target: mapdl-local-container-pymapdl + args: + - DOCKER_IMAGE=${DOCKER_IMAGE} + environment: + # If empty, it will use the default 'main' branch + - PYMAPDL_BRANCH=${PYMAPDL_BRANCH:-main} + volumes: + - ../../../:/workspace + +networks: + pymapdl-net: + driver: bridge \ No newline at end of file diff --git a/docker/testing/mylocal.ip b/docker/testing/mylocal.ip new file mode 100644 index 00000000000..d690dc0d591 --- /dev/null +++ b/docker/testing/mylocal.ip @@ -0,0 +1 @@ +0.0.0.0 diff --git a/docker/testing/start.sh b/docker/testing/start.sh new file mode 100644 index 00000000000..e5369a929b5 --- /dev/null +++ b/docker/testing/start.sh @@ -0,0 +1,27 @@ +#! /bin/bash + +echo "===============================================" +echo "Running tests in PyMAPDL Testing environment..." +echo "===============================================" +echo "" + +# Checkout to the specified branch if PYMAPDL_BRANCH is set +if [ -n "${PYMAPDL_BRANCH}" ]; then + echo "PYMAPDL_BRANCH is set to '${PYMAPDL_BRANCH}'. Checking out this branch..." + git fetch origin "${PYMAPDL_BRANCH}" > /dev/null 2>&1 + git checkout "${PYMAPDL_BRANCH}" +fi + +if [[ "${USE_LOCAL_REPO}" == "true" ]]; then + echo "Using local PyMAPDL repository for testing." + # Uncomment if you expect changes in the dependencies. + # python3 -m pip install '.[tests]' + +else + echo "Using cloned PyMAPDL repository for testing." +fi + +echo "Using pytest arguments: ${PYTEST_ARGUMENTS}" + +# shellcheck disable=SC2086 +xvfb-run pytest ${PYTEST_ARGUMENTS} \ No newline at end of file From 019a55c191d331b246df03930bbd1cfbed9d01d1 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 22 Oct 2025 11:40:50 +0000 Subject: [PATCH 2/3] chore: adding changelog file 4274.added.md [dependabot-skip] --- doc/changelog.d/4274.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/4274.added.md diff --git a/doc/changelog.d/4274.added.md b/doc/changelog.d/4274.added.md new file mode 100644 index 00000000000..edee8ce6a53 --- /dev/null +++ b/doc/changelog.d/4274.added.md @@ -0,0 +1 @@ +Add Docker Compose files for testing PyMAPDL From 18b50cd1492fc144e5f5adf32ae1876b17d8ccbc Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:59:43 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docker/MAPDL/Dockerfile | 2 +- docker/testing/Dockerfile | 2 +- docker/testing/docker-compose.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/MAPDL/Dockerfile b/docker/MAPDL/Dockerfile index e860b18b3cf..06128dd60bf 100644 --- a/docker/MAPDL/Dockerfile +++ b/docker/MAPDL/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && \ && rm -rf .dockerignore \ && rm -rf Dockerfile \ && rm -rf *.log \ - apt-get clean && rm -rf /var/lib/apt/lists/* + && apt-get clean && rm -rf /var/lib/apt/lists/* ################################# # Installing MAPDL diff --git a/docker/testing/Dockerfile b/docker/testing/Dockerfile index 44467219d36..9f9a46e2a1e 100644 --- a/docker/testing/Dockerfile +++ b/docker/testing/Dockerfile @@ -45,7 +45,7 @@ RUN \ # ------------- # Variable for running as if it were on CICD while testing ENV ON_CI=True -# Tu simulate running on local machine +# To simulate running on local machine ENV ON_LOCAL=False # For tests that check if running on ubuntu. ENV ON_UBUNTU=False diff --git a/docker/testing/docker-compose.yml b/docker/testing/docker-compose.yml index a84d1c3750e..c8c7c181873 100644 --- a/docker/testing/docker-compose.yml +++ b/docker/testing/docker-compose.yml @@ -13,7 +13,7 @@ # Available profiles # ------------------ # -# This docker compose works using profiles. The are many profiles, depending on the following +# This docker compose works using profiles. There are many profiles, depending on the following # configurations possible: # # - MAPDL acting as remote (`mapdl-remote`) or local (`mapdl-local`)