Skip to content

Enable running Cubit on a virtual machine via SSH#108

Open
m-frey wants to merge 12 commits intoimcs-compsim:mainfrom
m-frey:add-virtual-machine-cubit-support
Open

Enable running Cubit on a virtual machine via SSH#108
m-frey wants to merge 12 commits intoimcs-compsim:mainfrom
m-frey:add-virtual-machine-cubit-support

Conversation

@m-frey
Copy link
Contributor

@m-frey m-frey commented Nov 14, 2025

This Draft adds first support for executing and visualizing Coreform Cubit run inside a Windows VM.
Tested with Parallels/Windows11

The following tests are currently failing:

  • test_cubitpy.py::test_element_types_tet
    AssertionError: Inputs are not equal

  • test_cubitpy.py::test_extrude_mesh_function
    AssertionError: Numeric mismatch (0.6917… != expected)

  • test_cubitpy.py::test_extrude_mesh_function_average_normals_for_cylinder_and_sphere

  • test_cubitpy.py::test_get_id_functions
    AssertionError: [2] == [1, 2] failed

  • test_cubitpy.py::test_display_in_cubit
    TypeError: expected str, got bytes

  • test_cubitpy.py::test_import_fluent_geometry
    AssertionError: Expected 1, got 0

  • test_cubitpy.py::test_cmd_return
    AssertionError: 1 != 0

  • test_fw.py::test_debug_env
    AssertionError: False is not True

  • test_tutorial.py::test_cubit_tutorial
    AssertionError: Inputs are not equal

@m-frey m-frey had a problem deploying to cubit_secrets_untrusted November 14, 2025 15:29 — with GitHub Actions Failure
@m-frey m-frey requested a review from isteinbrecher November 14, 2025 15:29
@isteinbrecher
Copy link
Collaborator

isteinbrecher commented Nov 17, 2025

Thanks for the work @m-frey. I am not super familiar with all the changes but in general this looks good, if this works for you on Windows. One question: Do you use this to run CubitPy on a macOS/Linux system and then connect to Windows vis ssh or is this run entirely on Windows?

I think the best way to proceed is to talk about this in person in the near future.

@m-frey
Copy link
Contributor Author

m-frey commented Nov 17, 2025

yes, cubitpy on macOS/linux, coreform on Windows.

@isteinbrecher
Copy link
Collaborator

Sounds good. Do you have any idea on how we can test this?
Should we also cover the case that everything runs on windows?

@m-frey m-frey had a problem deploying to cubit_secrets_untrusted November 26, 2025 16:34 — with GitHub Actions Failure
@m-frey m-frey force-pushed the add-virtual-machine-cubit-support branch from 30b54b4 to 591d31f Compare November 26, 2025 17:12
@m-frey m-frey had a problem deploying to cubit_secrets_untrusted November 26, 2025 17:12 — with GitHub Actions Failure
@m-frey m-frey marked this pull request as ready for review November 26, 2025 17:19
@m-frey m-frey changed the title WIP: Enable running Cubit on a virtual machine via SSH Enable running Cubit on a virtual machine via SSH Nov 26, 2025
Copy link
Collaborator

@isteinbrecher isteinbrecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-frey I left a comment regarding the display functionality. Let's talk about this whole changes once you are ready.

I am really happy that such a complex use case can be implemented relatively easy.

@m-frey m-frey marked this pull request as draft December 2, 2025 12:34
@m-frey m-frey force-pushed the add-virtual-machine-cubit-support branch from 591d31f to 0c80fee Compare December 2, 2025 12:48
@m-frey m-frey had a problem deploying to cubit_secrets_untrusted December 2, 2025 12:48 — with GitHub Actions Failure
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted December 2, 2025 15:12 — with GitHub Actions Inactive
@m-frey m-frey had a problem deploying to cubit_secrets_untrusted December 2, 2025 20:18 — with GitHub Actions Failure
@m-frey m-frey had a problem deploying to cubit_secrets_untrusted December 2, 2025 20:41 — with GitHub Actions Failure
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted December 10, 2025 10:24 — with GitHub Actions Inactive
@isteinbrecher
Copy link
Collaborator

