From 3073f08e382058fd3297bbf0c1971a33e96541f4 Mon Sep 17 00:00:00 2001 From: German Martinez Date: Fri, 8 Sep 2023 19:54:55 +0200 Subject: [PATCH 01/15] Supporting launching MAPDL from WSL --- src/ansys/mapdl/core/launcher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 0dab6cfc86..a9249b8c45 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -60,6 +60,9 @@ CONFIG_FILE = os.path.join(SETTINGS_DIR, "config.txt") ALLOWABLE_MODES = ["corba", "console", "grpc"] +ON_WSL = bool(os.environ.get("WSL_DISTRO_NAME", None)) or bool( + os.environ.get("WSL_INTEROP", None) +) LOCALHOST = "127.0.0.1" MAPDL_DEFAULT_PORT = 50052 @@ -524,7 +527,7 @@ def launch_grpc( LOG.debug("Checking file error is created") _check_file_error_created(run_location, timeout) - if os.name == "posix": + if os.name == "posix" and not ON_WSL: LOG.debug("Checking if gRPC server is alive.") _check_server_is_alive(stdout_queue, run_location, timeout) @@ -1358,7 +1361,8 @@ def launch_mapdl( LOG.debug( "Because ``PYMAPDL_IP is not None, an attempt is made to connect to a remote session. ('START_INSTANCE' is set to False.`)" ) - start_instance = False + if not ON_WSL: + start_instance = False ip = socket.gethostbyname(ip) # Converting ip or hostname to ip check_valid_ip(ip) # double check From c9f217a9873c1c6971ce614cce08a56b26528623 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 12 Sep 2023 13:00:17 +0200 Subject: [PATCH 02/15] Adding logging. Adding detecting windows host IP --- src/ansys/mapdl/core/launcher.py | 49 ++++++++++++++++++++++++++++---- tests/test_launcher.py | 8 ++++++ 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index a9249b8c45..700a38f2a0 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -60,14 +60,18 @@ CONFIG_FILE = os.path.join(SETTINGS_DIR, "config.txt") ALLOWABLE_MODES = ["corba", "console", "grpc"] -ON_WSL = bool(os.environ.get("WSL_DISTRO_NAME", None)) or bool( - os.environ.get("WSL_INTEROP", None) +ON_WSL = os.name == "posix" and ( + bool(os.environ.get("WSL_DISTRO_NAME", None)) + or bool(os.environ.get("WSL_INTEROP", None)) ) +if ON_WSL: + LOG.info("On WSL: Running on WSL detected.") + LOCALHOST = "127.0.0.1" MAPDL_DEFAULT_PORT = 50052 -INTEL_MSG = """Due to incompatibilities between 'DMP', Windows and VPN connections, +INTEL_MSG = """Due to incompatibilities between this MAPDL version, Windows and VPN connections, the flat '-mpi INTELMPI' is overwritten by '-mpi msmpi'. If you still want to use 'INTEL', set: @@ -1356,13 +1360,26 @@ def launch_mapdl( raise ValueError(f"The following arguments are not recognaised: {ms_}") if ip is None: - ip = os.environ.get("PYMAPDL_IP", LOCALHOST) + ip = os.environ.get("PYMAPDL_IP", None) + + if not ip and ON_WSL: + ip = _get_windows_host_ip() + LOG.debug(f"On WSL: Using the following IP for the Windows OS host: {ip}") + + if not ip: + LOG.debug(f"No IP supplied, using default IP: {LOCALHOST}") + ip = LOCALHOST + else: LOG.debug( - "Because ``PYMAPDL_IP is not None, an attempt is made to connect to a remote session. ('START_INSTANCE' is set to False.`)" + "Because ``PYMAPDL_IP is not None, an attempt is made to connect to" + " a remote session. ('START_INSTANCE' is set to False.`)" ) if not ON_WSL: start_instance = False + else: + LOG.debug("On WSL: Allowing 'start_instance' and 'ip' arguments together.") + ip = socket.gethostbyname(ip) # Converting ip or hostname to ip check_valid_ip(ip) # double check @@ -1826,3 +1843,25 @@ def _verify_version(version): ) return version + + +def _get_windows_host_ip(): + output = _run_ip_route() + if output: + return _parse_ip_route(output) + + +def _run_ip_route(): + from subprocess import run + + try: + output = run("ip route") + except FileNotFoundError: + return None + + +def _parse_ip_route(output): + match = re.findall(r"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*", output) + + if match: + return match[0] diff --git a/tests/test_launcher.py b/tests/test_launcher.py index 526d713b3b..a29990af5b 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -12,6 +12,7 @@ _check_license_argument, _force_smp_student_version, _is_ubuntu, + _parse_ip_route, _validate_MPI, _verify_version, find_ansys, @@ -410,3 +411,10 @@ def test_launch_mapdl_non_recognaised_arguments(): def test_mapdl_non_recognaised_arguments(): with pytest.raises(ValueError, match="my_fake_argument"): pymapdl.Mapdl(my_fake_argument="my_fake_value") + + +def test__parse_ip_route(): + output = """default via 172.25.192.1 dev eth0 proto kernel <<<=== this +172.25.192.0/20 dev eth0 proto kernel scope link src 172.25.195.101 <<<=== not this""" + + assert "172.25.192.1" == _parse_ip_route(output) From aa9a2d5ec7739969d9e02b5dcb2cda9e553c5c8a Mon Sep 17 00:00:00 2001 From: German Date: Tue, 12 Sep 2023 13:00:48 +0200 Subject: [PATCH 03/15] Adding docs --- doc/source/getting_started/wsl.rst | 24 ++++++++++++++++++++++++ doc/source/links.rst | 1 + 2 files changed, 25 insertions(+) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 22728e4b5e..4208516a22 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -213,6 +213,27 @@ If you want to change the working directory, you can use the ``-dir`` flag. /ansys_inc/v222/ansys/bin/ansys222 -grpc -dir /tmp/ansys_jobs/myjob +Launch MAPDL in the Windows host OS +=================================== + +You can launch an instance of MAPDL using the MAPDL installation from the +Windows host OS. +To do that, you can just: + +.. code:: python + + from ansys.mapdl.core import launch_mapdl + + mapdl = launch_mapdl( + exec_file="/mnt/c/Program Files/ANSYS Inc/v231/ANSYS/bin/winx64/ANSYS231.exe", + ip="172.25.192.1", + ) + + +For more information visit `this issue `_. + + + Connect to an MAPDL instance running in WSL =========================================== @@ -225,6 +246,9 @@ you need to specify the IP address of the WSL instance: >>> mapdl = Mapdl(ip="127.0.0.1", port=50053) + + + Additional information ###################### diff --git a/doc/source/links.rst b/doc/source/links.rst index 10a8eeca56..fc1ec0b576 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -138,6 +138,7 @@ .. _pymapdl_docker_compose_license_server: https://github.com/ansys/pymapdl/blob/main/docker/docker-compose.license_server.yml .. _pymapdl_discussion_differences_mapdl_pymapdl: https://github.com/ansys/pymapdl-reader/issues/185 .. _cartpole_example_notebook: https://cartpole.mapdl.docs.pyansys.com/ml-rl-notebook.html +.. _wsl_launching_mapdl: https://github.com/ansys/pymapdl/issues/2315 .. #Python .. _using_venv: https://docs.python.org/3/library/venv.html From ae329237f94f3535ba41c5445d52b0683141b821 Mon Sep 17 00:00:00 2001 From: German Martinez Date: Tue, 12 Sep 2023 16:51:46 +0200 Subject: [PATCH 04/15] Fixing ip route call --- src/ansys/mapdl/core/launcher.py | 17 ++++++++++++++--- tests/test_launcher.py | 6 ++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 700a38f2a0..7babed3cf2 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1364,7 +1364,12 @@ def launch_mapdl( if not ip and ON_WSL: ip = _get_windows_host_ip() - LOG.debug(f"On WSL: Using the following IP for the Windows OS host: {ip}") + if ip: + LOG.debug( + f"On WSL: Using the following IP for the Windows OS host: {ip}" + ) + else: + LOG.debug("PyMAPDL could not find the IP of the Windows Host Machine.") if not ip: LOG.debug(f"No IP supplied, using default IP: {LOCALHOST}") @@ -1855,10 +1860,16 @@ def _run_ip_route(): from subprocess import run try: - output = run("ip route") - except FileNotFoundError: + p = run(["ip", "route"], capture_output=True) + except Exception: + LOG.debug( + "Detecting the IP of the host Windows machine requires to be able to execute the command 'ip route'." + ) return None + if p and p.stdout and isinstance(p.stdout, bytes): + return p.stdout.decode() + def _parse_ip_route(output): match = re.findall(r"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*", output) diff --git a/tests/test_launcher.py b/tests/test_launcher.py index a29990af5b..416efe2fe5 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -418,3 +418,9 @@ def test__parse_ip_route(): 172.25.192.0/20 dev eth0 proto kernel scope link src 172.25.195.101 <<<=== not this""" assert "172.25.192.1" == _parse_ip_route(output) + + output = """ +default via 172.23.112.1 dev eth0 proto kernel +172.23.112.0/20 dev eth0 proto kernel scope link src 172.23.121.145""" + + assert "172.23.112.1" == _parse_ip_route(output) From cca7ae3a7b51d022e7c23db10bd314c07ddaf4e0 Mon Sep 17 00:00:00 2001 From: German Martinez Date: Tue, 12 Sep 2023 17:27:01 +0200 Subject: [PATCH 05/15] Improving WSL guide --- doc/source/getting_started/wsl.rst | 76 +++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 23 deletions(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 4208516a22..28cbf0f66f 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -15,25 +15,25 @@ Windows Server 2019. For more information, see: This page walk you through the installation of WSL on Windows and then show how to use it together with MAPDL, PyMAPDL, and `Docker `_. -.. caution:: - This approach hasn't been fully tested with a VPN connection. If you - experience any problems connecting WSL to the internet, try to - disconnect from the VPN. +.. note:: + Updating this guide is doing a best effort basis. Due to WSL being under constant + development this guide might be outdated without any notice. + If you find any issue or problem, feel free to + `open an issue in the GitHub repository `_. -Run PyMAPDL on WSL -################## -There are two versions of WSL: WSL1 and WSL2. Because WSL2 provides many improvements -over WSL1, you should upgrade to and use WSL2. Install WSL -============ +########### + +There are two versions of WSL: WSL1 and WSL2. Because WSL2 provides many improvements +over WSL1, you should upgrade to and use WSL2. Install WSL by following Microsoft's directions at `Microsoft: Install WSL `_. Install the CentOS7 WSL distribution -==================================== +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When working with PyAnsys libraries, you should use the CentOS7 WSL distribution. @@ -41,11 +41,16 @@ You can install this distribution using an unofficial WSL distribution from `CentOS-WSL `_ package or the `CentOS WSL `_ package. -Optionally, you can try Ubuntu, but it has not been tested yet in the context of WSL. + +Using Ubuntu WSL distribution +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Ubuntu is a supported operative system for Ansys products. However it has not been +tested yet in the context of WSL. We recommend to proceed with caution. -Install Ansys products in WSL CentOS 7 -====================================== +Install Ansys products in WSL +############################# Prerequisites ~~~~~~~~~~~~~ @@ -119,7 +124,7 @@ directory (``/*/ansys_inc``). Post-installation setup -======================= +####################### Open ports for license server communication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -196,7 +201,7 @@ environment variable with this IP address: Launch MAPDL in WSL -=================== +################### To launch MAPDL in WSL, you must launch MAPDL process. An example follows. @@ -214,11 +219,26 @@ If you want to change the working directory, you can use the ``-dir`` flag. Launch MAPDL in the Windows host OS -=================================== +################################### You can launch an instance of MAPDL using the MAPDL installation from the Windows host OS. -To do that, you can just: +To do that, you can just run the following code. + +.. code:: python + + from ansys.mapdl.core import launch_mapdl + + mapdl = launch_mapdl( + exec_file="/mnt/c/Program Files/ANSYS Inc/v231/ANSYS/bin/winx64/ANSYS231.exe", + ) + +As mentioned in `Open ports for license server communication`_, the Windows host OS +and WSL are connected with a virtual network where they have both different IPs. +PyMAPDL does its best to detect the IP of the Windows host OS. For that, it parses +the output given by the command `ip route` in WSL. +However, if you find that this IP is not correct, you can specify the IP to connect +to using: .. code:: python @@ -226,16 +246,20 @@ To do that, you can just: mapdl = launch_mapdl( exec_file="/mnt/c/Program Files/ANSYS Inc/v231/ANSYS/bin/winx64/ANSYS231.exe", - ip="172.25.192.1", + ip="172.23.112.1", ) +You might need to disable the Microsoft Firewall completely or at least +for the WSL network connection. +To do so, follow `this link `_. -For more information visit `this issue `_. +For more information and troubleshooting visit `this issue `_ +or open a new issue in the `GitHub repository `_. Connect to an MAPDL instance running in WSL -=========================================== +########################################### To connect to the WSL instance that is running the MAPDL instance, you need to specify the IP address of the WSL instance: @@ -247,8 +271,6 @@ you need to specify the IP address of the WSL instance: - - Additional information ###################### @@ -454,6 +476,12 @@ as shown in the following command. For more information, see the ``.ci`` folder. yum install xorg-x11-server-Xvfb +.. note:: + If you want to replicate the CICD behaviour or develop from inside a docker container, + it is highly recommended to use Ubuntu as base operative system. You can find instructions + to `create your own MAPDL Ubuntu container in here `_ and how to use it to + `develop on containers in here `_. + Notes ===== @@ -461,5 +489,7 @@ Notes is why the flag ``-smp`` should be included. - Because there are some incompatibilities between VPN and INTEL MPI, use the - flag ``-mpi msmpi`` when calling MAPDL. + flag ``-mpi msmpi`` when calling MAPDL. This guide has not been written or tested + under VPN. If you are experiencing issues connecting to the Windows host maachine, + your license server or an MAPDL instance please disconnect the VPN. From e6fd9d935492e7a1619e826ddb5bb82dae49ae26 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 12 Sep 2023 18:10:03 +0200 Subject: [PATCH 06/15] Apply suggestions from code review Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/getting_started/wsl.rst | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 28cbf0f66f..d95197822d 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -17,10 +17,8 @@ show how to use it together with MAPDL, PyMAPDL, and `Docker `_. + Because WSL is under constant development, keeping this guide updated is difficult. If you + find any issues or have questions related to WSL, feel free to `open an issue in the GitHub repository `_. Install WSL @@ -42,11 +40,13 @@ You can install this distribution using an unofficial WSL distribution from `CentOS WSL `_ package. -Using Ubuntu WSL distribution -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. vale off +Using the Ubuntu WSL distribution +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. vale on Ubuntu is a supported operative system for Ansys products. However it has not been -tested yet in the context of WSL. We recommend to proceed with caution. +tested yet in the context of WSL. You should proceed with caution. Install Ansys products in WSL @@ -203,7 +203,7 @@ environment variable with this IP address: Launch MAPDL in WSL ################### -To launch MAPDL in WSL, you must launch MAPDL process. +To launch MAPDL in WSL, you must launch the MAPDL process. An example follows. .. code:: console @@ -223,7 +223,7 @@ Launch MAPDL in the Windows host OS You can launch an instance of MAPDL using the MAPDL installation from the Windows host OS. -To do that, you can just run the following code. +To do that, run this code: .. code:: python @@ -234,11 +234,10 @@ To do that, you can just run the following code. ) As mentioned in `Open ports for license server communication`_, the Windows host OS -and WSL are connected with a virtual network where they have both different IPs. -PyMAPDL does its best to detect the IP of the Windows host OS. For that, it parses -the output given by the command `ip route` in WSL. -However, if you find that this IP is not correct, you can specify the IP to connect -to using: +and WSL are connected with a virtual network where they both have different IP addresses. +PyMAPDL does its best to detect the IP adress of the Windows host OS. For that, it parses +the output given by the command ``ip route`` in WSL. However, if you find that this IP +address is not correct, you can specify the IP address to connect to like this: .. code:: python @@ -249,7 +248,7 @@ to using: ip="172.23.112.1", ) -You might need to disable the Microsoft Firewall completely or at least +You might need to turn off the Microsoft Firewall completely or at least for the WSL network connection. To do so, follow `this link `_. From 3559e4d4386c2714ca837af8acbd74e5ca5afab2 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 12 Sep 2023 18:12:54 +0200 Subject: [PATCH 07/15] More review suggetions --- doc/source/getting_started/wsl.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 28cbf0f66f..7d327a7ff6 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -192,8 +192,12 @@ Here is an example of the WSL ``/etc/hosts`` file: You can add the next lines to your WSL ``~/.bashrc`` file to create an environment variable with this IP address: +.. vale off + .. _ref_bash_win_ip: +.. vale on + .. code:: console winhostIP=$(grep -m 1 host.docker.internal /etc/hosts | awk '{print $1}') @@ -251,7 +255,8 @@ to using: You might need to disable the Microsoft Firewall completely or at least for the WSL network connection. -To do so, follow `this link `_. +To do so, follow +:ref:`Disable firewall on WSL ethernet `. For more information and troubleshooting visit `this issue `_ From ce05e6c929fd0bc0f2265cb58d61aad7f4943836 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 12 Sep 2023 18:19:24 +0200 Subject: [PATCH 08/15] Apply suggestions from code review Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/getting_started/wsl.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 9c3591cfb7..f795e9a7ae 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -258,8 +258,8 @@ To do so, follow :ref:`Disable firewall on WSL ethernet `. -For more information and troubleshooting visit `this issue `_ -or open a new issue in the `GitHub repository `_. +For more information, see the issue `Launching MAPDL from WSL `_ +or open a new issue in the `GitHub repository issues `_. Connect to an MAPDL instance running in WSL @@ -481,10 +481,10 @@ as shown in the following command. For more information, see the ``.ci`` folder. .. note:: - If you want to replicate the CICD behaviour or develop from inside a docker container, - it is highly recommended to use Ubuntu as base operative system. You can find instructions - to `create your own MAPDL Ubuntu container in here `_ and how to use it to - `develop on containers in here `_. + If you want to replicate the CI/CD behavior or develop from inside a Docker container, + you should use Ubuntu as your base operative system. You can find instructions + to create your own MAPDL Ubuntu container in `Create your own MAPDL docker container `_ and how to use + it to develop on containers in `Develop on a container `_. Notes ===== From 229c4a5c9c3fe3874229a93937f66f2ad67d9dca Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 12 Sep 2023 18:20:24 +0200 Subject: [PATCH 09/15] Update doc/source/getting_started/wsl.rst --- doc/source/getting_started/wsl.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index f795e9a7ae..62a46f9568 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -239,7 +239,7 @@ To do that, run this code: As mentioned in `Open ports for license server communication`_, the Windows host OS and WSL are connected with a virtual network where they both have different IP addresses. -PyMAPDL does its best to detect the IP adress of the Windows host OS. For that, it parses +PyMAPDL does its best to detect the IP address of the Windows host OS. For that, it parses the output given by the command ``ip route`` in WSL. However, if you find that this IP address is not correct, you can specify the IP address to connect to like this: From b05fc877ae31c0876b8d5a51133eab2f915597b9 Mon Sep 17 00:00:00 2001 From: German Date: Tue, 12 Sep 2023 18:54:05 +0200 Subject: [PATCH 10/15] fixing title --- doc/source/getting_started/wsl.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 9c3591cfb7..34bb5c9b62 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -31,7 +31,7 @@ Install WSL by following Microsoft's directions at `Microsoft: Install WSL `_. Install the CentOS7 WSL distribution -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +==================================== When working with PyAnsys libraries, you should use the CentOS7 WSL distribution. @@ -42,7 +42,7 @@ You can install this distribution using an unofficial WSL distribution from .. vale off Using the Ubuntu WSL distribution -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +================================= .. vale on Ubuntu is a supported operative system for Ansys products. However it has not been @@ -53,7 +53,7 @@ Install Ansys products in WSL ############################# Prerequisites -~~~~~~~~~~~~~ +============= If you are using CentOS 7, before installing MAPDL, you must install some required libraries: @@ -68,7 +68,7 @@ If you are using Ubuntu, follow the instructions in `Run MAPDL: Ubuntu Date: Tue, 12 Sep 2023 19:06:51 +0200 Subject: [PATCH 11/15] Apply suggestions from code review Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- doc/source/getting_started/wsl.rst | 6 +++--- src/ansys/mapdl/core/launcher.py | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 365b193824..8161b7ac53 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -493,7 +493,7 @@ Notes is why the flag ``-smp`` should be included. - Because there are some incompatibilities between VPN and INTEL MPI, use the - flag ``-mpi msmpi`` when calling MAPDL. This guide has not been written or tested - under VPN. If you are experiencing issues connecting to the Windows host maachine, - your license server or an MAPDL instance please disconnect the VPN. + flag ``-mpi msmpi`` when calling MAPDL. This WSL guidance has not been written for or tested + on VPN. If you are experiencing issues connecting to the Windows host machine, + your license server, or an MAPDL instance, disconnect the VPN and try again. diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 7babed3cf2..621233f6f7 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -71,7 +71,7 @@ LOCALHOST = "127.0.0.1" MAPDL_DEFAULT_PORT = 50052 -INTEL_MSG = """Due to incompatibilities between this MAPDL version, Windows and VPN connections, +INTEL_MSG = """Due to incompatibilities between this MAPDL version, Windows, and VPN connections, the flat '-mpi INTELMPI' is overwritten by '-mpi msmpi'. If you still want to use 'INTEL', set: @@ -1357,7 +1357,7 @@ def launch_mapdl( # Raising error if using non-allowed arguments if kwargs: ms_ = ", ".join([f"'{each}'" for each in kwargs.keys()]) - raise ValueError(f"The following arguments are not recognaised: {ms_}") + raise ValueError(f"The following arguments are not recognized: {ms_}") if ip is None: ip = os.environ.get("PYMAPDL_IP", None) @@ -1366,19 +1366,19 @@ def launch_mapdl( ip = _get_windows_host_ip() if ip: LOG.debug( - f"On WSL: Using the following IP for the Windows OS host: {ip}" + f"On WSL: Using the following IP address for the Windows OS host: {ip}" ) else: - LOG.debug("PyMAPDL could not find the IP of the Windows Host Machine.") + LOG.debug("PyMAPDL could not find the IP address of the Windows host machine.") if not ip: - LOG.debug(f"No IP supplied, using default IP: {LOCALHOST}") + LOG.debug(f"No IP addres was supplied. Using the default IP address: {LOCALHOST}") ip = LOCALHOST else: LOG.debug( - "Because ``PYMAPDL_IP is not None, an attempt is made to connect to" - " a remote session. ('START_INSTANCE' is set to False.`)" + "Because 'PYMAPDL_IP' is not None, an attempt is made to connect to" + " a remote session ('START_INSTANCE' is set to 'False')." ) if not ON_WSL: start_instance = False From 4ace28432ca91778d2338c8362a7cba718b11f9e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:07:44 +0000 Subject: [PATCH 12/15] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/ansys/mapdl/core/launcher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 621233f6f7..caf8fe4d2c 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1369,10 +1369,14 @@ def launch_mapdl( f"On WSL: Using the following IP address for the Windows OS host: {ip}" ) else: - LOG.debug("PyMAPDL could not find the IP address of the Windows host machine.") + LOG.debug( + "PyMAPDL could not find the IP address of the Windows host machine." + ) if not ip: - LOG.debug(f"No IP addres was supplied. Using the default IP address: {LOCALHOST}") + LOG.debug( + f"No IP addres was supplied. Using the default IP address: {LOCALHOST}" + ) ip = LOCALHOST else: From e8cfb9a82ec68e2e9ec81f451b5fcbb0c2f3c3cc Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 12 Sep 2023 19:08:02 +0200 Subject: [PATCH 13/15] Update src/ansys/mapdl/core/launcher.py Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com> --- src/ansys/mapdl/core/launcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index caf8fe4d2c..6aed7261c4 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1867,7 +1867,7 @@ def _run_ip_route(): p = run(["ip", "route"], capture_output=True) except Exception: LOG.debug( - "Detecting the IP of the host Windows machine requires to be able to execute the command 'ip route'." + "Detecting the IP address of the host Windows machine requires being able to execute the command 'ip route'." ) return None From f3f9e1260f2c012ef78eb4dd22beb3df8b5e930c Mon Sep 17 00:00:00 2001 From: German Date: Tue, 12 Sep 2023 19:09:59 +0200 Subject: [PATCH 14/15] Fixing typo --- src/ansys/mapdl/core/launcher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 6aed7261c4..aff0436476 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1375,7 +1375,7 @@ def launch_mapdl( if not ip: LOG.debug( - f"No IP addres was supplied. Using the default IP address: {LOCALHOST}" + f"No IP address was supplied. Using the default IP address: {LOCALHOST}" ) ip = LOCALHOST From 95beb0dd986202e04024d33e20e0e9a60c5a8b5e Mon Sep 17 00:00:00 2001 From: German Date: Tue, 12 Sep 2023 19:32:02 +0200 Subject: [PATCH 15/15] Fixing links --- doc/source/getting_started/macos.rst | 2 +- doc/source/getting_started/wsl.rst | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/source/getting_started/macos.rst b/doc/source/getting_started/macos.rst index 6645f9c044..23504c80e3 100644 --- a/doc/source/getting_started/macos.rst +++ b/doc/source/getting_started/macos.rst @@ -33,7 +33,7 @@ Launch MAPDL on MacOS ===================== If you do not have an MAPDL Docker image, you can create one on a Linux -machine as indicated in :ref:`ref_make_container`. +machine as indicated in :ref:`ref_make_container`. If you already have an MAPDL Docker image, you can launch MAPDL as diff --git a/doc/source/getting_started/wsl.rst b/doc/source/getting_started/wsl.rst index 8161b7ac53..693ef03430 100644 --- a/doc/source/getting_started/wsl.rst +++ b/doc/source/getting_started/wsl.rst @@ -41,8 +41,10 @@ You can install this distribution using an unofficial WSL distribution from .. vale off + Using the Ubuntu WSL distribution ================================= + .. vale on Ubuntu is a supported operative system for Ansys products. However it has not been @@ -483,8 +485,8 @@ as shown in the following command. For more information, see the ``.ci`` folder. .. note:: If you want to replicate the CI/CD behavior or develop from inside a Docker container, you should use Ubuntu as your base operative system. You can find instructions - to create your own MAPDL Ubuntu container in `Create your own MAPDL docker container `_ and how to use - it to develop on containers in `Develop on a container `_. + to create your own MAPDL Ubuntu container in :ref:`ref_make_container` and how to use + it to develop on containers in :ref:`ref_devcontainer`. Notes =====