Loading manifests/pathcompservice.yaml +12 −21 Original line number Diff line number Diff line Loading @@ -51,27 +51,18 @@ spec: - name: backend image: registry.gitlab.com/teraflow-h2020/controller/pathcomp-backend:latest imagePullPolicy: Always # not working; to be investigated #readinessProbe: # exec: # command: # - curl -X POST -0 # - -H 'Expect:' # - -H 'Content-Type:\ application/json' # - -d '{}' # - http://127.0.0.1:8081/pathComp/api/v1/compRoute # initialDelaySeconds: 5 # timeoutSeconds: 5 #livenessProbe: # exec: # command: # - curl -X POST -0 # - -H 'Expect:' # - -H 'Content-Type:\ application/json' # - -d '{}' # - http://127.0.0.1:8081/pathComp/api/v1/compRoute # initialDelaySeconds: 5 # timeoutSeconds: 5 readinessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 5 timeoutSeconds: 5 livenessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 5 timeoutSeconds: 5 resources: requests: cpu: 250m Loading src/pathcomp/.gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line backend/wireshark src/pathcomp/.gitlab-ci.yml +6 −28 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ # limitations under the License. # Build, tag, and push the Docker image to the GitLab Docker registry build pathcomp-backend: build pathcomp: variables: IMAGE_NAME: 'pathcomp' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) Loading @@ -24,8 +24,11 @@ build pathcomp-backend: # This first build tags the builder resulting image to prevent being removed by dangling image removal command - docker build -t "${IMAGE_NAME}-backend:${IMAGE_TAG}-builder" --target builder -f ./src/$IMAGE_NAME/backend/Dockerfile . - docker build -t "${IMAGE_NAME}-backend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/backend/Dockerfile . - docker build -t "${IMAGE_NAME}-frontend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/frontend/Dockerfile . - docker tag "${IMAGE_NAME}-backend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" - docker tag "${IMAGE_NAME}-frontend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: Loading @@ -38,30 +41,6 @@ build pathcomp-backend: - src/$IMAGE_NAME/backend/**/*.{c,h,conf} - src/$IMAGE_NAME/backend/Makefile - src/$IMAGE_NAME/backend/Dockerfile - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Build, tag, and push the Docker image to the GitLab Docker registry build pathcomp-frontend: variables: IMAGE_NAME: 'pathcomp' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build -t "${IMAGE_NAME}-frontend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/frontend/Dockerfile . - docker tag "${IMAGE_NAME}-frontend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" after_script: - 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 - src/$IMAGE_NAME/.gitlab-ci.yml - src/$IMAGE_NAME/frontend/**/*.{py,in,yml} - src/$IMAGE_NAME/frontend/Dockerfile - src/$IMAGE_NAME/frontend/tests/*.py Loading @@ -75,7 +54,7 @@ unit test pathcomp-backend: IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build pathcomp-backend - build pathcomp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi Loading Loading @@ -120,8 +99,7 @@ unit test pathcomp-frontend: IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build pathcomp-frontend - build pathcomp-backend - build pathcomp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create --driver=bridge --subnet=172.28.0.0/24 --gateway=172.28.0.254 teraflowbridge; fi Loading src/pathcomp/backend/Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -71,4 +71,4 @@ COPY --from=builder /var/teraflow/config/pathcomp.conf ./config COPY --from=builder /var/teraflow/tests/. ./tests # release entrypoint: ENTRYPOINT [ "./pathComp", "config/pathcomp.conf", "pathcomp.log" ] ENTRYPOINT [ "./pathComp", "config/pathcomp.conf", "screen_only" ] src/pathcomp/backend/Dockerfile-gdb +1 −1 Original line number Diff line number Diff line Loading @@ -34,4 +34,4 @@ RUN make EXPOSE 8081 ENTRYPOINT [ "gdb", "--args", "./pathComp", "config/pathcomp.conf", "pathcomp.log" ] ENTRYPOINT [ "gdb", "--args", "./pathComp", "config/pathcomp.conf", "screen_only" ] Loading
manifests/pathcompservice.yaml +12 −21 Original line number Diff line number Diff line Loading @@ -51,27 +51,18 @@ spec: - name: backend image: registry.gitlab.com/teraflow-h2020/controller/pathcomp-backend:latest imagePullPolicy: Always # not working; to be investigated #readinessProbe: # exec: # command: # - curl -X POST -0 # - -H 'Expect:' # - -H 'Content-Type:\ application/json' # - -d '{}' # - http://127.0.0.1:8081/pathComp/api/v1/compRoute # initialDelaySeconds: 5 # timeoutSeconds: 5 #livenessProbe: # exec: # command: # - curl -X POST -0 # - -H 'Expect:' # - -H 'Content-Type:\ application/json' # - -d '{}' # - http://127.0.0.1:8081/pathComp/api/v1/compRoute # initialDelaySeconds: 5 # timeoutSeconds: 5 readinessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 5 timeoutSeconds: 5 livenessProbe: httpGet: path: /health port: 8081 initialDelaySeconds: 5 timeoutSeconds: 5 resources: requests: cpu: 250m Loading
src/pathcomp/.gitignore 0 → 100644 +1 −0 Original line number Diff line number Diff line backend/wireshark
src/pathcomp/.gitlab-ci.yml +6 −28 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ # limitations under the License. # Build, tag, and push the Docker image to the GitLab Docker registry build pathcomp-backend: build pathcomp: variables: IMAGE_NAME: 'pathcomp' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) Loading @@ -24,8 +24,11 @@ build pathcomp-backend: # This first build tags the builder resulting image to prevent being removed by dangling image removal command - docker build -t "${IMAGE_NAME}-backend:${IMAGE_TAG}-builder" --target builder -f ./src/$IMAGE_NAME/backend/Dockerfile . - docker build -t "${IMAGE_NAME}-backend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/backend/Dockerfile . - docker build -t "${IMAGE_NAME}-frontend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/frontend/Dockerfile . - docker tag "${IMAGE_NAME}-backend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" - docker tag "${IMAGE_NAME}-frontend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: Loading @@ -38,30 +41,6 @@ build pathcomp-backend: - src/$IMAGE_NAME/backend/**/*.{c,h,conf} - src/$IMAGE_NAME/backend/Makefile - src/$IMAGE_NAME/backend/Dockerfile - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Build, tag, and push the Docker image to the GitLab Docker registry build pathcomp-frontend: variables: IMAGE_NAME: 'pathcomp' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build -t "${IMAGE_NAME}-frontend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/frontend/Dockerfile . - docker tag "${IMAGE_NAME}-frontend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" after_script: - 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 - src/$IMAGE_NAME/.gitlab-ci.yml - src/$IMAGE_NAME/frontend/**/*.{py,in,yml} - src/$IMAGE_NAME/frontend/Dockerfile - src/$IMAGE_NAME/frontend/tests/*.py Loading @@ -75,7 +54,7 @@ unit test pathcomp-backend: IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build pathcomp-backend - build pathcomp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi Loading Loading @@ -120,8 +99,7 @@ unit test pathcomp-frontend: IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build pathcomp-frontend - build pathcomp-backend - build pathcomp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create --driver=bridge --subnet=172.28.0.0/24 --gateway=172.28.0.254 teraflowbridge; fi Loading
src/pathcomp/backend/Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -71,4 +71,4 @@ COPY --from=builder /var/teraflow/config/pathcomp.conf ./config COPY --from=builder /var/teraflow/tests/. ./tests # release entrypoint: ENTRYPOINT [ "./pathComp", "config/pathcomp.conf", "pathcomp.log" ] ENTRYPOINT [ "./pathComp", "config/pathcomp.conf", "screen_only" ]
src/pathcomp/backend/Dockerfile-gdb +1 −1 Original line number Diff line number Diff line Loading @@ -34,4 +34,4 @@ RUN make EXPOSE 8081 ENTRYPOINT [ "gdb", "--args", "./pathComp", "config/pathcomp.conf", "pathcomp.log" ] ENTRYPOINT [ "gdb", "--args", "./pathComp", "config/pathcomp.conf", "screen_only" ]