Commit 4fb2b29c authored by José Juan Pedreño Manresa's avatar José Juan Pedreño Manresa
Browse files

Merge branch 'develop' into feat/compute-component

parents b156435b e8b83d84
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -15,22 +15,23 @@


########################################################################################################################
# Define your deployment settings here
# Read deployment settings
########################################################################################################################

# If not already set, set the URL of your local Docker registry where the images will be uploaded to. Leave it blank if
# you do not want to use any Docker registry.
# If not already set, set the URL of your local Docker registry where the images will be uploaded to.
# Leave it blank if you do not want to use any Docker registry.
export TFS_REGISTRY_IMAGE=${TFS_REGISTRY_IMAGE:-""}
#export TFS_REGISTRY_IMAGE="http://my-container-registry.local/"

# If not already set, set the list of components you want to build images for, and deploy.
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"}
# By default, only basic components are deployed
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"}

# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}

# If not already set, set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"}
export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"}

# If not already set, set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""}
@@ -115,10 +116,11 @@ for COMPONENT in $TFS_COMPONENTS; do
    fi

    echo "  Deploying '$COMPONENT' component to Kubernetes..."
    DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log"
    DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log"
    kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG"
    kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG"
    kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG"
    COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/")
    kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG"
    kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG"

    echo "  Collecting env-vars for '$COMPONENT' component..."

+15 −8
Original line number Diff line number Diff line
@@ -13,6 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# If not already set, set the list of components you want to install dependencies for.
# By default, dependencies for all components are installed.
# Components still not supported by this script:
#   automation & policy : implemented in Java
#   dlt                 : under design
#   pathcomp            : under design
ALL_COMPONENTS="context device service compute monitoring webui interdomain slice"
ALL_COMPONENTS="${ALL_COMPONENTS} dbscanserving opticalattackmitigator opticalcentralizedattackdetector"
ALL_COMPONENTS="${ALL_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector"
TFS_COMPONENTS=${TFS_COMPONENTS:-$ALL_COMPONENTS}

echo "Updating PIP, SetupTools and Wheel..."
pip install --upgrade pip               # ensure next packages get the latest versions
pip install --upgrade setuptools wheel  # bring basic tooling for other requirements
@@ -20,18 +31,14 @@ pip install --upgrade pip-tools pylint # bring tooling for package compilation
printf "\n"

echo "Creating integrated requirements file..."
tee requirements.in >/dev/null <<EOF
grpcio-tools==1.43.0
EOF
touch requirements.in
diff requirements.in common_requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in
printf "\n"

# List of all the components, not only deployed ones
# TODO: include here your components
COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving webui"

echo "Collecting requirements from components..."
for COMPONENT in $COMPONENTS
for COMPONENT in $TFS_COMPONENTS
do
    if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi
    diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in
done
printf "\n"
+16 −0
Original line number Diff line number Diff line
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"

# Set the list of components, separated by comas, you want to build images for, and deploy.
# Supported components are:
#   context device automation policy service compute monitoring webui
#   interdomain slice pathcomp dlt
#   dbscanserving opticalattackmitigator opticalcentralizedattackdetector
#   l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector
export TFS_COMPONENTS="context device automation service compute monitoring webui"

# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"

# Set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE="tfs"

# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"

# Set the neew Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ message PolicyRuleState {
// Basic policy rule attributes
message PolicyRuleBasic {
  PolicyRuleId policyRuleId = 1;
  optional PolicyRuleState policyRuleState = 2;
  PolicyRuleState policyRuleState = 2; //policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
  uint32 priority = 3;

  // Event-Condition-Action (ECA) model

proto/uml/pathcomp.png

0 → 100644
+35 KiB
Loading image diff...
Loading