RobotCode and Docker Compose

Hi!
With Google, and in Slack, I have found lots of people mentioning using RobotCode and VSCode to debug tests in Docker containers, but I have not found any examples of how to actually set it up, especially with the added complexity of Docker Compose?

Does any one know of an example or tutorial?

Thank-you!

If your system support Docker and has VS Code installed with the Dev Container plugin (by Microsoft), you can see it in action with e.g. this repo:
GitHub - robinmackaij/robocon-demo-api

The .devcontainer folder in combination with the pyproject.toml are the main building blocks.

1 Like

Hello Kevin,

can you explain in more detail what your use case is, or your scenario? What does the complexity of Docker Compose mean in your case?
Where do the robot test cases run? In a Docker container? Do you want to develop in the Docker container or just debug the test cases? Do you want to use devcontainer? Do the test cases run in a CI pipeline and are they run in a Docker container?

There are so many ways to use Docker in combination with Robot/RobotCode…

Daniel

1 Like

Hi @robinmackaij, @daniel,

My scenario is a pre-existing environment with multiple layers of Linux and Windows VMs, Docker Compose containers, built in pipelines, with bits of Ansible thrown in. Configuration is mostly done by bash and powershell scripts AND it is not connected to the external Internet :sweat_smile: nor do I have the flexibility of simplifying it. No problem eh? :smiley:

@robinmackaij I didn’t see a docker-compose.yml file in your example? (As you may know, but for everyone else) Docker Compose is for setting up multi-container applications, and adds another layer of configuration to connecting a debugger to the contained robot - but maybe not that bad…

I have done more reading of how to connect a Python debugger through all these layers, I am hoping once I can sneak the robotcode[debugger] toolset into the docker container, then setting up the ports (like for the Python debugger) will let me use the “attach” command in the VSCode launch.json to connect everything together …or at least I think so…

An actual example for just Docker Compose and VSCode would help immensely (it doesn’t need to include the rest of the complexity :slight_smile: )

Thank-you!
Kevin B.

P.S. Co-pilot did give me some example code, unfortunately it was not all for our reality, so I have some doubts about the rest.

At my current client, it’s actually Docker compose for the devcontainer setup. I cannot share it here, but Microsoft docs has it covered:
Create a Dev Container

Not that the docs also cover connecting to an already running stack / container.

@robinmackaij, thank-you for the explanation - and more reading :slight_smile:

While I had no problems adding the robotcode package to our container, some unfortunate twists are preventing me from easily adding debugpy, which I need as well, and have to figure out first.

Regardless, you and @daniel have left me optimistic!