...
1) Support full control loop of producing results. In this mode, the UI must be connected with a Jenkins instance capable of running blueprint validation tests.
It will enable the user to define a blueprint for validation using its name, version, layer, desired lab and desired timeslot. This data constitutes a submission. It should be noted that the blueprint family is derived from the blueprint name. Also, the UI will have the ability to track the lifecycle of a submission. A submission state can be one of the following: submitted, waiting, running and completed. The implementation vehicle for this action is the REST API of Jenkins. Moreover, the UI must be connected with a mariadb a mysql instance and the Nexus server where the results are stored. Then, it will be able to trigger the appropriate job in Jenkins and receive the corresponding results from Nexus.
Note that it makes no difference whether the Jenkins instance is the community one or a private one.
2) Partial control of producing results. In this mode, the UI must be connected with a mariadb a mysql instance and the Nexus server where the results are stored.
Every blueprint owner is responsible of executing tests and storing results in Nexus using his/her own Jenkins instance. The UI only retrieves results from Nexus and displays them.
...
In order for the blueprint validation UI to be functional, the following items are taken for granted:
- An appropriate mariadb instance mysql instance is up and running (look at the Database subsection).
This prerequisite concerns both of the UI modes.
- The available labs and their silos (i.e. which silo is used by a lab in order to store results in Nexus) for blueprint validation execution are stored in mariadb mysql (look at the Database subsection). It is the lab owner's responsibility to update them using the UI.
This prerequisite concerns both the partial and the full control loop modes.
- The available timeslots for blueprint validation execution of every lab are stored in the mariadb mysql (look at the Database subsection). It is the lab owner's responsibility to update them using the UI.
This prerequisite concerns only the full control loop mode.
- The data of available blueprints (i.e. blueprint name) is stored in the mariadb the mysql database (look at the Database subsection). This data is automatically updated by the UI using info from Nexus. If a blueprint owner's is not satisfied with this info, he/her must update it using the UI.
This prerequisite concerns only the full control loop mode.
- The data of an available blueprint instance for validation (i.e. version and layer) is stored in the mariadb mysql database (look at the Database subsection). This data is automatically updated by the UI using info from Nexus. If a blueprint owner's is not satisfied with this info, he/her must update it using the UI.
This prerequisite concerns only the full control loop mode.
...
~$ sudo apt install mysql-client
Database
A mariadb database mysql database instance is needed for both modes of the UI with the appropriate databases and tables in order for the back-end system to store and retrieve data.
...
Also, a script has been developed, namely validation/docker/mariadbmysql/deploy.sh which easily deploys the container. This script accepts the following items as input parameters:
CONTAINER_NAME, name of the container, default value is akraino-validation-mariadbmysql
MARIADBMYSQL_ROOT_PASSWORD, the desired mariadb mysql root user password, this variable is required
MARIADBMYSQL_AKRAINO_PASSWORD, the desired mariadb mysql akraino user password, this variable is required
REGISTRY, registry of the mariadb mysql image, default value is akraino
NAME, name of the mariadb mysql image, default value is validation
TAG_PRE, first part of the image version, default value is mariadbmysql
TAG_VER, last part of the image version, default value is latest
MARIADBMYSQL_HOST_PORT, port on which mariadb mysql is exposed on host, default value is 3307
...
In order to build and deploy the image using only the required parameters, the below instructions should be followed:
The mariadb mysql root password, mariadb mysql akraino user password (currently the UI connects to the database using the akraino user), the UI admin password and the UI akraino password should be configured using the appropriate variables and the following commands should be executed:
~$ cd validation/ui
~$ mvn docker:build -Ddocker.filter=akraino/validation:dev-mariadbmysql-latest
~$ cd ../docker/mariadbmysql
~$ ./deploy.sh TAG_PRE=dev-mariadbmysql MARIADBMYSQL_ROOT_PASSWORD=<mariadb<mysql root user password> MARIADBMYSQL_AKRAINO_PASSWORD=<mariadb<mysql akraino user password>
~$ mysql -p<MARIADBp<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadbmysql container> < ../../ui/db-scripts/examples/initialize_db_example.sql
In order to retrieve the IP of the mariadb mysql container, the following command should be executed:
~$ docker inspect <name of the mariadbmysql container>
Furthermore, the TAG_PRE variable should be defined because the default value is 'mariadbmysql' (note that the 'dev-mariadbmysql' is used for development purposes - look at pom.xml file).
If the database must be re-deployed (it is assumed that the corresponding mariadb mysql container has been stopped and deleted) while the persistent storage already exists (currently, the 'akraino-validation-mariadbmysql' docker volume is used), a different approach should be used after the image building process.
To this end, another script has been developed, namely validation/docker/mariadbmysql/deploy_with_existing_storage.sh which easily deploys the container. This script accepts the following as input parameters:
CONTAINER_NAME, the name of the container, default value is akraino-validation-mariadbmysql
REGISTRY, the registry of the mariadb mysql image, default value is akraino
NAME, the name of the mariadb mysql image, default value is validation
TAG_PRE, the first part of the image version, default value is mariadbmysql
TAG_VER, the last part of the image version, default value is latest
MARIADBMYSQL_HOST_PORT, the port on which mariadb mysql is exposed on host, default value is 3307
In order to deploy the image using only the required parameters and the existing persistent storage, the below instructions should be followed:
The mariadb mysql root user password (currently the UI connects to the database using root privileges) should be configured using the appropriate variable and the following commands should be executed:
~$ cd validation/docker/mariadbmysql~$ ./deploy_with_existing_persistent_storage.sh TAG_PRE=dev-mariadbmysql
Finally, if the database must be re-deployed (it is assumed that the corresponding mariadb mysql container has been stopped and deleted) and the old persistent storage must be deleted, the used docker volume should be first deleted (note that all database's data will be lost).
...
~$ docker volume rm akraino-validation-mariadbmysql
~$ cd validation/docker/mariadbmysql
~$ ./deploy.sh TAG_PRE=dev-mariadbmysql MARIADBMYSQL_ROOT_PASSWORD=<root user password> MARIADBMYSQL_AKRAINO_PASSWORD=<mariadb<mysql akraino user password>
~$ mysql -p<MARIADBp<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadbmysql container> < ../../ui/db-scripts/examples/initialize_db_example.sql
...
Then, the following command should be executed:
~$ mysql -p<MARIADBp<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb mysql container> < ./dbscript.sql
...
Then, the following command should be executed:
~$ mysql -p<MARIADBp<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb mysql container> < ./dbscript.sql
...
Then, the following command should be executed:
~$ mysql -p<MARIADBp<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mariadb mysql container> < ./dbscript.sql
...
CONTAINER_NAME, the name of the contaner, default value is akraino-validation-ui
DB_IP_PORT, the IP and port of the maridb instance, this variable is required
MARIADBMYSQL_AKRAINO_PASSWORD, the mariadb mysql akraino user password, this variable is required
REGISTRY, the registry of the mariadb imageUI image, default value is akraino
NAME, the name of the mariadb UI image, default value is validation
TAG_PRE, the first part of the image version, default value is ui
TAG_VER, the last part of the image version, default value is latest
JENKINS_URL, the URL of the Jenkins instance (http or https must be defined), the default value is 'https://jenkins.akraino.org/'
JENKINS_USERNAME, the Jenkins user name, the default value is 'demo' (in the context of UI full control loop mode, this parameter must be changed to include a real Jenkins user)
JENKINS_USER_PASSWORD, the Jenkins user password, the default value is 'demo' (in the context of UI full control loop mode, this parameter must be changed to include a real Jenkins user password)
JENKINS_JOB_NAME, the name of Jenkins job capable of executing the blueprint validation tests, the default value is 'validation' (in the context of UI full control loop mode, this parameter must be changed to include a real Jenkins job name)
NEXUS_PROXY, the needed proxy in order for the Nexus server to be reachable, default value is none
JENKINS_PROXY, the needed proxy in order for the Jenkins server to be reachable, default value is none
CERTDIR, the directory where the SSL certificates can be found, default value is the working directory where self signed certificates exist only for demo purposes
ENCRYPTION_KEY, the key that should be used by the AES algorithm for encrypting passwords stored in database, this variable is required
UI_ADMIN_PASSWORD, the desired Blueprint Validation UI password for the admin user, this variable is required
UI_AKRAINO_PASSWORD, the desired Blueprint Validation UI password for the akraino user, this variable is required
...
So, for a functional UI, the following prerequisites are needed:
- The mariadb mysql container in up and running state
- A Jenkins instance capable of running the blueprint validation test (this is optional and is needed only for UI full control loop mode)
- A Nexus repo in which all the test results are stored.
...
cd ../docker/ui
./deploy.sh TAG_PRE=dev-ui DB_IP_PORT=<IP and port of the mariadb> MARIADBmysql> MYSQL_AKRAINO_PASSWORD=<mariadb akraino <mysql akraino password> ENCRYPTION_KEY=<encryption key> UI_ADMIN_PASSWORD=<UI admin user password> UI_AKRAINO_PASSWORD=<UI akraino user password>
...