Skip to content
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

Add support for Ansys Lab Proxy connection #308

Merged
merged 24 commits into from
Sep 27, 2023
Merged

Conversation

mfkrogh
Copy link
Collaborator

@mfkrogh mfkrogh commented Sep 12, 2023

Since the web socket server in the EnSight Docker Container is providing an http connection, instead of https which requires a cert, we use an https / http proxy server provided by Ansys Lab for these connections. When PyEnSight is used with Ansys Lab, it launches the EnSight Docker Container via PyPIM. PIM handles the details of launching on a back-end VM along with setting up the https-to-http proxy server. The proxy host and port number are passed back to PyEnSight via PyPIM. Additionally, a session specific GUID, indicated by the "instance_name=GUID" parameter, is provided that allows the proxy to map multiple session connections to their appropriate container and port. The GUID is used ether as an http header or as part of the URL query parameters. All of this is internal and not something a user would manipulate.

The reason this is needed is that some content returned by EnSight over the http connection consists of URLs that the user's browser is intended to access directly, typically through an IFRAME, for example. Since the browser has no route to the back-end VM server hosting the Docker Container, it must route through the proxy server which is Internet accessible. The proxy server is acting as a bridge between the browser and the privately hosted http server in the EnSight Container. Additionally, since the browser is connecting to something other than 'localhost', it needs to do this over https instead of http as most browsers typically prohibit using http off-box.

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2023

Codecov Report

Merging #308 (fc17d07) into main (01bd3e7) will decrease coverage by 0.58%.
The diff coverage is 67.67%.

@@            Coverage Diff             @@
##             main     #308      +/-   ##
==========================================
- Coverage   81.65%   81.08%   -0.58%     
==========================================
  Files          18       18              
  Lines        2437     2500      +63     
  Branches      425      394      -31     
==========================================
+ Hits         1990     2027      +37     
- Misses        301      319      +18     
- Partials      146      154       +8     
Files Coverage Δ
src/ansys/pyensight/core/session.py 90.71% <100.00%> (+0.64%) ⬆️
src/ansys/pyensight/core/launch_ensight.py 53.12% <0.00%> (ø)
src/ansys/pyensight/core/enshell_grpc.py 59.47% <50.00%> (-0.79%) ⬇️
src/ansys/pyensight/core/dockerlauncher.py 81.04% <68.18%> (-2.15%) ⬇️
src/ansys/pyensight/core/launcher.py 77.55% <46.15%> (-5.01%) ⬇️
src/ansys/pyensight/core/renderable.py 88.43% <71.15%> (-3.52%) ⬇️

@mfkrogh mfkrogh marked this pull request as ready for review September 26, 2023 14:38
@jerome-blanche
Copy link
Contributor

Hi @mfkrogh !

src/ansys/pyensight/core/dockerlauncher.py Outdated Show resolved Hide resolved
src/ansys/pyensight/core/dockerlauncher.py Outdated Show resolved Hide resolved
mfkrogh and others added 2 commits September 27, 2023 08:52
Co-authored-by: Blanche Jérôme <90267895+jerome-blanche@users.noreply.github.com>
Co-authored-by: Blanche Jérôme <90267895+jerome-blanche@users.noreply.github.com>
@mfkrogh
Copy link
Collaborator Author

mfkrogh commented Sep 27, 2023

I've retested with Jerome's modifications. Works well.

@mfkrogh mfkrogh closed this Sep 27, 2023
@mfkrogh mfkrogh reopened this Sep 27, 2023
@mfkrogh mfkrogh merged commit 90d0626 into main Sep 27, 2023
21 checks passed
@mfkrogh mfkrogh deleted the feat/add_ansys_lab_proxy branch September 27, 2023 14:11
mariostieriansys added a commit that referenced this pull request Sep 27, 2023
Co-authored-by: Mario Ostieri <mario.ostieri@ansys.com>
Co-authored-by: Blanche Jérôme <90267895+jerome-blanche@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants