Commit 9b7ed9ee authored by Shayan Hajipour's avatar Shayan Hajipour
Browse files

feat: QoSProfile database moved to logical database in CRDB and context...

feat: QoSProfile database moved to logical database in CRDB and context interaction removed from QoSProfile component:
- tests updated
- qos_profile constraint aded to ConstraintKindEnum and Constraint parser of context database
- GenericDatabase class used to create qos_profile database
- qos_profile component activation by default added to my_deploy.sh
parent 49070d98
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
.my_venv/
# requirements.txt  # removed to enable tracking versions of packages over time

# PyInstaller
+3 −0
Original line number Diff line number Diff line
@@ -171,6 +171,9 @@ function crdb_drop_database_single() {
    kubectl exec -i --namespace ${CRDB_NAMESPACE} cockroachdb-0 -- \
        ./cockroach sql --certs-dir=/cockroach/cockroach-certs --url=${CRDB_CLIENT_URL} \
        --execute "DROP DATABASE IF EXISTS ${CRDB_DATABASE};"
    kubectl exec -i --namespace ${CRDB_NAMESPACE} cockroachdb-0 -- \
        ./cockroach sql --certs-dir=/cockroach/cockroach-certs --url=${CRDB_CLIENT_URL} \
        --execute "DROP DATABASE IF EXISTS ${CRDB_DATABASE_QOSPROFILE};"
    echo
}

+1 −2
Original line number Diff line number Diff line
@@ -202,11 +202,10 @@ kubectl create secret generic kfk-kpi-data --namespace ${TFS_K8S_NAMESPACE} --ty
printf "\n"

echo "Create secret with CockroachDB data for QoSProfile"
CRDB_DATABASE_QoSProfile="tfs_qos_profile"  # TODO: change by specific configurable environment variable
kubectl create secret generic crdb-qos-profile-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \
    --from-literal=CRDB_NAMESPACE=${CRDB_NAMESPACE} \
    --from-literal=CRDB_SQL_PORT=${CRDB_SQL_PORT} \
    --from-literal=CRDB_DATABASE=${CRDB_DATABASE_QoSProfile} \
    --from-literal=CRDB_DATABASE=${CRDB_DATABASE_QOSPROFILE} \
    --from-literal=CRDB_USERNAME=${CRDB_USERNAME} \
    --from-literal=CRDB_PASSWORD=${CRDB_PASSWORD} \
    --from-literal=CRDB_SSLMODE=require
+4 −2
Original line number Diff line number Diff line
@@ -20,8 +20,7 @@
export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"

# Set the list of components, separated by spaces, you want to build images for, and deploy.
# export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator qos_profile"
export TFS_COMPONENTS="context device pathcomp service nbi qos_profile"
export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator qos_profile"

# Uncomment to activate Monitoring (old)
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
@@ -117,6 +116,9 @@ export CRDB_PASSWORD="tfs123"
# Set the database name to be used by Context.
export CRDB_DATABASE="tfs"

# Set the database to be used by the QoSProfile component
export CRDB_DATABASE_QOSPROFILE="tfs_qos_profile"

# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
# See ./deploy/all.sh or ./deploy/crdb.sh for additional details
export CRDB_DEPLOY_MODE="single"
+7 −12
Original line number Diff line number Diff line
@@ -17,24 +17,19 @@ package qos_profile;

import "context.proto";


message QoSProfileId {
  context.Uuid qos_profile_id = 1;
}

message QoSProfileValueUnitPair {
  int32 value = 1;
  string unit = 2;
}

message QoDConstraintsRequest {
  QoSProfileId qos_profile_id = 1;
  context.QoSProfileId qos_profile_id = 1;
  double start_timestamp = 2;
  float duration = 3;
}

message QoSProfile {
  QoSProfileId qos_profile_id = 1;
  context.QoSProfileId qos_profile_id = 1;
  string name = 2;
  string description = 3;
  string status = 4;
@@ -56,8 +51,8 @@ message QoSProfile {
service QoSProfileService {
  rpc CreateQoSProfile                (QoSProfile           ) returns (       QoSProfile                 ) {}
  rpc UpdateQoSProfile                (QoSProfile           ) returns (       QoSProfile                 ) {}
  rpc DeleteQoSProfile                (QoSProfileId         ) returns (context.Empty              ) {}
  rpc GetQoSProfile                   (QoSProfileId         ) returns (QoSProfile         ) {}
  rpc DeleteQoSProfile                (context.QoSProfileId ) returns (       context.Empty              ) {}
  rpc GetQoSProfile                   (context.QoSProfileId ) returns (       QoSProfile                 ) {}
  rpc GetQoSProfiles                  (context.Empty        ) returns (stream QoSProfile          ) {}
  rpc GetConstraintListFromQoSProfile (QoDConstraintsRequest) returns (stream context.Constraint  ) {}
}
Loading