From 5535dcfcfbdab8d8b8150e03dc11dbd9db0f3acc Mon Sep 17 00:00:00 2001 From: Trevor Date: Fri, 25 Aug 2023 16:53:58 +0100 Subject: [PATCH] More UDMIS and Registrar fixes (#721) --- .github/workflows/testing.yml | 4 +- .../com/google/udmi/util/GeneralUtils.java | 5 +- .../UdmiServicePod_configured.xml | 2 +- udmis/bin/container | 42 +++---- udmis/bin/deploy | 21 +--- udmis/bin/update | 4 +- udmis/etc/prod_pod.json | 5 +- .../access/ClearBladeIotAccessProvider.java | 103 +++++++++--------- .../access/DynamicIotAccessProvider.java | 6 + .../service/access/GcpIotAccessProvider.java | 4 +- .../udmi/service/access/IotAccessBase.java | 50 ++++++++- .../access/LocalIotAccessProvider.java | 1 + .../udmi/service/core/DistributorPipe.java | 6 +- .../bos/udmi/service/core/ProcessorBase.java | 1 + .../udmi/service/core/ReflectProcessor.java | 37 +++++-- .../service/messaging/impl/MessageBase.java | 11 +- .../messaging/impl/MessageDispatcherImpl.java | 2 +- .../service/messaging/impl/PubSubPipe.java | 10 +- .../messaging/impl/SimpleMqttPipe.java | 72 ++++++------ .../service/access/IotAccessBaseTest.java | 27 +++++ .../bos/iot/core/proxy/MqttPublisher.java | 2 +- .../daq/mqtt/registrar/LocalDevice.java | 4 +- .../google/daq/mqtt/registrar/Registrar.java | 3 +- .../daq/mqtt/sequencer/SequenceBase.java | 4 +- .../daq/mqtt/util/IotReflectorClient.java | 10 +- 25 files changed, 262 insertions(+), 174 deletions(-) mode change 100755 => 120000 udmis/bin/deploy create mode 100644 udmis/src/test/java/com/google/bos/udmi/service/access/IotAccessBaseTest.java diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d8240bc97a..02d9ac56c2 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -49,12 +49,13 @@ jobs: - name: Setup udmis container build if: ${{ github.event_name == 'push' }} run: | + set -x revhash=$(git rev-parse $GITHUB_REF) IMAGE_TAG=g${revhash:0:9} PUSH_REPO=$PUSH_REGISTRY/${{ github.repository }} PUSH_TAG=$PUSH_REPO:$IMAGE_TAG echo PUSH_TAG=$PUSH_TAG >> $GITHUB_ENV - udmis/bin/container prep --no-check $PUSH_REPO + udmis/bin/container prep --no-check ${PUSH_REPO%/*} echo Pushing built container as $PUSH_TAG | tee -a $GITHUB_STEP_SUMMARY - name: Build and push docker image if: ${{ github.event_name == 'push' }} @@ -295,7 +296,6 @@ jobs: cd sites/udmi_site_model/out find . -type f | sort | xargs more | cat - name: itemized sequencer tests - if: ${{ always() }} run: | bin/test_itemized $GCP_TARGET_PROJECT - name: itemized output logs diff --git a/common/src/main/java/com/google/udmi/util/GeneralUtils.java b/common/src/main/java/com/google/udmi/util/GeneralUtils.java index 26d2fb2246..14524838e5 100644 --- a/common/src/main/java/com/google/udmi/util/GeneralUtils.java +++ b/common/src/main/java/com/google/udmi/util/GeneralUtils.java @@ -49,8 +49,9 @@ public class GeneralUtils { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() .enable(SerializationFeature.INDENT_OUTPUT) .setDateFormat(new ISO8601DateFormat()) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .setSerializationInclusion(JsonInclude.Include.NON_NULL); - private static final ObjectMapper OBJECT_MAPPER_RAW = + public static final ObjectMapper OBJECT_MAPPER_RAW = OBJECT_MAPPER.copy() .enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS) .enable(Feature.ALLOW_TRAILING_COMMA) @@ -59,7 +60,7 @@ public class GeneralUtils { .setSerializationInclusion(Include.NON_NULL); public static final ObjectMapper OBJECT_MAPPER_STRICT = OBJECT_MAPPER_RAW.copy() - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .disable(SerializationFeature.INDENT_OUTPUT); private static final String SEPARATOR = "\n "; diff --git a/udmis/.idea/runConfigurations/UdmiServicePod_configured.xml b/udmis/.idea/runConfigurations/UdmiServicePod_configured.xml index 59670b69c6..d05214369a 100644 --- a/udmis/.idea/runConfigurations/UdmiServicePod_configured.xml +++ b/udmis/.idea/runConfigurations/UdmiServicePod_configured.xml @@ -19,4 +19,4 @@