Skip to content

3.3 Debug guide

AlexanderZender edited this page Oct 28, 2022 · 21 revisions

Introduction

This is a guide on how to set up the debug environment for this project as well as how to debug multiple components at the same time. You should have installed all required tools recommended inside the Developer installation guide before beginning this guide.

Frontend

First the dataset path must be set to the controller path or else, controller and frontend will not use the same path or crash:

Change the launchSettings.json of the frontend: image

To the correct path on your system to the controller app-data/datasets path

Open Visual Studio and select the BlazorBoilerplate.sln file as "open a project or solution" source. Select the BlazorBoilerplate.Server project in the top bar next to the debug buttons:

image

Info: if this is the first time starting the application, it might take a while before the web page is displayed. Blazor is setting up the local ML SQL database.

After a while a browser with the login page will open automatically:

image

You can log in using the default user:

Name: user

Password: user123

Important: You also need to start the Controller project and MongoDB server. Without the Controller, the Frontend can not retrieve information from the Controller and will crash or display several errors.

Backend

Each component within the Backend can be opened up individually using Visual Studio Code and the "open folder" option.

Controller

Open Visual Studio Code and open the controller folder.

Set up the virtual environment (venv)

Next, open a new Terminal, Menu: Terminal->New Terminal. This will open a new Terminal at the bottom of VS Code. Check the path of the prompt that you are within the controller folder: image

Execute the command: python -m venv .venv This will create a new virtual environment within the controller folder which will be used to install dependencies and debug the controller. Now you should be able to see a new folder: .venv:

image

VS Code will display a popup if you want to use the newly created venv for debugging, press yes. Now we are located within said venv, which we can check looking at the bottom right of VS Code: image

In case nothing with Python is displayed, manually select any Python file first within VS Code. In case you only see your current Python version without any venv annotation like in the screenshot, press the python number, and VS Code will prompt you to choose between all available environments:

image

Now select the one with the venv path.

Finally, open up a new Terminal. The new Terminal will use the newly created venv. If a terminal is located within the venv, it will display the name of the venv as a prefix before the prompt:

image

Now all required packages can be installed, by executing the command: pip install -r .\requirements.txt

This process might take a while. In case you receive an error message with "check the permissions", reopen VS Code with Administrator privilege and re-execute the dependencies installation. (Don´t forget to check that the terminal is using the venv!)

Debug

Switching to the debug menu in VS Code, the controller can be debugged: image

Info: Every backend component has a preconfigured debug profile for VS Code. When opening the debug menu in VS Code, the component name will be recognized automatically.

Adapter

Open Visual Studio Code and open the AutoML folder for the specific AutoML you want to set up/debug. The specific implementation of each AutoML Adapter can be found within the folder "adapter".

Example: If you want to set up the AutoCVE Adapter open the folder: "/adapters/AutoCVE"

Set up the virtual environment

Follow the instruction for setting up a virtual environment from the controller component above. But instead of the controller folder, check that the terminal is within the respective AutoML adapter folder.

Update adapter development config

Within each adapter the training-path variable inside the development config must be updated. It must point to the local system path where the MetaAutoML folder is located: config_development.json

Debug

Follow the instruction for debugging the controller from above.

Multiple debugging

Debugging the entire OMA-ML project can be accomplished by executing the Frontend within Visual Studio and every Backend component with a separate instance of Visual Studio Code opened in their respective folder. It is important to note that debugging all AutoML Adapters at the same time might require a lot of resources, therefore only recommended for strong multicore systems.

If this is not possible, it is also viable to only execute one AutoML solution. The frontend will display every AutoML Adapter as failed in such a case, but the running AutoML will not be influenced by that.