|
| 1 | +.. currentmodule:: tidy3d |
| 2 | + |
| 3 | +Nexus Environment Configuration |
| 4 | +================================ |
| 5 | + |
| 6 | +Overview |
| 7 | +-------- |
| 8 | + |
| 9 | +The Nexus environment enables Tidy3D to connect to custom on-premises or private cloud deployments for enterprise customers. |
| 10 | + |
| 11 | +.. note:: |
| 12 | + This feature is for enterprise customers with custom Tidy3D deployments. Most users should use the standard API key setup with the default production environment. |
| 13 | + |
| 14 | +Quick Start |
| 15 | +----------- |
| 16 | + |
| 17 | +**Simple setup** using the convenience option: |
| 18 | + |
| 19 | +.. code-block:: bash |
| 20 | +
|
| 21 | + tidy3d configure --apikey YOUR_KEY \ |
| 22 | + --nexus-url http://your-server |
| 23 | +
|
| 24 | +This automatically sets: |
| 25 | + |
| 26 | +- API endpoint: ``http://your-server:5000`` |
| 27 | +- Website endpoint: ``http://your-server/tidy3d`` |
| 28 | +- S3 endpoint: ``http://your-server:9000`` |
| 29 | + |
| 30 | +**Advanced setup** with individual endpoints: |
| 31 | + |
| 32 | +.. code-block:: bash |
| 33 | +
|
| 34 | + tidy3d configure --apikey YOUR_KEY \ |
| 35 | + --api-endpoint http://your-server:5000 \ |
| 36 | + --website-endpoint http://your-server/tidy3d |
| 37 | +
|
| 38 | +Or configure only Nexus endpoints (preserves existing API key): |
| 39 | + |
| 40 | +.. code-block:: bash |
| 41 | +
|
| 42 | + tidy3d configure --nexus-url http://your-server |
| 43 | +
|
| 44 | +Configuration |
| 45 | +------------- |
| 46 | + |
| 47 | +Command Syntax |
| 48 | +~~~~~~~~~~~~~~ |
| 49 | + |
| 50 | +.. code-block:: bash |
| 51 | +
|
| 52 | + tidy3d configure [--apikey <key>] [--nexus-url <url> | --api-endpoint <url> --website-endpoint <url>] [OPTIONS] |
| 53 | +
|
| 54 | +**Options:** |
| 55 | + |
| 56 | +* ``--apikey <key>``: API key (prompts if not provided and no Nexus options given) |
| 57 | +* ``--nexus-url <url>``: Nexus base URL (convenience option that automatically sets all endpoints) |
| 58 | +* ``--api-endpoint <url>``: Nexus API server URL (overridden by ``--nexus-url``) |
| 59 | +* ``--website-endpoint <url>``: Nexus web interface URL (overridden by ``--nexus-url``) |
| 60 | +* ``--s3-region <region>``: S3 region (default: us-east-1) |
| 61 | +* ``--s3-endpoint <url>``: S3 storage URL (overridden by ``--nexus-url``) |
| 62 | +* ``--ssl-verify`` / ``--no-ssl-verify``: SSL verification (default: disabled) |
| 63 | +* ``--enable-caching`` / ``--no-caching``: Result caching (default: disabled) |
| 64 | + |
| 65 | +Examples |
| 66 | +~~~~~~~~ |
| 67 | + |
| 68 | +.. code-block:: bash |
| 69 | +
|
| 70 | + # Simple configuration using nexus-url (recommended) |
| 71 | + tidy3d configure --apikey XXX \ |
| 72 | + --nexus-url http://ec2-instance.compute.amazonaws.com |
| 73 | +
|
| 74 | + # Configure individual endpoints |
| 75 | + tidy3d configure --apikey XXX \ |
| 76 | + --api-endpoint http://api.company.com:5000 \ |
| 77 | + --website-endpoint http://tidy3d.company.com |
| 78 | +
|
| 79 | + # Add Nexus to existing configuration |
| 80 | + tidy3d configure --nexus-url http://api.company.com |
| 81 | +
|
| 82 | + # With all options |
| 83 | + tidy3d configure --apikey XXX \ |
| 84 | + --api-endpoint https://api.company.com \ |
| 85 | + --website-endpoint https://tidy3d.company.com \ |
| 86 | + --s3-region eu-west-1 \ |
| 87 | + --s3-endpoint http://s3.company.com:9000 \ |
| 88 | + --ssl-verify \ |
| 89 | + --enable-caching |
| 90 | +
|
| 91 | +Configuration File |
| 92 | +~~~~~~~~~~~~~~~~~~ |
| 93 | + |
| 94 | +Settings are stored in ``~/.tidy3d/config`` (Windows: ``C:\Users\username\.tidy3d\config``): |
| 95 | + |
| 96 | +.. code-block:: toml |
| 97 | +
|
| 98 | + apikey = "your-api-key" |
| 99 | + web_api_endpoint = "http://your-server:5000" |
| 100 | + website_endpoint = "http://your-server/tidy3d" |
| 101 | + s3_region = "us-east-1" |
| 102 | + s3_endpoint = "http://127.0.0.1:9000" |
| 103 | + ssl_verify = false |
| 104 | + enable_caching = false |
| 105 | +
|
| 106 | +Python Usage |
| 107 | +------------ |
| 108 | + |
| 109 | +No code changes required. Tidy3D automatically uses the configured endpoints: |
| 110 | + |
| 111 | +.. code-block:: python |
| 112 | +
|
| 113 | + import tidy3d as td |
| 114 | + import tidy3d.web as web |
| 115 | + |
| 116 | + sim = td.Simulation(...) |
| 117 | + sim_data = web.run(sim, task_name="my_sim") |
| 118 | +
|
| 119 | +
|
| 120 | +Removing Configuration |
| 121 | +---------------------- |
| 122 | + |
| 123 | +Delete the entire file and reconfigure: |
| 124 | + |
| 125 | +.. code-block:: bash |
| 126 | +
|
| 127 | + rm ~/.tidy3d/config |
| 128 | + tidy3d configure --apikey=YOUR_API_KEY |
| 129 | +
|
| 130 | +Troubleshooting |
| 131 | +--------------- |
| 132 | + |
| 133 | +**Verify configuration:** |
| 134 | + |
| 135 | +.. code-block:: python |
| 136 | +
|
| 137 | + from tidy3d.web.core.environment import Env |
| 138 | + print(Env.current.name, Env.current.web_api_endpoint) |
| 139 | +
|
| 140 | +**Test connectivity:** |
| 141 | + |
| 142 | +.. code-block:: bash |
| 143 | +
|
| 144 | + curl http://your-api-endpoint:5000/health |
| 145 | + export TIDY3D_ENV=prod && python -c "import tidy3d.web as web; web.test()" |
| 146 | +
|
| 147 | +See Also |
| 148 | +-------- |
| 149 | + |
| 150 | +* :doc:`submit_simulations` - Submitting and managing simulations |
| 151 | +* :doc:`../install` - Installation and API key setup |
0 commit comments