-
Notifications
You must be signed in to change notification settings - Fork 7
feat: use grpc secure channel #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #783 +/- ##
==========================================
- Coverage 88.99% 87.03% -1.97%
==========================================
Files 39 40 +1
Lines 5653 5760 +107
==========================================
- Hits 5031 5013 -18
- Misses 622 747 +125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| err, stderr_file = tempfile.mkstemp(suffix="speos_err.txt", dir=logfile_loc) | ||
|
|
||
| subprocess.Popen(command, stdout=out, stderr=err) # nosec B603 | ||
| return Speos( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not create local RPC server if using version before 2025.2.3. We can:
Option 1. if version <= 252, using the previous Speos method and raise security warning message
Option 2. raise error directly that this method only supports from 252.
@etiennearnal @StefanThoene @jomadec
| assert running is not closed | ||
|
|
||
|
|
||
| @patch.object(subprocess, "Popen") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StefanThoene let's check on this
| import os | ||
| from pathlib import Path | ||
| import subprocess # nosec | ||
| import tempfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@echambla Could you please review the kernel and grpc module part.
| from ansys.speos.core import Speos | ||
| speos = Speos(host="127.0.0.1", port=50098) | ||
| speos = Speos(channel = default_docker_channel()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| speos = Speos(channel = default_docker_channel()) | |
| speos = Speos() | |
| Be aware that such docker is launched via insecure channel | |
| By default, the ``Speos`` instance connects to ``"localhost"`` on | |
| port ``50098``. | |
| You can change this by modifying the ``host`` and ``port`` | |
| parameters of ``default_docker_channel``, but note that you must also modify | |
| your ``docker run`` command by changing the ``<HOST-PORT>-50098`` argument. | |
| The following tabs show the commands that set the ``host`` and ``port`` | |
| parameters of ``default_docker_channel``. | |
| .. code:: python | |
| from ansys.speos.core import Speos, default_docker_channel | |
| speos = Speos(channel = default_docker_channel(host="127.0.0.1", port=50098)) |
@etiennearnal @jomadec could you please review this? also, could we provide explanation/an example to launch docker in secure way?
Description
Including the usage of secure channels upon Speos client.
Secure channel creation is based on cyberchannel.
[breaking change]
Speosconstructor parametershostandportare removed. Please consider to create thegrpc.Channelusingdefault_local_channel:Checklist
feat: add optical property)