Running CommonRoad Search with Docker in Windows

A student from the class (Timo) could run the CommonRoad Search exercise with Docker in Windows. Here is his instructions:
To all fellow students reading: I’d recommend using Docker on Windows to solve this:

  1. Install Docker
  2. Follow the link saying you need “WSL” (Windows Subsystem for Linux)
  3. Install WSL, then install Ubuntu from the Microsoft Store
  4. Have Docker recognize the Ubuntu subsystem (maybe need to set the WSL-version to 2 instead of 1)
  5. Install by following the docker readme in CR Search repository (you need the commands listed below to download everything and then install the docker container).
  6. Set up PyCharm and open the commonroad-search folder as project folder. It will recognize the Docker setting, follow up on this and configure the settings that you can see in the commands below (port 9000->8888, name of container, “commonroad-search:2021_AI” as tag, mount points $(pwd)->/commonroad/… and “-it” as launch option)

Get-Content .\commonroad_search_2021.dockerfile | docker build - -t commonroad-search:2021_AI

docker run -it -p 9000:8888 --name commonroadsearch --mount src="$(pwd)",target=/commonroad/commonroad-search,type=bind commonroad-search:2021_AI

Another manual:

Windows 10 or Windows 11 is required. If you are using an earlier version of windows, please use the provided virtual machine image instead. If the manual seems too complicated, it is also recommended to use the virtual machine.

1 Install WSL2.
(Docker Desktop WSL 2 backend | Docker Documentation)

1.1 Install Windows 10, version 1903 or higher, or Windows 11. If you use an earlier version of Windows 10, you could update it.
1.2 Enable WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation.
1.3 Download and install the Linux kernel update package

2 Install Docker
3 Download commonroad_search_2021.dockerfile from CR Search repository
4 Open windows PowerShell
5 Please make sure you have at least 6-10 GB on your system disk (where the windows is installed) after installing ubuntu for windows.
6 Download and build everything. In PowerShell, run:
Get-Content .\commonroad_search_2021.dockerfile | docker build - -t commonroad-search:2021_AI
7 Run the docker container
docker run -it -p 9000:8888 --name commonroadsearch --mount src="$(pwd)",target=/commonroad/commonroad-search,type=bind commonroad-search:2021_AI

In order to load the jupyter notebook, please navigate to localhost:9000 in your web browser.

8 (optional step) In order to debug python scripts using PyCharm, please install the Pro version of PyCharm (we recommend the latest version), then follow the manual:
(Docker | PyCharm)

The following steps are particularly important

8.1 Enable ‘Expose daemon on tcp://localhost:2375 without TLS’ in Docker settings
8.2 Select option Connect to the Docker Daemon with Docker for Windows in PyCharm settings.
8.3 Connect to the docker daemon in Pycharm (described in the manual).
8.4 Create a new project using any local python interpreter. Go to settings-> Project-> Python Interpreter, create a new python interpreter of type Docker.

image name: commonroad-search:2021_AI
python interpreter path: /opt/conda/bin/python
8.5 Create a new python script

import commonroad_dc.pycrcc as pycrcc
print(“hello world”)

click Run-> Debug, edit the configuration to use the newly created docker interpreter. Debug the script to make sure everything is set up correctly.

If at any time you run out of free space on the system disk and docker stops working, please make some space on the system drive and reboot windows.

If PyCharm hangs when creating the project/initializing the interpreter, kill it with the task manager and try again.

Installation takes time. Once everything is set up, the debugging and execution work really fast.

To start the docker container after rebooting windows, just click on the Docker icon in Tray, select Containers/Apps in Docker and start the container commonroadsearch.

If you have any questions regarding the installation of the docker version on windows OS, please don’t hesitate to ask them.

Hi, I try to use Pycharm to run the code. However, when I follow the setting steps, the Pycharm always hang in the interpreter initialization. How can I solve the problem?