@m-frey one thing that came to my mind: I think we can test most of the proposed features quite easy. We can use a ssh connection to the local host (then the ssh client is a Linux machine, but that should not be much effort).

Especially if the ssh connection is a required feature for you and others, testing is very beneficial. We can talk about how to do this in detail.

@m-frey m-frey force-pushed the add-virtual-machine-cubit-support branch from 80729f9 to ec974b7 Compare January 9, 2026 11:56
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted January 9, 2026 11:56 — with GitHub Actions Inactive
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted January 21, 2026 14:12 — with GitHub Actions Inactive
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted January 22, 2026 14:27 — with GitHub Actions Inactive
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted January 23, 2026 09:35 — with GitHub Actions Inactive
@m-frey m-frey self-assigned this Jan 23, 2026
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted January 23, 2026 11:25 — with GitHub Actions Inactive
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for running Coreform Cubit on a remote Windows virtual machine via SSH, tested with Parallels/Windows 11. The implementation enables remote Cubit execution, file transfers via SCP, and visualization using Windows scheduled tasks.

Changes:

  • Added SSH-based remote execution support for Cubit operations on Windows VMs
  • Implemented remote file transfer functionality using SCP for mesh exports
  • Added Windows scheduled task integration for remote GUI visualization

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 27 comments.

Show a summary per file
File Description
src/cubitpy/cubitpy.py Added remote SSH execution, file transfer functions, and remote display functionality with Windows task scheduler integration
src/cubitpy/cubit_wrapper/cubit_wrapper_host.py Refactored gateway setup to support both local and remote modes; improved exception handling
src/cubitpy/cubit_wrapper/cubit_wrapper_client.py Added remote operations handlers for directory creation, OS detection, and journal file generation
src/cubitpy/cubit_to_fourc_input.py Updated mesh export to handle remote paths with file existence validation
src/cubitpy/conf.py Added remote configuration support with new accessor methods and Python prologue for remote initialization
Comments suppressed due to low confidence (1)

src/cubitpy/conf.py:283

  • The is_coreform() method accesses cls._config["local_config"]["cubit_path"] even when in remote mode (line 279). When cls.is_remote() returns True, this will fail because the local_config section may not exist or may not be properly configured. The method should handle the remote case separately or check is_remote() before accessing local_config.
    def is_coreform(cls):
        """Return if the given path is a path to cubit coreform."""
        cubit_root = cls._config["local_config"]["cubit_path"]
        if "15.2" in cubit_root and not cls.is_remote():
            return False
        else:
            return True

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +587 to +588
self.display_in_cubit_remote(labels, delay, testing)
return
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When cupy.is_remote() is True and testing=True, the function returns early without a return value (line 587-588), which means it returns None. However, the non-remote path returns a journal_path string when testing=True (line 651). This inconsistency breaks the test expectations. The remote version should return the journal path string (JOURNAL) when testing is True, not a dictionary, to maintain API compatibility. Change line 759-765 to return just JOURNAL instead of a dictionary.

Suggested change
self.display_in_cubit_remote(labels, delay, testing)
return
return self.display_in_cubit_remote(labels, delay, testing)

Copilot uses AI. Check for mistakes.
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted February 1, 2026 12:25 — with GitHub Actions Inactive
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted February 1, 2026 12:28 — with GitHub Actions Inactive
@m-frey m-frey requested a deployment to cubit_secrets_untrusted February 1, 2026 12:39 — with GitHub Actions Waiting
@m-frey m-frey temporarily deployed to cubit_secrets_untrusted February 1, 2026 13:32 — with GitHub Actions Inactive
@m-frey
Copy link
Contributor Author

m-frey commented Feb 1, 2026

@m-frey one thing that came to my mind: I think we can test most of the proposed features quite easy. We can use a ssh connection to the local host (then the ssh client is a Linux machine, but that should not be much effort).

Especially if the ssh connection is a required feature for you and others, testing is very beneficial. We can talk about how to do this in detail.

Good idea, but i would suggest to add this in a later pr as it requires to allow ubuntu as a remote os which is currently not the case

@m-frey m-frey marked this pull request as ready for review February 1, 2026 13:59
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.

3 participants