Versioning

This page describes the versioning strategy used in the dAIEdge project.

Versioning Strategy

  • A tag is created in the Target repo, this tag is constructed as follow :
    • vX.Y.Z, where X is the version of the comptaible VlirtualLab, Y and Z the version of the target.

So, for a target that is compatible with the VirtualLab v1, the tag will be v1.0.0.

Currently, the VERSION_TAG is set for all the target to v1.0.0.

Cloning the VirtualLab Repository

  • The VirtualLab API should start the CI/CD pipeline with the tag ´v1´, ´v2´ … depending on the version wanted. If it is the developper version, the main head is used.
  • Currently, one tag is provided in the VirtualLab repository, the tag is v1.

Cloning the Target Repository

  • The environment variable VERSION_TAG contains the version number of the dAiEdge VLab Release Version.
  • If the tag exists in the target repository, the target repository is cloned with this tag. Otherwise, the target repository is cloned with the head of the main branch.
  • If no tag is provided, the target repository is cloned with the head of the main branch.
    • The VERSION_TAG is defined in the GitLab CI/CD pipeline and should be configured by the VirtualLab API.

To clone the target repository, the CI/CD script is as follows:

#!/bin/bash

##########################
# For a target inside the HE-ARC gitlab
##########################

# Handle exit and error with exported function in exit_functions.sh
# By default the script exit on error and write all stderr messages into error.log
source $FUNCTIONS_PATH/exit_functions.sh

# Disable error log to prevent info leaks. It's still possible to write into error.log with "error_log_print"
error_log_disable

# Temporary disable "exit on error" to be able to write message manually into error.log
set +e
# Clone your source. Repo of your target (node).
info_print "Clone target source into current folder"
TARGET_REPOSITORY_URL=$(echo $TARGET_REPOSITORY_URL | sed -e 's/https:\/\///')

# Check if the tag exists in the GitLab repository
if git ls-remote --tags https://$DEPLOY_TOKEN_USERNAME:$DEPLOY_TOKEN_PASSWORD@$TARGET_REPOSITORY_URL | grep -q "refs/tags/$VERSION_TAG"; then
  info_print "Tag $VERSION_TAG found. Cloning the repository with this tag..."
  git clone --branch $VERSION_TAG https://$DEPLOY_TOKEN_USERNAME:$DEPLOY_TOKEN_PASSWORD@$TARGET_REPOSITORY_URL $1
else
  info_print "Tag $VERSION_TAG not found. Defaulting to the head of the main branch..."
  git clone --branch main https://$DEPLOY_TOKEN_USERNAME:$DEPLOY_TOKEN_PASSWORD@$TARGET_REPOSITORY_URL $1
fi


if [ $? -ne 0 ]; then
    error_log_print "Critical error : The target benchmark source cannot be cloned !"
    exit 1  # Exit to failed the pipeline
fi

# Enable "exit on error"
set -e