Commit 5da0c05c authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

SIMAP Connector:

- Initial partial code backup
parent 822ff8d4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ include:
#  - local: '/src/e2e_orchestrator/.gitlab-ci.yml'
#  - local: '/src/ztp_server/.gitlab-ci.yml'
#  - local: '/src/osm_client/.gitlab-ci.yml'
#  - local: '/src/simap_connector/.gitlab-ci.yml'
#
#  # This should be last one: end-to-end integration tests
#  - local: '/src/tests/.gitlab-ci.yml'
+89 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: simap-connectorservice
spec:
  selector:
    matchLabels:
      app: simap-connectorservice
  replicas: 1
  template:
    metadata:
      labels:
        app: simap-connectorservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: labs.etsi.org:5050/tfs/controller/simap_connector:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 9090
            - containerPort: 9192
          env:
            - name: LOG_LEVEL
              value: "INFO"
            - name: SIMAP_SERVER_SCHEME
              value: "http"
            - name: SIMAP_SERVER_ADDRESS
              value: "10.254.0.9"
            - name: SIMAP_SERVER_PORT
              value: "80"
            - name: SIMAP_SERVER_USERNAME
              value: "admin"
            - name: SIMAP_SERVER_PASSWORD
              value: "admin"
            - name: SIMAP_DEFAULT_TOPOLOGY
              value: "te"
          startupProbe:
            grpc:
              port: 9090
            failureThreshold: 30
            periodSeconds: 1
          readinessProbe:
            grpc:
              port: 9090
          livenessProbe:
            grpc:
              port: 9090
          resources:
            requests:
              cpu: 250m
              memory: 128Mi
            limits:
              cpu: 1000m
              memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: simap-connectorservice
  labels:
    app: simap-connectorservice
spec:
  type: ClusterIP
  selector:
    app: simap-connectorservice
  ports:
    - name: grpc
      protocol: TCP
      port: 9090
      targetPort: 9090
    - name: metrics
      protocol: TCP
      port: 9192
      targetPort: 9192
+3 −0
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui"
#    export TFS_COMPONENTS="${BEFORE} qkd_app service ${AFTER}"
#fi

# Uncomment to activate SIMAP Connector
export TFS_COMPONENTS="${TFS_COMPONENTS} simap_connector"

# Uncomment to activate Load Generator
#export TFS_COMPONENTS="${TFS_COMPONENTS} load_generator"

+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ class ServiceNameEnum(Enum):
    MONITORING             = 'monitoring'
    DLT                    = 'dlt'
    NBI                    = 'nbi'
    SIMAP_CONNECTOR        = 'simap-connector'
    CYBERSECURITY          = 'cybersecurity'
    INTERDOMAIN            = 'interdomain'
    PATHCOMP               = 'pathcomp'
@@ -90,6 +91,7 @@ DEFAULT_SERVICE_GRPC_PORTS = {
    ServiceNameEnum.POLICY                 .value :  6060,
    ServiceNameEnum.MONITORING             .value :  7070,
    ServiceNameEnum.DLT                    .value :  8080,
    ServiceNameEnum.SIMAP_CONNECTOR        .value :  9090,
    ServiceNameEnum.L3_CAD                 .value : 10001,
    ServiceNameEnum.L3_AM                  .value : 10002,
    ServiceNameEnum.DBSCANSERVING          .value : 10008,
+39 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# build, tag and push the Docker image to the gitlab registry
build simap_connector:
  variables:
    IMAGE_NAME: 'simap_connector' # name of the microservice
    IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
  stage: build
  before_script:
    - docker image prune --force
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - docker buildx build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
    - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
    - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
  after_script:
    - docker image prune --force
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' 
    - changes:
      - src/$IMAGE_NAME/**/*.{py,in,yml}
      - src/$IMAGE_NAME/Dockerfile
      - src/$IMAGE_NAME/tests/*.py
      - src/$IMAGE_NAME/tests/Dockerfile
      - manifests/${IMAGE_NAME}service.yaml
      - .gitlab-ci.yml
Loading