Skip to content

Commit b4eb511

Browse files
authored
Improving docs (#380)
1 parent f1bf010 commit b4eb511

File tree

3 files changed

+96
-14
lines changed

3 files changed

+96
-14
lines changed

README.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ To install PyGeometry in developer mode, perform these steps:
182182
183183
git clone https://github.com/pyansys/pygeometry
184184
185+
#. Access the ``pygeometry`` directory where the repository has been cloned:
186+
187+
.. code:: bash
188+
189+
cd pygeometry
190+
185191
#. Create a clean Python virtual environment and activate it:
186192

187193
.. code:: bash
@@ -204,18 +210,21 @@ To install PyGeometry in developer mode, perform these steps:
204210
205211
python -m pip install -U pip tox
206212
207-
208213
#. Install the project in editable mode:
209214

210215
.. code:: bash
211-
212-
python -m pip install ansys-geometry-core
213-
214-
#. Verify your development installation by running:
216+
217+
# Install the minimum requirements
218+
python -m pip install -e .
215219
216-
.. code:: bash
217-
218-
tox
220+
# Install the minimum + tests requirements
221+
python -m pip install -e .[tests]
222+
223+
# Install the minimum + doc requirements
224+
python -m pip install -e .[doc]
225+
226+
# Install the all requirements
227+
python -m pip install -e .[tests,doc]
219228
220229
Install in offline mode
221230
^^^^^^^^^^^^^^^^^^^^^^^

doc/source/getting_started/docker.rst

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,89 @@
1+
.. _ref_docker:
2+
13
Geometry service using Docker
24
=============================
35

6+
Docker
7+
------
8+
9+
Ensure that the machine in which the Geometry service should run has Docker installed. Otherwise,
10+
please install `Docker Engine <https://docs.docker.com/engine/install/>`_ from the previous link.
11+
12+
.. caution::
13+
At the moment, the Geometry service backend is only delivered as a Windows Docker container.
14+
As such, this container only runs on a Windows machine. Furthermore, it has also been observed
15+
that certain Docker Desktop versions for Windows are not properly configured for running Windows
16+
Docker containers. Refer to our section
17+
:ref:`Running the Geometry service Windows Docker container <ref_docker_windows>` for further details.
18+
19+
.. _ref_docker_windows:
20+
21+
Running the Geometry service Windows Docker container
22+
-----------------------------------------------------
23+
24+
For running the Windows Docker container of the Geometry service, please ensure that
25+
you follow the upcoming steps when installing Docker:
26+
27+
#. Install `Docker Desktop 4.13.1 <https://docs.docker.com/desktop/release-notes/#4131>`_ **or below**.
28+
It has been observed that newer versions present problems when running Windows Docker containers.
29+
30+
#. When prompted for ``Use WSL2 instead of Hyper-V (recommended)``, **deselect this option**.
31+
32+
#. Once the installation process finishes, open up Docker Desktop.
33+
34+
#. On ``Settings >> Software updates``, deselect ``Automatically check for updates``. Then, ``Apply & restart``.
35+
36+
#. On the Windows taskbar, go to the ``Show hidden icons`` section, right click on the Docker Desktop app and
37+
select ``Switch to Windows containers...``.
38+
39+
At this point, your Docker engine will support running Windows Docker containers. Next step will involve downloading
40+
the Geometry service Windows Docker image.
41+
442
Install the PyGeometry image
543
----------------------------
644

45+
Once you have Docker installed on your machine, the next steps involve pulling down the Geometry service
46+
Docker container.
47+
748
#. Using your GitHub credentials, download the Docker image from the `pygeometry <https://github.com/pyansys/pygeometry>`_ repository.
49+
850
#. If you have Docker installed, use a GitHub personal access token (PAT) with packages read permission to authorize Docker
951
to access this repository. For more information,
1052
see `creating a personal access token <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token>`_.
1153

1254
#. Save the token to a file:
1355

14-
.. code:: bash
56+
.. code-block:: bash
1557
16-
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt
58+
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt
1759
1860
#. Authorize Docker to access the repository:
1961

20-
.. code:: bash
62+
.. tab-set::
2163

22-
GH_USERNAME=<my-github-username>
23-
cat GH_TOKEN.txt | docker login docker.pkg.github.com -u $GH_USERNAME --password-stdin
64+
.. tab-item:: Linux/Mac
2465

25-
#. Pull the Geometry service locally using Docker with:
66+
.. code-block:: bash
67+
68+
GH_USERNAME=<my-github-username>
69+
cat GH_TOKEN.txt | docker login ghcr.io -u $GH_USERNAME --password-stdin
70+
71+
.. tab-item:: Powershell
72+
73+
.. code-block:: bash
74+
75+
$env:GH_USERNAME=<my-github-username>
76+
cat GH_TOKEN.txt | docker login ghcr.io -u $env:GH_USERNAME --password-stdin
77+
78+
.. tab-item:: Windows CMD
2679

80+
.. code-block:: bash
81+
82+
SET GH_USERNAME=<my-github-username>
83+
type GH_TOKEN.txt | docker login ghcr.io -u %GH_USERNAME% --password-stdin
84+
85+
86+
#. Pull the Geometry service locally using Docker with:
2787

2888
.. code:: bash
2989
@@ -72,6 +132,14 @@ Depending on the mechanism chosen to launch the Geometry service, you can set th
72132
export ANSRV_GEO_ENABLE_TRACE=0
73133
export ANSRV_GEO_LOG_LEVEL=2
74134
135+
.. tab-item:: Powershell
136+
137+
.. code-block:: bash
138+
139+
$env:ANSRV_GEO_LICENSE_SERVER="127.0.0.1"
140+
$env:ANSRV_GEO_ENABLE_TRACE=0
141+
$env:ANSRV_GEO_LOG_LEVEL=2
142+
75143
.. tab-item:: Windows
76144

77145
.. code-block:: bash

doc/source/getting_started/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ To use PyGeometry, you must have a local installation of `Docker <https://docs.d
77
To start the service locally, you must be `authenticated to ghcr.io
88
<https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry>`_.
99

10+
.. caution::
11+
PyGeometry is a client library that works with a Geometry service backend. This service is distributed
12+
as a Docker container. At the moment, there is only a Windows Docker container version available for this
13+
service. For more information please refer to the :ref:`Geometry service using Docker <ref_docker>` section.
14+
1015
.. toctree::
1116

1217
docker

0 commit comments

Comments
 (0)