-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation: Add ServerContext, ServerConfiguration and GettingStar…
…tedWithDPFServer sections (#637) * Fix reference to Examples section in the User Guide main page. * Add a doc page describing ServerConfigs. * Improve server_types documentation. * Apply suggestions from code review * Apply suggestions from code review * Add server context notions rst file * Update code parts for server_context doc * Update references * Take PRs comments on https://github.com/pyansys/pydpf-core/pull/622/files * Fix ref on server_types * Cards size: 30% * Fix home page * Update server_types * Remove out * Add reference to distributed * Revert "Cards size: 30%" This reverts commit 41406bf. * Getting started with DPF server * Add release history for server context * Fixes for getting started with dpf server * Add remote machines drawing * Failing reference * Fixes for generation * Fix images * Update drawings * Add entry_premium drawing * Fix gallery * Move sections to how tos * typo * Fix getting started * remotely * Update mention to ANSYSLMD_LICENSE_FILE * Apply suggestions from code review Co-authored-by: JennaPaikowsky <98607744+JennaPaikowsky@users.noreply.github.com> * Update entry_premium.png to Ansys colors. * Update docs/source/user_guide/getting_started_with_dpf_server.rst * Checkout as one word when a noun * Link to classes directly and reformat bullet points * Take into account comments related to getting_started (use of scripts) and references * Update docs/source/user_guide/getting_started_with_dpf_server.rst Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com> * Update docs/source/user_guide/getting_started_with_dpf_server.rst Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com> * Update docs/source/user_guide/getting_started_with_dpf_server.rst Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com> * Update docs/source/user_guide/getting_started_with_dpf_server.rst Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com> * Update links * Add new sections to toctrees Co-authored-by: paul.profizi <paul.profizi@ansys.com> Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com> Co-authored-by: JennaPaikowsky <98607744+JennaPaikowsky@users.noreply.github.com>
- Loading branch information
1 parent
4800b46
commit d08a5f3
Showing
10 changed files
with
458 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
152 changes: 152 additions & 0 deletions
152
docs/source/user_guide/getting_started_with_dpf_server.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
.. _ref_getting_started_with_dpf_server: | ||
|
||
=============================== | ||
Getting Started with DPF Server | ||
=============================== | ||
|
||
What is DPF Server | ||
------------------ | ||
|
||
The Data Processing Framework (DPF) provides numerical simulation users and engineers with a toolbox for accessing and transforming | ||
simulation data. With DPF, you can perform complex preprocessing or postprocessing of large amounts of simulation data within a | ||
simulation workflow. | ||
|
||
DPF Server is a package that contains all the necessary files to run the DPF Server, enabling DPF capabilities. It is available | ||
on the Ansys Customer Portal. DPF Server first available version is 6.0 (2023 R2). | ||
|
||
For more information about DPF and its use, see :ref:`ref_user_guide`. | ||
|
||
The following section details how to use DPF Server package. For a quick start with DPF Server, see :ref:`ref_getting_started`. | ||
|
||
Installing DPF Server | ||
--------------------- | ||
|
||
.. _target_installing_server: | ||
|
||
#. Download the ansys_dpf_server_win_v2023.2.pre0.zip or ansys_dpf_server_lin_v2023.2.pre0.zip file as appropriate. | ||
#. Unzip the package. | ||
#. Change to the root folder (ansys_dpf_server_win_v2023.2.pre0) of the unzipped package. | ||
#. In a Python environment, run the following command: | ||
|
||
.. code:: | ||
pip install -e . | ||
PyDPF-Core and PyDPF-Post python modules can now be used. The instructions to install and get started with PyDPF-Core | ||
(ansys-dpf-core module) can be found at `Getting Started section <https://dpf.docs.pyansys.com/getting_started/install.html>`_. | ||
|
||
Using DPF Server | ||
---------------- | ||
|
||
Running the DPF Server with PyDPF | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
With PyDPF-Core and PyDPF-Post, the first creation of most DPF entities will start a DPF Server with the current default configuration and context. | ||
For example, the following code will automatically start a DPF Server behind the scenes: | ||
|
||
.. code:: | ||
from ansys.dpf import core as dpf | ||
data_sources = dpf.DataSources() | ||
With PyDPF-Core, you can also explicitly start a DPF Server using: | ||
|
||
.. code:: | ||
from ansys.dpf import core as dpf | ||
server = dpf.start_local_server() | ||
To start a DPF Server from outside a Python environment, you can also use the execution script provided with your DPF Server package. | ||
On Windows, start the DPF Server by running the Ans.Dpf.Grpc.bat file in the unzipped package. | ||
On Linux, start the DPF Server by running the Ans.Dpf.Grpc.sh file in the unzipped package. | ||
|
||
Running the DPF Server in a Docker container | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
1. Along with the ansys_dpf_server_lin_v2023.2.pre0.zip archive mentioned in :ref:`Installing DPF Server <target_installing_server>`, download the Dockerfile. | ||
2. Copy both the archive and Dockerfile in a folder and navigate into that folder. | ||
3. To build the DPF Docker container, run the following commands: | ||
|
||
.. code:: | ||
docker build . -t dpf-core:v2023_2_pre0 --build-arg DPF_VERSION=232 --build-arg DPF_SERVER_FILE=ansys_dpf_server_lin_v2023.2.pre0.zip | ||
4. To run the DPF Docker container, see the :ref:`License terms<target_to_license_terms>` section. | ||
|
||
License terms | ||
------------- | ||
|
||
DPF Preview License Agreement | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. _target_to_license_terms: | ||
|
||
DPF Server is protected using license terms specified in the DPFPreviewLicenseAgreement file that | ||
can be found on the Ansys Customer Portal. | ||
|
||
To accept the DPF User Licensing Agreement terms, the following environment flag must be set: | ||
|
||
.. code:: | ||
"ANSYS_DPF_ACCEPT_LA=Y" | ||
ANSYS_DPF_ACCEPT_LA confirms your acceptance of the DPF User Licensing Agreement. By passing the value "Y" to the environment variable | ||
"ANSYS_DPF_ACCEPT_LA", you are expressing that you have a valid and existing license for the edition and version of DPF server you intend to use. | ||
|
||
For a DPF Docker container usage, it can be set using: | ||
|
||
.. code:: | ||
docker run -e "ANSYS_DPF_ACCEPT_LA=Y" -e ANSYSLMD_LICENSE_FILE=1055@<license_server_to_use> -p 50052:50052 -e DOCKER_SERVER_PORT=50052 --expose=50052 dpf-core:v2023_2_pre0 | ||
For any other case, set "ANSYS_DPF_ACCEPT_LA" as an environment variable with "Y" value. | ||
|
||
Replace "<license_server_to_use>" mention that ANSYSLMD_LICENSE_FILE environment variable points to the Ansys license server. | ||
For more information about Ansys license mechanism use with DPF Server, see :ref:`Ansys licensing section<target_to_ansys_license_mechanism>`. | ||
|
||
|
||
Ansys licensing | ||
~~~~~~~~~~~~~~~ | ||
|
||
.. _target_to_ansys_license_mechanism: | ||
|
||
DPF Server is protected by Ansys licensing mechanism. | ||
|
||
DPF capabilities are available through the following main services: | ||
- Entry: Loads the minimum number of plugins for basic use. It is the default. It will only check if an Ansys License is available. | ||
- Premium: Loads the entry and the premium capabilities that require a license checkout. | ||
|
||
To update the context, apply a new server context: | ||
|
||
.. code:: | ||
dpf.apply_server_context(dpf.AvailableServerContexts.premium) | ||
The following Ansys licensing increments currently provide rights to use DPF Server: | ||
|
||
- "preppost" available in Ansys Mechanical Enterprise PrepPost product | ||
- "meba" available in ANSYS Mechanical Enterprise Solver product | ||
- "mech_2" availale in ANSYS Mechanical Premium product | ||
- "mech_1" availale in ANSYS Mechanical Pro product | ||
- "ansys" available in ANSYS Mechanical Enterprise product | ||
- "dynapp" available in ANSYS LS-DYNA PrepPost product | ||
- "vmotion" available in Ansys Motion product | ||
- "acpreppost" available in Ansys Mechanical Enterprise product | ||
- "acdi_adprepost" available in Ansys AUTODYN and Ansys AUTODYN PrepPost products | ||
- "cfd_preppost" available in Ansys CFD Enterprise product | ||
- "cfd_preppost_pro" available in Ansys CFD Enterprise product | ||
- "vmotion_post" available in Ansys Motion Post product | ||
- "vmotion_pre" available in Ansys Motion Pre product | ||
- "advanced_meshing" available in Ansys CFD Enterprise product | ||
- "fluent_meshing_pro" available in Ansys CFD Enterprise product | ||
- "fluent_setup_post" available in Ansys CFD Enterprise product | ||
- "fluent_setup_post_pro" available in Ansys CFD Enterprise product | ||
- "acfx_pre" available in Ansys CFD Enterprise product | ||
- "cfd_base" available in Ansys CFD Enterprise product | ||
- "cfd_solve_level1" available in Ansys CFD Enterprise product | ||
- "cfd_solve_level2" available in Ansys CFD Enterprise product | ||
- "cfd_solve_level3" available in Ansys CFD Enterprise product | ||
- "fluent_meshing" available in Ansys CFD Enterprise product | ||
|
||
Each increment may be available in other products. The product/increment mapping can be found in the Licensing section of the Ansys Customer Portal: | ||
`<https://download.ansys.com/Installation%20and%20Licensing%20Help%20and%20Tutorials>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
.. _user_guide_server_context: | ||
|
||
============== | ||
Server context | ||
============== | ||
|
||
What is server context | ||
---------------------- | ||
|
||
The :class:`ServerContext <ansys.dpf.core.server_context.ServerContext>` class drives the | ||
default capabilities a server will be started with. | ||
|
||
The server context is composed of the following information: | ||
|
||
- context_type, a :class:`LicensingContextType <ansys.dpf.core.server_context.LicensingContextType>` | ||
class object that defines if a License checkout is required or not. | ||
- the xml_path that sets DPF default operators capabilities. | ||
|
||
For more information, | ||
see :class:`AvailableServerContexts <ansys.dpf.core.server_context.AvailableServerContexts>` | ||
and :ref:`user_guide_xmlfiles`. | ||
|
||
Two main licensing context type capabilities are available: | ||
|
||
- Entry (default): Loads the minimum capabilities without requiring any license checkout. | ||
- Premium: Enables the entry capabilities and the capabilities that requires a license checkout. | ||
More operators are available. | ||
|
||
The operators list for each licensing context type is available at | ||
:ref:`ref_dpf_operators_reference`. | ||
|
||
Getting started with Entry capabilities | ||
--------------------------------------- | ||
|
||
Find the list of operators available when the context is Entry at :ref:`ref_dpf_operators_reference`. | ||
This won't check out any license. | ||
|
||
.. code-block:: | ||
from ansys.dpf import core as dpf | ||
entry_server = dpf.start_local_server() | ||
entry_server.context | ||
Getting started with Premium capabilities | ||
----------------------------------------- | ||
|
||
Find the list of operators available when the context is Premium at :ref:`ref_dpf_operators_reference`. | ||
This will check out a license. | ||
|
||
.. code-block:: | ||
from ansys.dpf import core as dpf | ||
premium_server_context = dpf.AvailableServerContexts.premium | ||
premium_server = dpf.start_local_server( | ||
context=premium_server_context | ||
) | ||
print(premium_server.context) | ||
.. rst-class:: sphx-glr-script-out | ||
|
||
.. code-block:: none | ||
Server Context of type LicensingContextType.premium with no xml path | ||
Changing server context from Entry to Premium | ||
--------------------------------------------- | ||
|
||
Once an Entry server is started, it can be upgraded to Premium: | ||
|
||
.. code-block:: | ||
from ansys.dpf import core as dpf | ||
# start a server with entry capabilities | ||
server = dpf.start_local_server() | ||
print(server.context) | ||
.. rst-class:: sphx-glr-script-out | ||
|
||
.. code-block:: none | ||
Server Context of type LicensingContextType.entry with no xml path | ||
.. code-block:: | ||
# apply a premium context on the server | ||
server.apply_context(dpf.AvailableServerContexts.premium) | ||
print(server.context) | ||
.. rst-class:: sphx-glr-script-out | ||
|
||
.. code-block:: none | ||
Server Context of type LicensingContextType.premium with no xml path | ||
Changing the default server context | ||
----------------------------------- | ||
|
||
Entry is the default server context. This can be changed either using the ANSYS_DPF_SERVER_CONTEXT | ||
environment variable (see `<ansys.dpf.core.server_context>`) or writing: | ||
|
||
.. code-block:: | ||
from ansys.dpf import core as dpf | ||
dpf.set_default_server_context(dpf.AvailableServerContexts.premium) | ||
print(dpf.server_context.SERVER_CONTEXT) | ||
.. rst-class:: sphx-glr-script-out | ||
|
||
.. code-block:: none | ||
Server Context of type LicensingContextType.premium with no xml path | ||
Release History | ||
--------------- | ||
|
||
The Entry server context is available starting with server version 6.0 | ||
(Ansys 2023 R2). | ||
|
||
With a server version lower than 6.0, Premium will be the default server | ||
context and all the Premium operators at :ref:`ref_dpf_operators_reference` | ||
will be available (depending only on their release date). |
Oops, something went wrong.