From: Ioakeim Samaras Date: Fri, 27 Sep 2019 12:08:58 +0000 (+0300) Subject: [UI] Use MySQL instead of MariaDB X-Git-Tag: 2.0.0~29 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F1662%2F1;p=validation.git [UI] Use MySQL instead of MariaDB The UI MariaDB database is substituted with MySQL. In this way, the deployment to Amazon ECS can be supported. JIRA: VAL-58 Signed-off-by: Ioakeim Samaras Change-Id: Iba311b6165a0fe09f187e7787b59739d4c353e02 --- diff --git a/docker/README.rst b/docker/README.rst index 17e84ba..e7f3845 100644 --- a/docker/README.rst +++ b/docker/README.rst @@ -76,36 +76,36 @@ stored on the local server. By default, the container will run the k8s conformance test. If you want to enter the container, add */bin/sh* at the end of the command above -The mariadb container +The mysql container ===================== Building and pushing the container ---------------------------------- -To build just the mariadb container, use the command: +To build just the mysql container, use the command: .. code-block:: console - make mariadb-build [ REGISTRY= NAME=] + make mysql-build [ REGISTRY= NAME=] To both build and push the container, use the command: .. code-block:: console - make mariadb [ REGISTRY= NAME=] + make mysql [ REGISTRY= NAME=] Using the container ------------------- In order for the container to be easily created, the deploy.sh script has been developed. This script accepts the following as input parameters: -CONTAINER_NAME, name of the container, default value is akraino-validation-mariadb -MARIADB_ROOT_PASSWORD, the desired mariadb root user password, this variable is required -MARIADB_AKRAINO_PASSWORD, the desired mariadb akraino user password, this variable is required -REGISTRY, registry of the mariadb image, default value is akraino -NAME, name of the mariadb image, default value is validation -TAG_PRE, first part of the image version, default value is mariadb +CONTAINER_NAME, name of the container, default value is akraino-validation-mysql +MYSQL_ROOT_PASSWORD, the desired mysql root user password, this variable is required +MYSQL_AKRAINO_PASSWORD, the desired mysql akraino user password, this variable is required +REGISTRY, registry of the mysql image, default value is akraino +NAME, name of the mysql image, default value is validation +TAG_PRE, first part of the image version, default value is mysql TAG_VER, last part of the image version, default value is latest -MARIADB_HOST_PORT, port on which mariadb is exposed on host, default value is 3307 +MYSQL_HOST_PORT, port on which mysql is exposed on host, default value is 3307 In order to deploy the container, this script can be executed with the appropriate parameters. @@ -113,19 +113,19 @@ Example (assuming the default variables have been utilized for building the imag .. code-block:: console - cd validation/docker/mariadb - ./deploy.sh MARIADB_ROOT_PASSWORD=root_password MARIADB_AKRAINO_PASSWORD=akraino_password + cd validation/docker/mysql + ./deploy.sh MYSQL_ROOT_PASSWORD=root_password MYSQL_AKRAINO_PASSWORD=akraino_password -Also, in order to re-deploy the database (it is assumed that the corresponding mariadb container has been stopped and deleted) while the persistent storage already exists (currently, the directory /var/lib/mariadb of the host is used), a different approach should be used after the image build process. +Also, in order to re-deploy the database (it is assumed that the corresponding mysql container has been stopped and deleted) while the persistent storage already exists (currently, the 'akraino-validation-mysql' docker volume is used), a different approach should be used after the image building process. To this end, another script has been developed, namely deploy_with_existing_storage.sh which easily deploys the container. This script accepts the following items as input parameters: -CONTAINER_NAME, the name of the container, default value is akraino-validation-mariadb -REGISTRY, the registry of the mariadb image, default value is akraino -NAME, the name of the mariadb image, default value is validation -TAG_PRE, the first part of the image version, default value is mariadb +CONTAINER_NAME, the name of the container, default value is akraino-validation-mysql +REGISTRY, the registry of the mysql image, default value is akraino +NAME, the name of the mysql image, default value is validation +TAG_PRE, the first part of the image version, default value is mysql TAG_VER, the last part of the image version, default value is latest -MARIADB_HOST_PORT, the port on which mariadb is exposed on host, default value is 3307 +MYSQL_HOST_PORT, the port on which mysql is exposed on host, default value is 3307 In order to deploy the container, this script can be executed with the appropriate parameters. @@ -133,7 +133,7 @@ Example (assuming the default variables have been utilized for building the imag .. code-block:: console - cd validation/docker/mariadb + cd validation/docker/mysql ./deploy_with_existing_persistent_storage.sh More info can be found at the UI README file. @@ -161,10 +161,10 @@ Using the container In order for the container to be easily created, the deploy.sh script has been developed. This script accepts the following as input parameters: 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 -MARIADB_AKRAINO_PASSWORD, the mariadb akraino user password, this variable is required -REGISTRY, the registry of the mariadb image, default value is akraino -NAME, the name of the mariadb image, default value is validation +DB_IP_PORT, the IP and port of the mysql instance, this variable is required +MYSQL_AKRAINO_PASSWORD, the mysql akraino user password, this variable is required +REGISTRY, the registry of the mysql image, default value is akraino +NAME, the name of the mysql 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/' @@ -180,7 +180,7 @@ UI_AKRAINO_PASSWORD, the desired Blueprint Validation UI password for the akrain Note that, for a functional UI, the following prerequisites are needed: -- The mariadb container in up and running state +- The 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. @@ -193,7 +193,7 @@ Example (assuming the default variables have been utilized for building the imag .. code-block:: console cd validation/docker/ui - ./deploy.sh DB_IP_PORT=172.17.0.3:3306 MARIADB_AKRAINO_PASSWORD=akraino_password ENCRYPTION_KEY=AGADdG4D04BKm2IxIWEr8o== UI_ADMIN_PASSWORD=admin UI_AKRAINO_PASSWORD=akraino + ./deploy.sh DB_IP_PORT=172.17.0.3:3306 MYSQL_AKRAINO_PASSWORD=akraino_password ENCRYPTION_KEY=AGADdG4D04BKm2IxIWEr8o== UI_ADMIN_PASSWORD=admin UI_AKRAINO_PASSWORD=akraino The kube-conformance container ============================== diff --git a/docker/mariadb/Dockerfile b/docker/mysql/Dockerfile similarity index 98% rename from docker/mariadb/Dockerfile rename to docker/mysql/Dockerfile index 52a0f52..ce1645c 100644 --- a/docker/mariadb/Dockerfile +++ b/docker/mysql/Dockerfile @@ -18,7 +18,7 @@ FROM alpine:latest RUN apk --no-cache add --update git RUN git clone https://gerrit.akraino.org/r/validation /opt/akraino/validation -FROM mariadb:10.4.6 +FROM mysql:5.6 COPY --from=0 /opt/akraino/validation/ui/db-scripts/EcompSdkDDLMySql_2_4_Common.sql /docker-entrypoint-initdb.d COPY --from=0 /opt/akraino/validation/ui/db-scripts/EcompSdkDDLMySql_2_4_OS.sql /docker-entrypoint-initdb.d COPY --from=0 /opt/akraino/validation/ui/db-scripts/EcompSdkDMLMySql_2_4_Common.sql /docker-entrypoint-initdb.d diff --git a/docker/mariadb/Makefile b/docker/mysql/Makefile similarity index 100% rename from docker/mariadb/Makefile rename to docker/mysql/Makefile diff --git a/docker/mariadb/deploy.sh b/docker/mysql/deploy.sh similarity index 57% rename from docker/mariadb/deploy.sh rename to docker/mysql/deploy.sh index f727ed5..4184912 100755 --- a/docker/mariadb/deploy.sh +++ b/docker/mysql/deploy.sh @@ -18,18 +18,18 @@ set -ex -DOCKER_VOLUME_NAME="akraino-validation-mariadb" +DOCKER_VOLUME_NAME="akraino-validation-mysql" # Container name -CONTAINER_NAME="akraino-validation-mariadb" +CONTAINER_NAME="akraino-validation-mysql" # Container input variables -MARIADB_ROOT_PASSWORD="" -MARIADB_AKRAINO_PASSWORD="" +MYSQL_ROOT_PASSWORD="" +MYSQL_AKRAINO_PASSWORD="" # Image data REGISTRY=akraino NAME=validation -TAG_PRE=mariadb +TAG_PRE=mysql TAG_VER=latest -MARIADB_HOST_PORT=3307 +MYSQL_HOST_PORT=3307 for ARGUMENT in "$@" do @@ -40,27 +40,27 @@ do NAME) NAME=${VALUE} ;; TAG_VER) TAG_VER=${VALUE} ;; TAG_PRE) TAG_PRE=${VALUE} ;; - MARIADB_ROOT_PASSWORD) MARIADB_ROOT_PASSWORD=${VALUE} ;; - MARIADB_AKRAINO_PASSWORD) MARIADB_AKRAINO_PASSWORD=${VALUE} ;; + MYSQL_ROOT_PASSWORD) MYSQL_ROOT_PASSWORD=${VALUE} ;; + MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;; CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;; - MARIADB_HOST_PORT) MARIADB_HOST_PORT=${VALUE} ;; + MYSQL_HOST_PORT) MYSQL_HOST_PORT=${VALUE} ;; *) esac done -if [ -z "$MARIADB_ROOT_PASSWORD" ] +if [ -z "$MYSQL_ROOT_PASSWORD" ] then - echo "ERROR: You must specify the mariadb database root password" + echo "ERROR: You must specify the mysql database root password" exit 1 fi -if [ -z "$MARIADB_AKRAINO_PASSWORD" ] +if [ -z "$MYSQL_AKRAINO_PASSWORD" ] then - echo "ERROR: You must specify the mariadb database akraino user password" + echo "ERROR: You must specify the mysql database akraino user password" exit 1 fi IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" -chmod 0444 "/$(pwd)/mariadb.conf" -docker run --detach --name $CONTAINER_NAME --publish $MARIADB_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mariadb.conf:/etc/mysql/conf.d/my.cnf" -e MYSQL_ROOT_PASSWORD="$MARIADB_ROOT_PASSWORD" -e MYSQL_DATABASE="akraino" -e MYSQL_USER="akraino" -e MYSQL_PASSWORD="$MARIADB_AKRAINO_PASSWORD" $IMAGE +chmod 0444 "/$(pwd)/mysql.conf" +docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" -e MYSQL_ROOT_PASSWORD="$MYSQL_ROOT_PASSWORD" -e MYSQL_DATABASE="akraino" -e MYSQL_USER="akraino" -e MYSQL_PASSWORD="$MYSQL_AKRAINO_PASSWORD" $IMAGE sleep 10 diff --git a/docker/mariadb/deploy_with_existing_persistent_storage.sh b/docker/mysql/deploy_with_existing_persistent_storage.sh similarity index 77% rename from docker/mariadb/deploy_with_existing_persistent_storage.sh rename to docker/mysql/deploy_with_existing_persistent_storage.sh index c38ee24..bd449ec 100755 --- a/docker/mariadb/deploy_with_existing_persistent_storage.sh +++ b/docker/mysql/deploy_with_existing_persistent_storage.sh @@ -18,15 +18,15 @@ set -ex -DOCKER_VOLUME_NAME="akraino-validation-mariadb" +DOCKER_VOLUME_NAME="akraino-validation-mysql" # Container name -CONTAINER_NAME="akraino-validation-mariadb" +CONTAINER_NAME="akraino-validation-mysql" # Image data REGISTRY=akraino NAME=validation -TAG_PRE=mariadb +TAG_PRE=mysql TAG_VER=latest -MARIADB_HOST_PORT=3307 +MYSQL_HOST_PORT=3307 for ARGUMENT in "$@" do @@ -38,11 +38,11 @@ do TAG_VER) TAG_VER=${VALUE} ;; TAG_PRE) TAG_PRE=${VALUE} ;; CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;; - MARIADB_HOST_PORT) MARIADB_HOST_PORT=${VALUE} ;; + MYSQL_HOST_PORT) MYSQL_HOST_PORT=${VALUE} ;; *) esac done IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" -docker run --detach --name $CONTAINER_NAME --publish $MARIADB_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mariadb.conf:/etc/mysql/conf.d/my.cnf" $IMAGE +docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" $IMAGE sleep 10 diff --git a/docker/mariadb/mariadb.conf b/docker/mysql/mysql.conf similarity index 100% rename from docker/mariadb/mariadb.conf rename to docker/mysql/mysql.conf diff --git a/docker/ui/deploy.sh b/docker/ui/deploy.sh index 2ff6587..faab064 100755 --- a/docker/ui/deploy.sh +++ b/docker/ui/deploy.sh @@ -24,7 +24,7 @@ NAME=validation TAG_PRE=ui TAG_VER=latest # Container input parameters -MARIADB_AKRAINO_PASSWORD="" +MYSQL_AKRAINO_PASSWORD="" JENKINS_URL="https://jenkins.akraino.org/" JENKINS_USERNAME="demo" JENKINS_USER_PASSWORD="demo" @@ -46,7 +46,7 @@ do NAME) NAME=${VALUE} ;; TAG_PRE) TAG_PRE=${VALUE} ;; TAG_VER) TAG_VER=${VALUE} ;; - MARIADB_AKRAINO_PASSWORD) MARIADB_AKRAINO_PASSWORD=${VALUE} ;; + MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;; JENKINS_URL) JENKINS_URL=${VALUE} ;; JENKINS_USERNAME) JENKINS_USERNAME=${VALUE} ;; JENKINS_USER_PASSWORD) JENKINS_USER_PASSWORD=${VALUE} ;; @@ -69,9 +69,9 @@ if [ -z "$DB_IP_PORT" ] exit 1 fi -if [ -z "$MARIADB_AKRAINO_PASSWORD" ] +if [ -z "$MYSQL_AKRAINO_PASSWORD" ] then - echo "ERROR: You must specify the mariadb akraino user password" + echo "ERROR: You must specify the mysql akraino user password" exit 1 fi @@ -94,5 +94,5 @@ if [ -z "$UI_AKRAINO_PASSWORD" ] fi IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" -docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MARIADB_AKRAINO_PASSWORD="$MARIADB_AKRAINO_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e UI_AKRAINO_PASSWORD="$UI_AKRAINO_PASSWORD" $IMAGE +docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_AKRAINO_PASSWORD="$MYSQL_AKRAINO_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e UI_AKRAINO_PASSWORD="$UI_AKRAINO_PASSWORD" $IMAGE sleep 10 diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index 403c958..1c801c7 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -207,3 +207,12 @@ All notable changes to this project will be documented in this file. ### Changed ### Removed + +## [0.4.1-SNAPSHOT] - 27 September 2019 +### Added +- Contact us and support URLs have been set to null + +### Changed +- MariaDB has been substituted with MySQL + +### Removed diff --git a/ui/README.rst b/ui/README.rst index 26d5f68..822808f 100644 --- a/ui/README.rst +++ b/ui/README.rst @@ -25,10 +25,10 @@ In specific, the purpose of the UI is twofold: 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 instance and the Nexus server where the results are stored. + Moreover, the UI must be connected with 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 instance and the Nexus server where the results are stored. +2) Partial control of producing results. In this mode, the UI must be connected with 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 both modes, user authentication, authorization and accounting (AAA) will be supported in order to control access to resources, enforce policies on these resources and audit their usage. @@ -38,19 +38,19 @@ Prerequisites: In order for the blueprint validation UI to be functional, the following items are taken for granted: -- An appropriate mariadb instance is up and running (look at the Database subsection). +- An appropriate 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 (look at the Database subsection). It is the lab owner's responsibility to update them using the UI. +- 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 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 (look at the Database subsection). It is the lab owner's responsibility to update them using the UI. +- The available timeslots for blueprint validation execution of every lab are stored in the 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 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. +- The data of available blueprints (i.e. blueprint name) is stored in 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 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. +- The data of an available blueprint instance for validation (i.e. version and layer) is stored in 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. - A Jenkins instance exists capable of executing blueprint validation tests on the specified lab and storing the results to Nexus server (look at the Jenkins configuration subsection). @@ -161,73 +161,73 @@ Install mySQL client: - Database -A mariadb 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. +A 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. The pom.xml file supports the creation of an appropriate docker image for development purposes. The initialization scripts reside under the db-scripts directory. -Also, a script has been developed, namely validation/docker/mariadb/deploy.sh which easily deploys the container. This script accepts the following items as input parameters: +Also, a script has been developed, namely validation/docker/mysql/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-mariadb -MARIADB_ROOT_PASSWORD, the desired mariadb root user password, this variable is required -MARIADB_AKRAINO_PASSWORD, the desired mariadb akraino user password, this variable is required -REGISTRY, registry of the mariadb image, default value is akraino -NAME, name of the mariadb image, default value is validation -TAG_PRE, first part of the image version, default value is mariadb +CONTAINER_NAME, name of the container, default value is akraino-validation-mysql +MYSQL_ROOT_PASSWORD, the desired mysql root user password, this variable is required +MYSQL_AKRAINO_PASSWORD, the desired mysql akraino user password, this variable is required +REGISTRY, registry of the mysql image, default value is akraino +NAME, name of the mysql image, default value is validation +TAG_PRE, first part of the image version, default value is mysql TAG_VER, last part of the image version, default value is latest -MARIADB_HOST_PORT, port on which mariadb is exposed on host, default value is 3307 +MYSQL_HOST_PORT, port on which mysql is exposed on host, default value is 3307 Currently, two users are supported by the UI, namely admin (full privileges) and akraino (limited privileges). Their passwords are changed and stored at UI deployment (refer to UI deployment section). In order to build and deploy the image using only the required parameters, the below instructions should be followed: -The mariadb root password, mariadb 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: +The mysql root password, 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: .. code-block:: console cd validation/ui - mvn docker:build -Ddocker.filter=akraino/validation:dev-mariadb-latest - cd ../docker/mariadb - ./deploy.sh TAG_PRE=dev-mariadb MARIADB_ROOT_PASSWORD= MARIADB_AKRAINO_PASSWORD= - mysql -p -uakraino -h < ../../ui/db-scripts/examples/initialize_db_example.sql + mvn docker:build -Ddocker.filter=akraino/validation:dev-mysql-latest + cd ../docker/mysql + ./deploy.sh TAG_PRE=dev-mysql MYSQL_ROOT_PASSWORD= MYSQL_AKRAINO_PASSWORD= + mysql -p -uakraino -h < ../../ui/db-scripts/examples/initialize_db_example.sql -In order to retrieve the IP of the mariadb container, the following command should be executed: +In order to retrieve the IP of the mysql container, the following command should be executed: .. code-block:: console - docker inspect + docker inspect -Furthermore, the TAG_PRE variable should be defined because the default value is 'mariadb' (note that the 'dev-mariadb' is used for development purposes - look at pom.xml file). +Furthermore, the TAG_PRE variable should be defined because the default value is 'mysql' (note that the 'dev-mysql' is used for development purposes - look at pom.xml file). -If the database must be re-deployed (it is assumed that the corresponding mariadb container has been stopped and deleted) while the persistent storage already exists (currently, the 'akraino-validation-mariadb' docker volume is used), a different approach should be used after the image building process. +If the database must be re-deployed (it is assumed that the corresponding mysql container has been stopped and deleted) while the persistent storage already exists (currently, the 'akraino-validation-mysql' 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/mariadb/deploy_with_existing_storage.sh which easily deploys the container. This script accepts the following as input parameters: +To this end, another script has been developed, namely validation/docker/mysql/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-mariadb -REGISTRY, the registry of the mariadb image, default value is akraino -NAME, the name of the mariadb image, default value is validation -TAG_PRE, the first part of the image version, default value is mariadb +CONTAINER_NAME, the name of the container, default value is akraino-validation-mysql +REGISTRY, the registry of the mysql image, default value is akraino +NAME, the name of the mysql image, default value is validation +TAG_PRE, the first part of the image version, default value is mysql TAG_VER, the last part of the image version, default value is latest -MARIADB_HOST_PORT, the port on which mariadb is exposed on host, default value is 3307 +MYSQL_HOST_PORT, the port on which 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 root user password should be configured using the appropriate variable and the following commands should be executed: +The mysql root user password should be configured using the appropriate variable and the following commands should be executed: .. code-block:: console - cd validation/docker/mariadb - ./deploy_with_existing_persistent_storage.sh TAG_PRE=dev-mariadb + cd validation/docker/mysql + ./deploy_with_existing_persistent_storage.sh TAG_PRE=dev-mysql -Finally, if the database must be re-deployed (it is assumed that the corresponding mariadb 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). +Finally, if the database must be re-deployed (it is assumed that the corresponding 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). To this end, after the image build process, the following commands should be executed: .. code-block:: console - docker volume rm akraino-validation-mariadb - cd validation/docker/mariadb - ./deploy.sh TAG_PRE=dev-mariadb MARIADB_ROOT_PASSWORD= MARIADB_AKRAINO_PASSWORD= - mysql -p -uakraino -h < ../../ui/db-scripts/examples/initialize_db_example.sql + docker volume rm akraino-validation-mysql + cd validation/docker/mysql + ./deploy.sh TAG_PRE=dev-mysql MYSQL_ROOT_PASSWORD= MYSQL_AKRAINO_PASSWORD= + mysql -p -uakraino -h < ../../ui/db-scripts/examples/initialize_db_example.sql In the context of the UI application, the following tables exist in the database: @@ -246,7 +246,7 @@ An example of data initialization is stored in the following file: db-scripts/examples/initialize_db_example.sql -That is the reason why the command 'mysql -p -uakraino -h < ../../ui/db-scripts/examples/initialize_db_example.sql' has been used previously. +That is the reason why the command 'mysql -p -uakraino -h < ../../ui/db-scripts/examples/initialize_db_example.sql' has been used previously. Some of this data is illustrated below: @@ -295,7 +295,7 @@ Then, the following command should be executed: .. code-block:: console - mysql -p -uakraino -h < ./dbscript.sql + mysql -p -uakraino -h < ./dbscript.sql For example, if a user wants to define a new timeslot with the following data: @@ -315,7 +315,7 @@ Then, the following command should be executed: .. code-block:: console - mysql -p -uakraino -h < ./dbscript.sql + mysql -p -uakraino -h < ./dbscript.sql Furthermore, if a user wants to define a new blueprint, namely "newBlueprint", and an instance of this blueprint with version "master" and layer "k8s" and assign a timeslot to it, the following file should be created: @@ -333,7 +333,7 @@ Then, the following command should be executed: .. code-block:: console - mysql -p -uakraino -h < ./dbscript.sql + mysql -p -uakraino -h < ./dbscript.sql The UI will automatically retrieve this new data and display it to the user. @@ -393,11 +393,11 @@ In order to build the image, the following commands should be executed: Also, a script has been developed, namely validation/docker/ui/deploy.sh which easily deploys the container. This script accepts the following as input parameters: -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 -MARIADB_AKRAINO_PASSWORD, the mariadb akraino user password, this variable is required -REGISTRY, the registry of the mariadb image, default value is akraino -NAME, the name of the mariadb image, default value is validation +CONTAINER_NAME, the name of the container, default value is akraino-validation-ui +DB_IP_PORT, the IP and port of the mysql instance, this variable is required +MYSQL_AKRAINO_PASSWORD, the mysql akraino user password, this variable is required +REGISTRY, the registry of the ui image, default value is akraino +NAME, the name of the 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/' @@ -413,7 +413,7 @@ UI_AKRAINO_PASSWORD, the desired Blueprint Validation UI password for the akrain So, for a functional UI, the following prerequisites are needed: -- The mariadb container in up and running state +- The 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. @@ -421,7 +421,7 @@ Then, the following commands can be executed in order to deploy the UI container .. code-block:: console cd ../docker/ui - ./deploy.sh TAG_PRE=dev-ui DB_IP_PORT= MARIADB_AKRAINO_PASSWORD= ENCRYPTION_KEY= UI_ADMIN_PASSWORD= UI_AKRAINO_PASSWORD= + ./deploy.sh TAG_PRE=dev-ui DB_IP_PORT= MYSQL_AKRAINO_PASSWORD= ENCRYPTION_KEY= UI_ADMIN_PASSWORD= UI_AKRAINO_PASSWORD= The content of the DB_IP_PORT can be for example '172.17.0.3:3306'. Also, the value of the encryption key can be for example 'AGADdG4D04BKm2IxIWEr8o=='. diff --git a/ui/db-scripts/akraino_blueprint_validation_db.sql b/ui/db-scripts/akraino_blueprint_validation_db.sql index 31f9ad5..fbc7b21 100644 --- a/ui/db-scripts/akraino_blueprint_validation_db.sql +++ b/ui/db-scripts/akraino_blueprint_validation_db.sql @@ -31,8 +31,8 @@ DROP TABLE IF EXISTS lab; create table lab ( id bigint not NULL AUTO_INCREMENT, - lab text not NULL unique, - silo text not NULL unique, + lab varchar(255) not NULL unique, + silo varchar(255) not NULL unique, CONSTRAINT id_pk PRIMARY KEY (id) ); @@ -50,14 +50,14 @@ create table timeslot ( CREATE TABLE blueprint ( id bigint not NULL AUTO_INCREMENT, - blueprint_name varchar(20) not NULL unique, + blueprint_name varchar(255) not NULL unique, CONSTRAINT id_pk PRIMARY KEY (id) ); CREATE TABLE blueprint_layer ( id bigint not NULL AUTO_INCREMENT, - layer text not NULL unique, + layer varchar(255) not NULL unique, CONSTRAINT id_pk PRIMARY KEY (id) ); @@ -65,7 +65,7 @@ CREATE TABLE blueprint_instance ( id bigint not NULL AUTO_INCREMENT, blueprint_id bigint not NULL, - version text not NULL, + version varchar(255) not NULL, CONSTRAINT id_pk PRIMARY KEY (id), CONSTRAINT blueprint_id_fk FOREIGN KEY (blueprint_id) REFERENCES blueprint (id) MATCH SIMPLE @@ -116,7 +116,7 @@ CREATE TABLE validation_test_result blueprint_instance_id bigint not NULL, all_layers boolean, lab_id bigint not NULL, - timestamp text, + timestamp varchar(255), optional boolean, result boolean, submission_id bigint, @@ -137,7 +137,7 @@ CREATE TABLE validation_test_result CREATE TABLE w_robot_test_result ( id bigint not NULL AUTO_INCREMENT, - layer text not NULL, + layer varchar(255) not NULL, validation_test_result_id bigint not NULL, robot_test_results LONGTEXT, CONSTRAINT id_pk PRIMARY KEY (id), diff --git a/ui/pom.xml b/ui/pom.xml index 285884e..3e39f70 100644 --- a/ui/pom.xml +++ b/ui/pom.xml @@ -14,7 +14,7 @@ org.akraino.validation ui - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT Bluval UI Maven Webapp war @@ -52,6 +52,7 @@ http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin apache-tomcat-8.0.37 3.0.0 + 8.0.17 @@ -168,9 +169,9 @@ - akraino/validation:dev-mariadb-latest + akraino/validation:dev-mysql-latest - mariadb:10.4.6 + mysql:5.6 project @@ -373,6 +374,11 @@ commons-httpclient ${commons-httpclient.version} + + mysql + mysql-connector-java + ${mysql-connector.version} + diff --git a/ui/src/main/java/org/akraino/validation/ui/conf/ExternalAppConfig.java b/ui/src/main/java/org/akraino/validation/ui/conf/ExternalAppConfig.java index 3317260..85265c0 100644 --- a/ui/src/main/java/org/akraino/validation/ui/conf/ExternalAppConfig.java +++ b/ui/src/main/java/org/akraino/validation/ui/conf/ExternalAppConfig.java @@ -113,10 +113,10 @@ public class ExternalAppConfig extends AppConfig implements Configurable { ComboPooledDataSource dataSource = new ComboPooledDataSource(); try { dataSource.setDriverClass(SystemProperties.getProperty(SystemProperties.DB_DRIVER)); - dataSource.setJdbcUrl("jdbc:mariadb://" + System.getenv("DB_IP_PORT") + "/" + dataSource.setJdbcUrl("jdbc:mysql://" + System.getenv("DB_IP_PORT") + "/" + PortalApiProperties.getProperty("akraino_database_name")); dataSource.setUser(SystemProperties.getProperty(SystemProperties.DB_USERNAME)); - String password = System.getenv("MARIADB_AKRAINO_PASSWORD"); + String password = System.getenv("MYSQL_AKRAINO_PASSWORD"); if (SystemProperties.containsProperty(SystemProperties.DB_ENCRYPT_FLAG)) { String encryptFlag = SystemProperties.getProperty(SystemProperties.DB_ENCRYPT_FLAG); if (encryptFlag != null && encryptFlag.equalsIgnoreCase("true")) { diff --git a/ui/src/main/resources/portal.properties b/ui/src/main/resources/portal.properties index ae39f8f..8269919 100644 --- a/ui/src/main/resources/portal.properties +++ b/ui/src/main/resources/portal.properties @@ -56,7 +56,7 @@ use_rest_for_functional_menu=true portal.api.impl.class = org.onap.portalapp.service.OnBoardingApiServiceImpl # URL of the Portal where this app is onboarded -ecomp_redirect_url = https://portal.onap.org/ecompportal/process_csp +ecomp_redirect_url = # URL of the ECOMP Portal REST API ecomp_rest_url = http://portal.onap.org:50580/ecompportal/auxapi diff --git a/ui/src/main/webapp/WEB-INF/conf/system.properties b/ui/src/main/webapp/WEB-INF/conf/system.properties index fa26104..0a4930f 100644 --- a/ui/src/main/webapp/WEB-INF/conf/system.properties +++ b/ui/src/main/webapp/WEB-INF/conf/system.properties @@ -38,7 +38,7 @@ decryption_key = AGLDdG4D04BKm2IxIWEr8o== ########################################################################## #Mysql -db.driver = org.mariadb.jdbc.Driver +db.driver = com.mysql.jdbc.Driver db.userName = akraino db.encrypt_flag = false db.hib.dialect = org.hibernate.dialect.MySQLDialect @@ -66,7 +66,7 @@ log_cron = 0 0/1 * * * ?; #sessiontimeout_feed_cron = 0 * * * * ? * # Link shown in Help menu -contact_us_link = https://wiki.onap.org/display/DW/Portal +contact_us_link = # An Unique 128-bit value defined to identify a specific version # of an application deployed on a specific virtual machine.