Recently, I was working on adding support for remote debugging and editing of Python scripts used in the Auto-Discovery feature of our product, ogamm Visual Logger for OPC. (OVL). Ideally would be nice also to have support for version control.

This project has some significant challenges:

  • Python scripts run in a restricted environment, by a Python interpreter embedded into C++ application;
  • Currently, scripts are stored in a SQL database, not in the file system
  • There is no direct access to the OS where this C++ application is running: it is a Docker container. There is also no direct access to the machine where the Docker container runs. Also, it is not desirable to access it over SSH.
  • All interactions to edit Python scripts and debug them must be done over the Web GUI, with the backend accessed via reverse proxy (Nginx).

Before, to edit a Python script, we were using a JavaScript widget that was embedded into the web GUI of the OVL. But that approach lacked a debugging feature, with the ability to set breakpoints, view variable values, and so on, that you would have in a typical development IDE, like Visual Studio Code. BTW, VS Code has a feature to remotely debug Python code running on other machines, using the debugpy Python module on the remote code side.

And just yesterday, wo-la – I found this gem open-source project code-server (https://github.com/coder/code-server) that allows you to access a VS Code instance running in a Docker container, via web browser!

Now we consider incorporating it into our oBox Suite as a tool to edit and debug Python scripts. Stay tuned, this feature should be available soon (hopefully in May 2025).