Target repository folder structure

Target repository folder structure

Once you have a GitLab repository created, add the folder strucuture to it.

Naming convention

The naming scheme of the target repository is the following: <TARGET>_<RUNTIME>

Example : TARGET = STM32L4R9, RUNTIME = TFLite. The repository name is STM32L4R9_TFLite.

Folder Structure & Scripts

A target repository must be composed of the following folders :

  • AI_Support : Scripts and tools for code generation
  • AI_Project : Project for the target (AI_Benchmark)
  • AI_Build : Scripts to cross compile the code for the target
  • AI_Deploy : Scripts to deploy (programm) the target
  • AI_Manager : Scripts that gather metrics from the target and generate the benchmark report. The final report is saved in the AI_Manager/out folder.
  • docker : Contains the dockerfile and environment dependencies
⚠️
Important: The model file is copied in the root folder. You should then consider that the model file is at this location for all the implementation of this repository. You are free to copy the model file anywhere you want. However, this must be done automatically in your implementation. Look at the available environment variables to get the model file name and other usefull information.
ℹ️
Handling Errors: The errors handling is described here.

Mandatory scripts

In the folders AI_Support, AI_Build, AI_Deploy, and AI_Manager you must place a bash script with the following names :

  • support.sh in AI_Support
  • build.sh in AI_Build
  • deploy.sh in AI_Deploy
  • manager.sh in AI_Manager

Make sure that these scripts have the correct permissions.

ℹ️
Launch order: These scripts are run in the order presented above. The support.sh script is run first, then the build.sh, deploy.sh and finally the manager.sh script.
ℹ️
Launch behaviour: These scripts are run from the parent (root) folder. Thus, the working directory of the shell is from the parent folder. You may use cd commands to change the working directory.

You can copy and run the commands bellow to create all the mandatory folders and bash scripts.

bash
# Create the folders 
mkdir AI_Support
mkdir AI_Project
mkdir AI_Build
mkdir AI_Deploy
mkdir AI_Manager
mkdir AI_Manager/out
mkdir docker

# Create the bash scripts (empty files)
touch AI_Support/support.sh
touch AI_Build/build.sh
touch AI_Deploy/deploy.sh
touch AI_Manager/manager.sh
touch docker/dockerfile

# Give permissions to the scripts
chmod +x AI_Support/support.sh
chmod +x AI_Build/build.sh
chmod +x AI_Deploy/deploy.sh
chmod +x AI_Manager/manager.sh

The resulting structure should look like this :

      • build.sh
      • deploy.sh
      • manager.sh
      • support.sh
      • dockerfile
    • example-model.example
    • example-dataset.bin
  • ℹ️
    Model & Dataset: The example-model.exemple and example-dataset.bin reprsent the location of the model file and the optional dataset file. The exact name of these files are given in environment variables of the dAIEdge-VLAb CI/CD Pipeline.