diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b10ffeabbc08a1f25a88d2b351f3e8dd6309443..b7d75d5470d8073a2021e06428e9170f605ec7b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -303,6 +303,32 @@ deploy-theodolite: allow_failure: true +# Theodolite SLO Checker: Lag Trend + +deploy-slo-checker-lag-trend: + stage: deploy + extends: + - .dind + script: + - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') + - docker build --pull -t theodolite-slo-checker-lag-trend slope-evaluator + - "[ ! $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 + rules: + - if: "$CR_HOST && $CR_ORG && $CR_USER && $CR_PW && $CI_COMMIT_TAG" + when: always + - changes: + - slope-evaluator/**/* + if: "$CR_HOST && $CR_ORG && $CR_USER && $CR_PW" + when: always + - if: "$CR_HOST && $CR_ORG && $CR_USER && $CR_PW" + when: manual + allow_failure: true + + # Theodolite Random Scheduler deploy-random-scheduler: diff --git a/execution/helm/README.md b/execution/helm/README.md index 9712270a6eefc727be6a517fe52bcd2a35d800ae..c545804aaec8eb8ed91054f1f7ee97dd293816a4 100644 --- a/execution/helm/README.md +++ b/execution/helm/README.md @@ -50,11 +50,21 @@ To uninstall/delete the `theodolite` deployment: helm delete theodolite ``` -This command does not remove the CRDs which are created by this Chart. Remove this CRDs with: +This command does not remove the CRDs which are created by this chart. Remove them manually with: ```sh +# CRDs from Theodolite kubectl delete crd executions.theodolite.com kubectl delete crd benchmarks.theodolite.com +# CRDs from Prometheus operator (see https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#uninstall-chart) +kubectl delete crd alertmanagerconfigs.monitoring.coreos.com +kubectl delete crd alertmanagers.monitoring.coreos.com +kubectl delete crd podmonitors.monitoring.coreos.com +kubectl delete crd probes.monitoring.coreos.com +kubectl delete crd prometheuses.monitoring.coreos.com +kubectl delete crd prometheusrules.monitoring.coreos.com +kubectl delete crd servicemonitors.monitoring.coreos.com +kubectl delete crd thanosrulers.monitoring.coreos.com ``` ## Development diff --git a/execution/helm/templates/theodolite/thedolite-operator.yaml b/execution/helm/templates/theodolite/thedolite-operator.yaml index 9b3714e4a9a8b0a7a891cbe71e0b2060e90f97b9..cb3f193b89c3a198bab853fb85a0db1184394dce 100644 --- a/execution/helm/templates/theodolite/thedolite-operator.yaml +++ b/execution/helm/templates/theodolite/thedolite-operator.yaml @@ -17,14 +17,14 @@ spec: serviceAccountName: {{ include "theodolite.serviceAccountName" . }} containers: - name: theodolite - image: lorenzboguhn/thedolite:latest + image: ghcr.io/cau-se/theodolite:theodolite-kotlin-latest env: - name: NAMESPACE value: {{ .Release.Namespace }} - name: MODE value: operator - name: lag-analysis - image: benediktwetzel/lag-analysis + image: ghcr.io/cau-se/theodolite-slo-checker-lag-trend:theodolite-kotlin-latest ports: - containerPort: 80 name: analysis diff --git a/theodolite-quarkus/config/thedolite-operator.yaml b/theodolite-quarkus/config/thedolite-operator.yaml index 5059035b27cd9202e8e9b199f9ceb48d55c053d6..1e0e60248c2474cc8493179c003b806030f79f8c 100644 --- a/theodolite-quarkus/config/thedolite-operator.yaml +++ b/theodolite-quarkus/config/thedolite-operator.yaml @@ -16,7 +16,7 @@ spec: serviceAccountName: theodolite containers: - name: thedolite - image: lorenzboguhn/thedolite:latest + image: ghcr.io/cau-se/theodolite:theodolite-kotlin-latest env: - name: KUBECONFIG value: "~/.kube/config" diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index f14a0e4f38903f9b677dd529228efb92ae67bd73..a75cd96efdb1be3999bf040f0a7fc0b1d8bb739e 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -21,14 +21,13 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced { lateinit var resourceTypes: List<TypeName> lateinit var loadTypes: List<TypeName> lateinit var kafkaConfig: KafkaConfig - val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE + private val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE var path = System.getenv("THEODOLITE_APP_RESOURCES") ?: "./config" - val client = DefaultKubernetesClient().inNamespace(namespace) private fun loadKubernetesResources(resources: List<String>): List<Pair<String, KubernetesResource>> { val parser = YamlParser() - val loader = K8sResourceLoader(client) + val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(namespace)) return resources .map { resource -> val resourcePath = "$path/$resource" @@ -68,7 +67,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced { resources = resources.map { r -> r.second }, kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer), topics = kafkaConfig.getKafkaTopics(), - client = client + client = DefaultKubernetesClient().inNamespace(namespace) ) } } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/Main.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/Main.kt index 3246d0a7930aab22d16ed94a6c0f10a9d3fde10e..4518ef7957104819b26eae95cf4e6e9b35c4e995 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/Main.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/Main.kt @@ -13,7 +13,7 @@ object Main { @JvmStatic fun main(args: Array<String>) { - val mode = System.getenv("MODE") ?: "operator" + val mode = System.getenv("MODE") ?: "yaml-executor" logger.info { "Start Theodolite with mode $mode" } when(mode) {