UDMI / Docs / Tools / Sharding
It’s possible to run sequencer on an alternate set of project registries, called shards. This is useful for testing things from the same site model in parallel, since currently there can only be one instance of any tool using the reflector running on each registry.
Basic operation is determined by a specified registry suffix (e.g. _A
) that triggers all (ideally) tools
to automatically append the suffix to any actual registry operation. Tools should automatically pick this
up from the UDMI_REGISTRY_SUFFIX
env variable, and if it’s not set then it will default back to normal
(no suffix) behavior.
E.g., on tool startup, instead of the normal MQTT client connection message:
[main] INFO com.google.bos.iot.core.proxy.MqttPublisher - ZZ-REDIRECT-NA creating client projects/bos-peringknife-dev/locations/us-central1/registries/UDMI-REFLECT/devices/ZZ-REDIRECT-NA on ssl://mqtt.googleapis.com:8883
a system with a registry suffix setting of _A
would show:
[main] INFO com.google.bos.iot.core.proxy.MqttPublisher - ZZ-REDIRECT-NA_A creating client projects/bos-peringknife-dev/locations/us-central1/registries/UDMI-REFLECT/devices/ZZ-REDIRECT-NA_A on ssl://mqtt.googleapis.com:8883
ZZ-TRI-FECTA_A
).ZZ-REDIRECT-NA_A
).ZZ-TRI-FECTA_A
in the UDMI-REFLECT
registry).
_A
).ZZ-REDIRECT-NA_A
in registry UDMI-REFLECT
if necessary for endpoint connection testing.UDMI_REGISTRY_SUFFIX
env variable: either locally or through a GitHub Actions variable.bin/test_sequencer $PROJECT_ID no_valid_test
to attempt a test run – this will fail.
validator/bin/registrar /tmp/validator_config.json
/tmp/validator_config.json
config file is generated from the failed bin/test_sequencer
step.validator/bin/registrar /tmp/validator_config.json -a
: The added -a
means alternate for the option redirection test registry.
/tmp/validator_config.json
config file.ZZ-TRI-FECTA_A
, but this should then be ZZ-REDIRECT-NA_A
.If the UDMI_REGISTRY_SUFFIX
is defined as a GitHub Actions variable, the workflow will automatically skip bin/test_sequencer
in the
main flow, and instead run it in a parallel sequencer-only flow. The “skipped” step will still show up but not executed.