|
| 1 | +.. |
| 2 | + SPDX-FileCopyrightText: Contributors to PyPSA-Eur <https://github.com/pypsa/pypsa-eur> |
| 3 | +
|
| 4 | + SPDX-License-Identifier: CC-BY-4.0 |
| 5 | + |
| 6 | +########################################## |
| 7 | +OETC Integration |
| 8 | +########################################## |
| 9 | + |
| 10 | +The OETC platform allows PyPSA-Eur to leverage cloud-based resources for |
| 11 | +solving energy system models. This integration enables solving of optimization problems |
| 12 | +using remote compute resources when local computational capacity is insufficient. |
| 13 | + |
| 14 | +.. _oetc_overview: |
| 15 | + |
| 16 | +Overview |
| 17 | +======== |
| 18 | + |
| 19 | +OETC provides a cloud-based optimization service that can handle PyPSA networks by: |
| 20 | + |
| 21 | +- Offloading optimization tasks to remote compute resources |
| 22 | +- Supporting various solvers (Highs, Gurobi, etc.) on cloud infrastructure |
| 23 | +- Automatically managing authentication and resource allocation |
| 24 | +- Providing configurable compute resources (CPU cores, disk space) |
| 25 | + |
| 26 | +The integration is implemented through the ``linopy.oetc`` module and is configured |
| 27 | +within the PyPSA-Eur solving configuration. |
| 28 | + |
| 29 | +.. _oetc_setup: |
| 30 | + |
| 31 | +Setup and Authentication |
| 32 | +======================== |
| 33 | + |
| 34 | +To use OETC with PyPSA-Eur, you need to: |
| 35 | + |
| 36 | +1. **Set up environment variables** for authentication based on your OETC credentials: |
| 37 | + |
| 38 | + .. code:: bash |
| 39 | +
|
| 40 | + export OETC_EMAIL="your-email@example.com" |
| 41 | + export OETC_PASSWORD="your-password" |
| 42 | +
|
| 43 | +2. **Configure OETC settings** in your configuration file (see :ref:`oetc_config`). |
| 44 | + |
| 45 | +.. _oetc_config: |
| 46 | + |
| 47 | +Configuration |
| 48 | +============= |
| 49 | + |
| 50 | +OETC integration is configured within the ``solving`` section of your configuration file. |
| 51 | +Add an ``oetc`` subsection to enable cloud-based optimization: |
| 52 | + |
| 53 | +.. code:: yaml |
| 54 | +
|
| 55 | + solving: |
| 56 | + # ... other solving options ... |
| 57 | + oetc: |
| 58 | + name: "job-name" # Arbitrary human readable job identifier |
| 59 | + authentication_server_url: "https://auth.oetc.example.com" |
| 60 | + orchestrator_server_url: "https://orchestrator.oetc.example.com" |
| 61 | + compute_provider: "GCP" # Currently only GCP is supported |
| 62 | + cpu_cores: 4 # This also sets the amount of RAM by a factor 8 |
| 63 | + disk_space_gb: 20 |
| 64 | +
|
| 65 | +.. note:: |
| 66 | + |
| 67 | + The ``solver`` and ``solver_options`` are automatically passed from the main |
| 68 | + solving configuration and do not need to be specified in the OETC section. |
| 69 | + |
| 70 | +.. _oetc_usage: |
| 71 | + |
| 72 | +Usage |
| 73 | +===== |
| 74 | + |
| 75 | +Once configured, OETC integration works transparently with the standard PyPSA-Eur |
| 76 | +workflow. If a oetc configuration is present, PyPSA-Eur will automatically use |
| 77 | +the OETC platform for the model optimization during the solve network rule. |
| 78 | + |
| 79 | +An example of a log entry when using OETC: |
| 80 | +.. code:: |
| 81 | + INFO:linopy.oetc:OETC - Signing in... |
| 82 | + INFO:linopy.oetc:OETC - Signed in |
| 83 | + INFO:linopy.oetc:OETC - Fetching user GCP credentials... |
| 84 | + INFO:linopy.oetc:OETC - Fetched user GCP credentials |
| 85 | + INFO:linopy.oetc:OETC - Submitting compute job... |
| 86 | + INFO:linopy.oetc:OETC - Compute job 992616b6-0f24-4ab5-8675-ba8098d795fa started |
| 87 | + INFO:linopy.oetc:OETC - Waiting for job 992616b6-0f24-4ab5-8675-ba8098d795fa to complete... |
| 88 | + INFO:linopy.oetc:OETC - Job 992616b6-0f24-4ab5-8675-ba8098d795fa status: PENDING, checking again in 30 seconds... |
| 89 | + INFO:linopy.oetc:OETC - Job 992616b6-0f24-4ab5-8675-ba8098d795fa status: PENDING, checking again in 45 seconds... |
| 90 | + INFO:linopy.oetc:OETC - Job 992616b6-0f24-4ab5-8675-ba8098d795fa completed successfully! |
| 91 | + INFO:linopy.oetc:OETC - Model solved successfully. Status: ok |
| 92 | + INFO:linopy.oetc:OETC - Objective value: 3.11e+07 |
0 commit comments