Commit 03705c15 authored by Mohamad Rahhal's avatar Mohamad Rahhal
Browse files

Update file .gitlab-ci.yml

parent fddc8cb8
Loading
Loading
Loading
Loading
+47 −46
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ build ryu-openflow:
    - docker images --filter="dangling=true" --quiet | xargs -r docker rmi
  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/common/**/*.py
      - proto/*.proto
@@ -69,15 +70,15 @@ end2end_test ryu-openflow:
    #- containerlab destroy --all --cleanup || true
    # cleanup mininet
    - docker run --rm "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}" mn -c
  script:
    # Download Docker images to run the test
    - docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}-ryu:${IMAGE_TAG}"
    - docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}"
    - docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}-test:${IMAGE_TAG}"
  #script:
    ## Download Docker images to run the test
    #- docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}-ryu:${IMAGE_TAG}"
    #- docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}"
    #- docker pull "${CI_REGISTRY_IMAGE}/${TEST_NAME}-test:${IMAGE_TAG}"

    # Check MicroK8s is ready
    - microk8s status --wait-ready
    - kubectl get pods --all-namespaces
    #- microk8s status --wait-ready
    #- kubectl get pods --all-namespaces

#    # Deploy ContainerLab Scenario
#    - RUNNER_PATH=`pwd`
@@ -89,37 +90,37 @@ end2end_test ryu-openflow:
#    - containerlab deploy --reconfigure --topo ryu-openflow.clab.yml
#    - cd $RUNNER_PATH

    - docker network rm tfs-test-net || true
    - docker network create -d bridge --subnet=172.254.254.0/24 --gateway=172.254.254.1 tfs-test-ryu
    - docker run -d --name ryu --network tfs-test-ryu --ip 172.254.254.10 "${CI_REGISTRY_IMAGE}/${TEST_NAME}-ryu:${IMAGE_TAG}"
    - docker run -d --name mininet --network tfs-test-ryu "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}"

#    # Wait for initialization of Device NOSes
    - sleep 10
    - docker ps -a
#
     Configure TeraFlowSDN deployment
    # Uncomment if DEBUG log level is needed for the components
    - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml
    - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml
    - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml
    - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml
    - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml
    - yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml
#
    - source src/tests/${TEST_NAME}/deploy_specs.sh
    - export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}"
    - export TFS_SKIP_BUILD="YES"
    - export TFS_IMAGE_TAG="latest"
    - echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}"
#
     Deploy TeraFlowSDN
    - ./deploy/crdb.sh
    - ./deploy/nats.sh
    - ./deploy/kafka.sh
    - ./deploy/qdb.sh
    - ./deploy/tfs.sh
    - ./deploy/show.sh
    #- docker network rm tfs-test-net || true
    #- docker network create -d bridge --subnet=172.254.254.0/24 --gateway=172.254.254.1 tfs-test-ryu
    #- docker run -d --name ryu --network tfs-test-ryu --ip 172.254.254.10 "${CI_REGISTRY_IMAGE}/${TEST_NAME}-ryu:${IMAGE_TAG}"
    #- docker run -d --name mininet --network tfs-test-ryu "${CI_REGISTRY_IMAGE}/${TEST_NAME}-mininet:${IMAGE_TAG}"
#
#   # # Wait for initialization of Device NOSes
    #- sleep 10
    #- docker ps -a
##
    # Configure TeraFlowSDN deployment
    ## Uncomment if DEBUG log level is needed for the components
    #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/contextservice.yaml
    #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/deviceservice.yaml
    #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="frontend").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/pathcompservice.yaml
    #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/serviceservice.yaml
    #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/nbiservice.yaml
    #- yq -i '((select(.kind=="Deployment").spec.template.spec.containers.[] | select(.name=="server").env.[]) | select(.name=="LOG_LEVEL").value) |= "DEBUG"' manifests/monitoringservice.yaml
##
    #- source src/tests/${TEST_NAME}/deploy_specs.sh
    #- export TFS_REGISTRY_IMAGES="${CI_REGISTRY_IMAGE}"
    #- export TFS_SKIP_BUILD="YES"
    #- export TFS_IMAGE_TAG="latest"
    #- echo "TFS_REGISTRY_IMAGES=${CI_REGISTRY_IMAGE}"
#
  #   Deploy TeraFlowSDN
  #  - ./deploy/crdb.sh
  #  - ./deploy/nats.sh
  #  - ./deploy/kafka.sh
  #  - ./deploy/qdb.sh
  #  - ./deploy/tfs.sh
  #  - ./deploy/show.sh
#
#    ## Wait for Context to be subscribed to NATS
#    ## WARNING: this loop is infinite if there is no subscriber (such as monitoring).
@@ -138,14 +139,14 @@ end2end_test ryu-openflow:
#    #      break
#    #    fi
#    #  done
    - kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server
#
    # Run end-to-end test: onboard scenario
    - >
      docker run -t --rm --name ${TEST_NAME} --network=host 
      --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
      --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
      $CI_REGISTRY_IMAGE/${TEST_NAME}:${IMAGE_TAG} /var/teraflow/run-onboarding.sh
    #- kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server

    ## Run end-to-end test: onboard scenario
    #- >
    #  docker run -t --rm --name ${TEST_NAME} --network=host 
    #  --volume "$PWD/tfs_runtime_env_vars.sh:/var/teraflow/tfs_runtime_env_vars.sh"
    #  --volume "$PWD/src/tests/${TEST_NAME}:/opt/results"
    #  $CI_REGISTRY_IMAGE/${TEST_NAME}:${IMAGE_TAG} /var/teraflow/run-onboarding.sh
#
#    # Dump configuration of the switches (OpenFlow rules configured) (before configure IETF service)
#