|
| 1 | +.. _ref_docker: |
| 2 | + |
1 | 3 | Geometry service using Docker |
2 | 4 | ============================= |
3 | 5 |
|
| 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 | + |
4 | 42 | Install the PyGeometry image |
5 | 43 | ---------------------------- |
6 | 44 |
|
| 45 | +Once you have Docker installed on your machine, the next steps involve pulling down the Geometry service |
| 46 | +Docker container. |
| 47 | + |
7 | 48 | #. Using your GitHub credentials, download the Docker image from the `pygeometry <https://github.com/pyansys/pygeometry>`_ repository. |
| 49 | + |
8 | 50 | #. If you have Docker installed, use a GitHub personal access token (PAT) with packages read permission to authorize Docker |
9 | 51 | to access this repository. For more information, |
10 | 52 | see `creating a personal access token <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token>`_. |
11 | 53 |
|
12 | 54 | #. Save the token to a file: |
13 | 55 |
|
14 | | - .. code:: bash |
| 56 | + .. code-block:: bash |
15 | 57 |
|
16 | | - echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt |
| 58 | + echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt |
17 | 59 |
|
18 | 60 | #. Authorize Docker to access the repository: |
19 | 61 |
|
20 | | - .. code:: bash |
| 62 | +.. tab-set:: |
21 | 63 |
|
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 |
| 65 | + |
| 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 |
| 79 | + |
| 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 |
24 | 84 |
|
25 | | -#. Pull the Geometry service locally using Docker with: |
26 | 85 |
|
| 86 | +#. Pull the Geometry service locally using Docker with: |
27 | 87 |
|
28 | 88 | .. code:: bash |
29 | 89 |
|
@@ -72,7 +132,15 @@ Depending on the mechanism chosen to launch the Geometry service, you can set th |
72 | 132 | export ANSRV_GEO_ENABLE_TRACE=0 |
73 | 133 | export ANSRV_GEO_LOG_LEVEL=2 |
74 | 134 |
|
75 | | - .. tab-item:: Windows |
| 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 | +
|
| 143 | + .. tab-item:: Windows CMD |
76 | 144 |
|
77 | 145 | .. code-block:: bash |
78 | 146 |
|
@@ -150,7 +218,14 @@ If you want to change the defaults, modify environment variables and the |
150 | 218 | export ANSRV_GEO_HOST=127.0.0.1 |
151 | 219 | export ANSRV_GEO_PORT=50051 |
152 | 220 |
|
153 | | - .. tab-item:: Windows |
| 221 | + .. tab-item:: Powershell |
| 222 | + |
| 223 | + .. code-block:: bash |
| 224 | +
|
| 225 | + $env:ANSRV_GEO_HOST="127.0.0.1" |
| 226 | + $env:ANSRV_GEO_PORT=50051 |
| 227 | +
|
| 228 | + .. tab-item:: Windows CMD |
154 | 229 |
|
155 | 230 | .. code-block:: bash |
156 | 231 |
|
|
0 commit comments