From 381a340778f20e25dcd6df42fd33c3246be61d64 Mon Sep 17 00:00:00 2001 From: Fabrice Jammes Date: Wed, 17 Jul 2024 11:38:24 +0200 Subject: [PATCH] Increase parameters management --- chart/values-ci-noscience.yaml | 21 ---------- chart/values-ci.yaml | 19 --------- e2e/argocd.sh | 13 ++++++- e2e/fink-start.sh | 2 - e2e/finkconfig/values-fink-broker.yaml | 53 ++++++++++++++++++++++++++ 5 files changed, 65 insertions(+), 43 deletions(-) delete mode 100644 chart/values-ci-noscience.yaml delete mode 100644 chart/values-ci.yaml create mode 100644 e2e/finkconfig/values-fink-broker.yaml diff --git a/chart/values-ci-noscience.yaml b/chart/values-ci-noscience.yaml deleted file mode 100644 index b0ffc21c..00000000 --- a/chart/values-ci-noscience.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# Default values for chart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -night: "20200101" - -image: - name: fink-broker-noscience - -# -# Parameters used to run the stream2raw task -# -stream2raw: - kafka: - topic: "ztf-stream-sim" - -# -# Parameters used to access the S3 bucket -# -s3: - bucket: "fink-broker-online" diff --git a/chart/values-ci.yaml b/chart/values-ci.yaml deleted file mode 100644 index 21557945..00000000 --- a/chart/values-ci.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Default values for chart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -night: "20200101" - -# -# Parameters used to run the stream2raw task -# -stream2raw: - kafka: - topic: "ztf-stream-sim" - -# -# Parameters used to access the S3 bucket -# -s3: - bucket: "fink-broker-online" - diff --git a/e2e/argocd.sh b/e2e/argocd.sh index 9a0c1989..375f59df 100755 --- a/e2e/argocd.sh +++ b/e2e/argocd.sh @@ -7,6 +7,8 @@ set -euxo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + CIUXCONFIG=${CIUXCONFIG:-"$HOME/.ciuxconfig"} echo "CIUXCONFIG=${CIUXCONFIG}" . $CIUXCONFIG @@ -34,11 +36,21 @@ NS=argocd argocd login --core kubectl config set-context --current --namespace="$NS" +IMAGE="$CIUX_IMAGE_URL" +echo "Use CIUX_IMAGE_URL to set fink-broker image: $CIUX_IMAGE_URL" +if [[ "$IMAGE" =~ "-noscience" ]]; +then + FINKCONFIG="$DIR/finkconfig_noscience" +else + FINKCONFIG="$DIR/finkconfig" +fi + # Create fink app argocd app create fink --dest-server https://kubernetes.default.svc \ --dest-namespace "$NS" \ --repo https://github.com/astrolabsoftware/fink-cd.git \ --path apps --revision "$FINK_CD_WORKBRANCH" + --values $FINKCONFIG/values-fink-broker.yaml # Sync fink app-of-apps argocd app sync fink @@ -61,7 +73,6 @@ retry kubectl wait --for condition=established --timeout=60s crd/kafkas.kafka.st argocd app set fink-broker -p image.repository="$CIUX_IMAGE_REGISTRY" \ -p image.name="$CIUX_IMAGE_NAME" \ -p image.tag="$CIUX_IMAGE_TAG" \ - -p night="20200101" argocd app sync -l app.kubernetes.io/instance=fink # TODO Wait for kafkatopic to exist diff --git a/e2e/fink-start.sh b/e2e/fink-start.sh index 38834880..a69bd378 100755 --- a/e2e/fink-start.sh +++ b/e2e/fink-start.sh @@ -48,10 +48,8 @@ IMAGE="$CIUX_IMAGE_URL" echo "Use CIUX_IMAGE_URL to set fink-broker image: $CIUX_IMAGE_URL" if [[ "$IMAGE" =~ "-noscience" ]]; then - VALUE_FILE="$DIR/../chart/values-ci-noscience.yaml" FINKCONFIG="$DIR/finkconfig_noscience" else - VALUE_FILE="$DIR/../chart/values-ci.yaml" FINKCONFIG="$DIR/finkconfig" fi diff --git a/e2e/finkconfig/values-fink-broker.yaml b/e2e/finkconfig/values-fink-broker.yaml new file mode 100644 index 00000000..e4418dcb --- /dev/null +++ b/e2e/finkconfig/values-fink-broker.yaml @@ -0,0 +1,53 @@ +# Can be overriden in stream2raw, raw2science and distribution sections +cores: 1 +coreRequest: 0 +instances: 1 +memory: 1g +# instances: 1 + +fink_trigger_update: "2" + +# Can be overriden using --image option + +# Default to s3a:// +# online_data_prefix: s3a://fink-broker-online +producer: sims + +log_level: INFO + +# +# Parameters used to run the stream2raw task +# +stream2raw: + cores: "{{.Values.cores}}" + coreRequest: "{{.Values.coreRequest}}" + memory: "{{.Values.memory}}" + instances: "{{.Values.instances}}" + fink_alert_schema: /home/fink/fink-alert-schemas/ztf/ztf_public_20190903.schema.avro + kafka: + in_sockets: kafka-cluster-kafka-bootstrap.kafka:9092 + starting_offset: earliest + topic: ztf-stream-sim + +# +# Parameters used to run the raw2science task +# +raw2science: + cores: 2 + coreRequest: 0 + memory: 3000m + instances: 2 + +# +# Parameters used to run the distribution task +# +distribution: + cores: "{{.Values.cores}}" + coreRequest: "{{.Values.coreRequest}}" + memory: "{{.Values.memory}}" + instances: "{{.Values.instances}}" + kafka: + out_sockets: "kafka-cluster-kafka-external-bootstrap.kafka:9094" + schema: "/home/fink/fink-alert-schemas/ztf/distribution_schema_0p2.avsc" + substream_prefix: "fink_" +