Skip to content

Commit 526a30f

Browse files
revert the index.rst code (#1156)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent d0ae189 commit 526a30f

File tree

2 files changed

+167
-0
lines changed

2 files changed

+167
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Revert the index.rst code

doc/source/getting_started/index.rst

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,169 @@ To launch PyPrimeMesh, use this code:
9999
100100
with prime.launch_prime() as prime_client:
101101
model = prime_client.model
102+
103+
Launching PyPrimeMesh through docker
104+
------------------------------------
105+
106+
Ansys Prime Server is capable of being launched through docker.
107+
Docker is an open platform for developing, shipping, and running apps in a containerized way.
108+
Containers are standard units of software that package the code and all its dependencies.
109+
Hence, the app runs quickly and reliably from one computing environment to another.
110+
111+
Ansys Prime Server can be built as a Linux Docker container.
112+
Hence, you should have a linux machine to run the Ansys Prime Server.
113+
114+
Docker for Linux containers
115+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116+
To run the Linux Docker container for the Ansys Prime Server,
117+
ensure that you follow these steps when installing the Docker:
118+
119+
1. Install `Docker Engine <https://docs.docker.com/engine/install/rhel/>`_.
120+
121+
2. Restart your machine and start Docker Engine after completing the installation.
122+
123+
Your Docker engine supports running Linux Docker containers, you can build or install the Ansys Prime Server image.
124+
125+
.. note::
126+
Ansys Prime Server uses Intel MPI library for performing meshing operations. Intel MPI library requires NUMA support.
127+
Docker desktop allows to run linux containers on windows using WSL. Existing Linux distributions used for WSL do not typically support NUMA.
128+
It is expected that a custom Linux distribution would be required for WSL to run the Ansys Prime Server container to support NUMA.
129+
Ansys does not recommend you to run the Ansys Prime Server image without NUMA support.
130+
131+
Build or install the Ansys Prime Server image
132+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133+
134+
You can install the Ansys Prime Server image in the following ways:
135+
136+
• Download it from the GitHub Container Registry.
137+
138+
• Build the Ansys Prime Server Linux container.
139+
140+
141+
GitHub container registry
142+
^^^^^^^^^^^^^^^^^^^^^^^^^
143+
144+
.. note::
145+
You should have write access to the repository or should be a members of the Ansys organization.
146+
147+
After installing Docker on your machine, follow these steps to download the Linux Docker container
148+
for the Ansys Prime Server and install this image.
149+
150+
1. Download the Docker image from the `PyPrimeMesh repository <https://github.com/ansys/pyprimemesh>`_ on GitHub using your GitHub credentials.
151+
2. Use a GitHub personal access token with permission for reading packages to authorize Docker to access the PyPrimeMesh repository. For more information, see `Managing your personal access tokens <https://docs.github.com/en/authentication/keeping-your-account-and-data- secure/managing-your-personal-access-tokens>`_ in the GitHub documentation.
152+
3. Save the token to a file using this command:
153+
154+
.. code-block:: pycon
155+
156+
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt
157+
158+
4. Authorize Docker to access the repository and run the commands for your OS.
159+
160+
**Linux:**
161+
162+
.. code-block:: pycon
163+
164+
setenv GH_USERNAME <your_github_username>
165+
cat GH_TOKEN.txt | docker login ghcr.io -u $GH_USERNAME --password-stdin
166+
167+
5. Pull the Ansys Prime Server locally using Docker using the following command:
168+
169+
.. code-block:: pycon
170+
171+
docker pull ghcr.io/ansys/prime:25.2.0
172+
173+
174+
Build the Ansys Prime Server linux container
175+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176+
177+
You can build the Ansys Prime Server Docker containers from the PyPrimeMesh repository docker folder.
178+
The docker folder has the linux/Dockerfile that builds the Linux-based Docker image.
179+
180+
.. note::
181+
Ansys Prime Server does not support building windows-based docker images.
182+
183+
You can build the docker image file as follows:
184+
185+
• **Build from available Ansys installation**: Builds the Docker image using the Ansys installation available in the machine where the Docker image is being built.
186+
187+
Prerequisites
188+
''''''''''''''
189+
190+
Ensure that Docker is installed in your machine. If you do not have Docker available, see :ref:`Docker for Linux containers <Docker for Linux containers>`.
191+
192+
193+
Build from available Ansys installation
194+
''''''''''''''''''''''''''''''''''''''''
195+
196+
To build your own image from your Ansys installation, follow these instructions:
197+
198+
1. Go to the Docker folder in your local PyPrimeMesh repository.
199+
200+
2. Execute the script with the following command (no specific location needed):
201+
202+
.. code-block:: pycon
203+
204+
python build_docker_linux.py <ANSYS_INSTALLATION_PATH>
205+
206+
For example,
207+
208+
.. code-block:: pycon
209+
210+
$AWP_ROOT252/commonfiles/CPython/3_10/linx64/Release/python/bin/python build_docker_linux.py $AWP_ROOT252
211+
212+
3. Check that the image has been created successfully.
213+
214+
You can view the docker image created with latest tag as follows:
215+
216+
.. figure:: ../images/docker_image.png
217+
:width: 800pt
218+
:align: center
219+
220+
Launch the Ansys Prime Server
221+
''''''''''''''''''''''''''''''
222+
223+
Ansys Prime Server can be launched using the PyPrimeMesh launcher.
224+
You should set the following mandatory environment variable for launching the Ansys Prime Server:
225+
226+
- PYPRIMEMESH_LAUNCH_CONTAINER: Launches the Ansys Prime Server form the PyPrimeMesh container.
227+
228+
- PYPRIMEMESH_IMAGE_TAG: Latest version of the Ansys Prime Server docker image.
229+
230+
- ANSYSLMD_LICENSE_FILE: License server required for launching the Ansys Prime Server.
231+
232+
Setting the environment variable
233+
'''''''''''''''''''''''''''''''''
234+
235+
Define the following general environment variables prior to using the Ansys Prime Server launcher.
236+
237+
**Linux**
238+
239+
.. code-block:: pycon
240+
241+
export PYPRIMEMESH_LAUNCH_CONTAINER=1
242+
export PYPRIMEMESH_IMAGE_TAG=<latest>
243+
export ANSYSLMD_LICENSE_FILE=<valid license server>
244+
245+
.. note::
246+
PyPrimeMesh supports Docker image creation from 2025 R1 version.
247+
248+
Launching Ansys Prime Server
249+
''''''''''''''''''''''''''''''
250+
Ensure that you have installed ``ansys-meshing-prime`` package before launching Ansys Prime Server.
251+
To install ``ansys-meshing-prime`` package, refer :ref:`Installation`.
252+
Ansys Prime Server can be launched as follows:
253+
254+
.. code-block:: pycon
255+
256+
>>> from ansys.meshing import prime
257+
>>> client = prime.launch_prime()
258+
>>> model = client.model
259+
260+
261+
262+
263+
264+
265+
266+
267+

0 commit comments

Comments
 (0)