diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1c7460c77d3b70c04517ebcfca24062af1f2ad0..cba0163637669ec773289464da86c03cc450c355 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,9 @@ -include: - - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml' +workflow: + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"' + when: never + - when: always stages: - build @@ -22,6 +26,20 @@ default: variables: DOCKER_TLS_CERTDIR: "/certs" +.kaniko-push: + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"${CR_HOST}\":{\"auth\":\"$(printf "%s:%s" "${CR_USER}" "${CR_PW}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') + - "[ ! $CI_COMMIT_TAG ] && KANIKO_D=\"$KANIKO_D -d $CR_HOST/$CR_ORG/$IMAGE_NAME:${DOCKER_TAG_NAME}latest\"" + - "[ ! $CI_COMMIT_TAG ] && KANIKO_D=\"$KANIKO_D -d $CR_HOST/$CR_ORG/$IMAGE_NAME:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA\"" + - "[ $CI_COMMIT_TAG ] && KANIKO_D=\"$KANIKO_D -d $CR_HOST/$CR_ORG/$IMAGE_NAME:$CI_COMMIT_TAG\"" + - "[ $DOCKERFILE ] && KANIKO_DOCKERFILE=\"--dockerfile $DOCKERFILE\"" + - /kaniko/executor --context `pwd`/$CONTEXT $KANIKO_DOCKERFILE $KANIKO_D + # Theodolite Helm Chart @@ -118,21 +136,16 @@ spotbugs-benchmarks: stage: deploy extends: - .benchmarks - - .dind + - .kaniko-push needs: - build-benchmarks - checkstyle-benchmarks - pmd-benchmarks - spotbugs-benchmarks - script: - - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') - - docker build --pull -t $IMAGE_NAME ./$JAVA_PROJECT_NAME - - "[ ! $CI_COMMIT_TAG ] && docker tag $IMAGE_NAME $CR_HOST/$CR_ORG/$IMAGE_NAME:${DOCKER_TAG_NAME}latest" - - "[ ! $CI_COMMIT_TAG ] && docker tag $IMAGE_NAME $CR_HOST/$CR_ORG/$IMAGE_NAME:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA" - - "[ $CI_COMMIT_TAG ] && docker tag $IMAGE_NAME $CR_HOST/$CR_ORG/$IMAGE_NAME:$CI_COMMIT_TAG" - - echo $CR_PW | docker login $CR_HOST -u $CR_USER --password-stdin - - docker push $CR_HOST/$CR_ORG/$IMAGE_NAME - - docker logout + variables: + CONTEXT: "/$JAVA_PROJECT_NAME" + #before_script: + # - cd theodolite-benchmarks/$JAVA_PROJECT_NAME rules: - changes: - theodolite-benchmarks/* @@ -355,21 +368,15 @@ deploy-theodolite: stage: deploy extends: - .theodolite - - .dind + - .kaniko-push needs: #- build-theodolite-native - build-theodolite-jvm - test-theodolite - script: - - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') - #- docker build -f src/main/docker/Dockerfile.native -t theodolite . - - docker build -f src/main/docker/Dockerfile.jvm -t theodolite . - - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:${DOCKER_TAG_NAME}latest" - - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA" - - "[ $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$CI_COMMIT_TAG" - - echo $CR_PW | docker login $CR_HOST -u $CR_USER --password-stdin - - docker push $CR_HOST/$CR_ORG/theodolite - - docker logout + variables: + IMAGE_NAME: theodolite + DOCKERFILE: src/main/docker/Dockerfile.jvm + #DOCKERFILE: src/main/docker/Dockerfile.native rules: - changes: - theodolite/**/* @@ -416,17 +423,13 @@ test-slo-checker-dropped-records-kstreams: deploy-slo-checker-lag-trend: stage: deploy extends: - - .dind + - .kaniko-push needs: - test-slo-checker-lag-trend - script: - - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') - - docker build --pull -t theodolite-slo-checker-lag-trend slo-checker/record-lag - - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite-slo-checker-lag-trend $CR_HOST/$CR_ORG/theodolite-slo-checker-lag-trend:${DOCKER_TAG_NAME}latest" - - "[ $CI_COMMIT_TAG ] && docker tag theodolite-slo-checker-lag-trend $CR_HOST/$CR_ORG/theodolite-slo-checker-lag-trend:$CI_COMMIT_TAG" - - echo $CR_PW | docker login $CR_HOST -u $CR_USER --password-stdin - - docker push $CR_HOST/$CR_ORG/theodolite-slo-checker-lag-trend - - docker logout + before_script: + - cd slo-checker/record-lag + variables: + IMAGE_NAME: theodolite-slo-checker-lag-trend rules: - changes: - slo-checker/record-lag/**/* @@ -438,17 +441,13 @@ deploy-slo-checker-lag-trend: deploy-slo-checker-dropped-records-kstreams: stage: deploy extends: - - .dind + - .kaniko-push needs: - test-slo-checker-dropped-records-kstreams - script: - - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') - - docker build --pull -t theodolite-slo-checker-dropped-records-kstreams slo-checker/dropped-records - - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite-slo-checker-dropped-records-kstreams $CR_HOST/$CR_ORG/theodolite-slo-checker-dropped-records-kstreams:${DOCKER_TAG_NAME}latest" - - "[ $CI_COMMIT_TAG ] && docker tag theodolite-slo-checker-dropped-records-kstreams $CR_HOST/$CR_ORG/theodolite-slo-checker-dropped-records-kstreams:$CI_COMMIT_TAG" - - echo $CR_PW | docker login $CR_HOST -u $CR_USER --password-stdin - - docker push $CR_HOST/$CR_ORG/theodolite-slo-checker-dropped-records-kstreams - - docker logout + before_script: + - cd slo-checker/dropped-records + variables: + IMAGE_NAME: theodolite-slo-checker-dropped-records-kstreams rules: - changes: - slo-checker/dropped-records/**/* @@ -463,16 +462,12 @@ deploy-slo-checker-dropped-records-kstreams: deploy-random-scheduler: stage: deploy extends: - - .dind + - .kaniko-push needs: [] - script: - - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') - - docker build --pull -t theodolite-random-scheduler execution/infrastructure/random-scheduler - - "[ ! $CI_COMMIT_TAG ] && docker tag theodolite-random-scheduler $CR_HOST/$CR_ORG/theodolite-random-scheduler:${DOCKER_TAG_NAME}latest" - - "[ $CI_COMMIT_TAG ] && docker tag theodolite-random-scheduler $CR_HOST/$CR_ORG/theodolite-random-scheduler:$CI_COMMIT_TAG" - - echo $CR_PW | docker login $CR_HOST -u $CR_USER --password-stdin - - docker push $CR_HOST/$CR_ORG/theodolite-random-scheduler - - docker logout + before_script: + - cd execution/infrastructure/random-scheduler + variables: + IMAGE_NAME: theodolite-random-scheduler rules: - changes: - execution/infrastructure/random-scheduler/**/* diff --git a/theodolite-benchmarks/docker-test/uc1-beam-flink/docker-compose.yml b/theodolite-benchmarks/docker-test/uc1-beam-flink/docker-compose.yml index 2548472b41935bc83831e9da76e1a69fdb32e54a..8ee83ba0ef15a79b257217a8c21ed11d3095d18e 100644 --- a/theodolite-benchmarks/docker-test/uc1-beam-flink/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc1-beam-flink/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc1-beam-samza/docker-compose.yml b/theodolite-benchmarks/docker-test/uc1-beam-samza/docker-compose.yml index 40a05a8d1716fb5fe122584cf4633fa36c70ceda..ded1e0c38ab05b9c265da670dfaecbc5d6fab609 100644 --- a/theodolite-benchmarks/docker-test/uc1-beam-samza/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc1-beam-samza/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc2-beam-flink/docker-compose.yml b/theodolite-benchmarks/docker-test/uc2-beam-flink/docker-compose.yml index d873d1f090ad7c6ac029c615fba99c4e941830db..72913c015b7894f335a4931dbad9ee28ca18745c 100644 --- a/theodolite-benchmarks/docker-test/uc2-beam-flink/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc2-beam-flink/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc2-beam-samza/docker-compose.yml b/theodolite-benchmarks/docker-test/uc2-beam-samza/docker-compose.yml index a9426b90771adc275fad3ad7c0ba0f465e41ad3b..5f03929108ba738da761f36334bf3c608a5f3c90 100644 --- a/theodolite-benchmarks/docker-test/uc2-beam-samza/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc2-beam-samza/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc3-beam-flink/docker-compose.yml b/theodolite-benchmarks/docker-test/uc3-beam-flink/docker-compose.yml index 39fa0e819742fc0ea669fd1d97c89dc5e9b74ce6..e4f3a3c9f3ebd5017abddee0e06bdf64b18da3c5 100644 --- a/theodolite-benchmarks/docker-test/uc3-beam-flink/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc3-beam-flink/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc3-beam-samza/docker-compose.yml b/theodolite-benchmarks/docker-test/uc3-beam-samza/docker-compose.yml index c5a55077e9f8b6b7e483bf15250cab9561c617da..8c13e774a389e36d451b953106194e9a69aa3244 100644 --- a/theodolite-benchmarks/docker-test/uc3-beam-samza/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc3-beam-samza/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml b/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml index d2b4f9668f9bdfcfdaf6d37b8a7508a7de3ecb85..32893648024e907a384395bdc40bc00cdfe006ae 100644 --- a/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc4-beam-flink/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: diff --git a/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml b/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml index ac4ab9539405f854a3c935dafaafae309086349a..7bcc71193273ab0ab8696a70bcbfda737a2bda73 100644 --- a/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml +++ b/theodolite-benchmarks/docker-test/uc4-beam-samza/docker-compose.yml @@ -3,7 +3,7 @@ services: zookeeper: image: confluentinc/cp-zookeeper expose: - - "9092" + - "2181" environment: ZOOKEEPER_CLIENT_PORT: 2181 kafka: