Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Kafka on the Scorpio AAIO #395

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion helm/charts/scorpio/templates/scorpio-aaio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ spec:
secretKeyRef:
name: {{ .Values.db.dbUser -}}.{{- .Values.clusterSvcName -}}.{{- .Values.db.secretPostfix }}
key: password
{{- range $key, $val := .Values.keycloak_vars}}
- name: POSTGRES_DBNAME
value: {{ .Values.db.scorpioDb }}
{{- range $key, $val := .Values.keycloak_vars }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
{{- range $key, $val := .Values.kafka_vars }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end }}
Expand Down
1 change: 0 additions & 1 deletion helm/charts/scorpio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ aaio:
image:
repository: ibn/scorpio-all-in-one-runner
pullPolicy: Always
tag: 0.1
resources: {}

################################### SpringArgs #######################################################################
Expand Down
7 changes: 4 additions & 3 deletions helm/environment/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ scorpio:
memory: 256Mi
resources_main:
limits:
memory: 512Mi
cpu: 1
memory: 1024Mi
requests:
cpu: 200m
memory: 256Mi
cpu: 500m
memory: 512Mi

certmanager:
secret: selfsigned-cert-tls
Expand Down
19 changes: 13 additions & 6 deletions test/bats/test-bridges/test-ngsild-updates-bridge.bats
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,19 @@ compare_upserted_non_overwritten_entity() {
"type" : "${FILTER_TYPE}",
"https://industry-fusion.com/types/v0.9/hasCartridge" : {
"type" : "Relationship",
"object" : "urn:filterCartridge-test:12345"
"object" : "urn:filterCartridge-test:22345"
},
"https://industry-fusion.com/types/v0.9/state" : {
"type" : "Property",
"value" : "OFFF"
"value" : "OFF"
},
"https://industry-fusion.com/types/v0.9/strength" : {
"type" : "Property",
"value" : "0.9"
"value" : "0.1"
},
"https://industry-fusion.com/types/v0.9/strength2": {
"type": "Property",
"value": "0.5"
}
}
EOF
Expand Down Expand Up @@ -593,9 +597,9 @@ teardown(){
kafkacat -P -t ${KAFKACAT_NGSILD_UPDATES_TOPIC} -b ${KAFKA_BOOTSTRAP} <${UPSERT_FILTER_OVERWRITE}
sleep 2
get_ngsild "${token}" ${FILTER_ID} | jq 'del( ."https://industry-fusion.com/types/v0.9/metadata/kafkaSyncOn" )' >${RECEIVED_ENTITY}
delete_ngsild "${token}" ${FILTER_ID}
run compare_upserted_overwritten_entity ${RECEIVED_ENTITY}
[ "$status" -eq 0 ]
delete_ngsild "${token}" ${FILTER_ID}
}

@test "verify ngsild-update bridge is upserting and non-overwriting ngsi-ld entitiy" {
Expand All @@ -604,6 +608,9 @@ teardown(){
# property but Quarkus
# Currently the test is not changing the object. We leave it in in case in future this API is working correctly
# And will be detected by this.
# Update: In Scorpio Version 3.0.11 the program behaviour changed again but it is still not quite aligned
# with the NGSI-LD documentations, therefore we tweaked the test case to work with the current behaviour.
# When this test fails in the future, we will know that the behaviour has changed again.
kafkacat -P -t ${KAFKACAT_NGSILD_UPDATES_TOPIC} -b ${KAFKA_BOOTSTRAP} <${UPSERT_FILTER}
echo "# Sent upsert object to ngsi-ld-updates-bridge, wait some time to let it settle"
sleep 2
Expand All @@ -615,9 +622,9 @@ teardown(){
kafkacat -P -t ${KAFKACAT_NGSILD_UPDATES_TOPIC} -b ${KAFKA_BOOTSTRAP} <${UPSERT_FILTER_NON_OVERWRITE}
sleep 2
get_ngsild "${token}" ${FILTER_ID} | jq 'del( ."https://industry-fusion.com/types/v0.9/metadata/kafkaSyncOn" )' >${RECEIVED_ENTITY}
delete_ngsild "${token}" ${FILTER_ID}
run compare_upserted_non_overwritten_entity ${RECEIVED_ENTITY}
[ "$status" -eq 0 ]
delete_ngsild "${token}" ${FILTER_ID}
}

@test "verify ngsild-update bridge is updating ngsi-ld entitiy" {
Expand All @@ -630,7 +637,7 @@ teardown(){
kafkacat -P -t ${KAFKACAT_NGSILD_UPDATES_TOPIC} -b ${KAFKA_BOOTSTRAP} <${UPDATE_FILTER}
echo "# Sent update object to ngsi-ld-updates-bridge, wait some time to let it settle"
sleep 2
get_ngsild "${token}" ${FILTER_ID} | jq 'del( ."https://industry-fusion.com/types/v0.9/metadata/kafkaSyncOn" )' >${RECEIVED_ENTITY}
get_ngsild "${token}" ${FILTER_ID} | jq 'del( ."https://industry-fusion.com/types/v0.9/metadata/kafkaSyncOn" )' >${RECEIVED_ENTITY}
delete_ngsild "${token}" ${FILTER_ID}
run compare_updated_entity ${RECEIVED_ENTITY}
[ "$status" -eq 0 ]
Expand Down
4 changes: 2 additions & 2 deletions test/build-local-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ echo Build Scorpio containers

if [[ $TEST -eq "true" ]]; then
( cd ../.. && git clone https://github.com/IndustryFusion/ScorpioBroker.git)
( cd ../../ScorpioBroker && git checkout 78409dd ) # Checking out specific commit for CI purposes
( cd ../../ScorpioBroker && source /etc/profile.d/maven.sh && mvn clean package -DskipTests -Ddocker -Ddocker-tag=$VERSION -Din-memory -Pin-memory -Dquarkus.profile=in-memory -Dos=java)
( cd ../../ScorpioBroker && git checkout 2a3b3c3 ) # Checking out specific commit for CI purposes
( cd ../../ScorpioBroker && source /etc/profile.d/maven.sh && mvn clean package -DskipTests -Ddocker -Ddocker-tag=$VERSION -Dkafka -Pkafka -Dquarkus.profile=kafka -Dos=java)
else
( cd ../.. && git clone https://github.com/IndustryFusion/ScorpioBroker.git )
( cd ../../ScorpioBroker && mvn clean package -DskipTests -Pdocker )
Expand Down