Skip to content

Commit 4076564

Browse files
resource-aggregate/coap-gw: implement twin synchronization states (#799)
* coap-gateway/resource-aggrate: implement twin synchronization states The twin synchronization state informs user about the reconciliation after the reconnect or twin creation after the first sign-in to the plgd hub. * coap-gateway: enable observation per resource More info: https://docs.plgd.dev/docs/features/device-twin Co-authored-by: Ondrej Tomcik <ondrej.tomcik@plgd.dev>
1 parent e3100c9 commit 4076564

119 files changed

Lines changed: 3495 additions & 1923 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/checkFormat.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ jobs:
1111
runs-on: ubuntu-20.04
1212

1313
steps:
14+
- name: CPU Info
15+
run: |
16+
cat /proc/cpuinfo
17+
echo "Number of cores: $(nproc)"
18+
echo "Number of threads: $(nproc --all)"
1419
- uses: actions/checkout@v3
1520
with:
1621
# fetch branches and history so `git merge-base` in check-format-on-diff works correctly

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ jobs:
1616
name: lint
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: CPU Info
20+
run: |
21+
cat /proc/cpuinfo
22+
echo "Number of cores: $(nproc)"
23+
echo "Number of threads: $(nproc --all)"
1924
- uses: actions/checkout@v3
2025
- uses: actions/setup-go@v3
2126
with:

.github/workflows/publishDockerImagesDockerIO.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121

2222
# Steps represent a sequence of tasks that will be executed as part of the job
2323
steps:
24+
- name: CPU Info
25+
run: |
26+
cat /proc/cpuinfo
27+
echo "Number of cores: $(nproc)"
28+
echo "Number of threads: $(nproc --all)"
2429
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2530
- uses: actions/checkout@v3
2631

.github/workflows/publishDockerImagesGhcr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ jobs:
7272
packages: write
7373

7474
steps:
75+
- name: CPU Info
76+
run: |
77+
cat /proc/cpuinfo
78+
echo "Number of cores: $(nproc)"
79+
echo "Number of threads: $(nproc --all)"
7580
- name: Checkout repository
7681
uses: actions/checkout@v3
7782

.github/workflows/releaseHelmCharts.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ jobs:
77
release-charts:
88
runs-on: ubuntu-latest
99
steps:
10+
- name: CPU Info
11+
run: |
12+
cat /proc/cpuinfo
13+
echo "Number of cores: $(nproc)"
14+
echo "Number of threads: $(nproc --all)"
1015
- uses: actions/checkout@v3
1116
with:
1217
fetch-depth: 0

.github/workflows/staticAnalysis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ jobs:
1212
runs-on: ubuntu-20.04
1313

1414
steps:
15+
- name: CPU Info
16+
run: |
17+
cat /proc/cpuinfo
18+
echo "Number of cores: $(nproc)"
19+
echo "Number of threads: $(nproc --all)"
1520
- uses: actions/checkout@v3
1621
- uses: actions/setup-go@v3
1722
with:

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121

2222
# Steps represent a sequence of tasks that will be executed as part of the job
2323
steps:
24+
- name: CPU Info
25+
run: |
26+
cat /proc/cpuinfo
27+
echo "Number of cores: $(nproc)"
28+
echo "Number of threads: $(nproc --all)"
2429
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2530
- uses: actions/checkout@v3
2631
with:

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"TEST_OAUTH_SERVER_ID_TOKEN_PRIVATE_KEY": "${workspaceFolder}/.tmp/privKeys/idTokenKey.pem",
2121
"TEST_OAUTH_SERVER_ACCESS_TOKEN_PRIVATE_KEY": "${workspaceFolder}/.tmp/privKeys/accessTokenKey.pem",
2222
"TEST_HTTP_GW_WWW_ROOT": "${workspaceFolder}/.tmp/usr/local/www",
23+
// "TEST_COAP_GATEWAY_UDP_ENABLED": "true",
2324
// "GOMAXPROCS": 1,
2425
// "GOFLAGS":"-mod=vendor",
2526
// "GRPC_VERBOSITY":"DEBUG",

bundle/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ cat /configs/coap-gateway.yaml | yq e "\
627627
.apis.coap.externalAddress = \"${FQDN}:${COAP_GATEWAY_UNSECURE_PORT}\" |
628628
.apis.coap.protocols = [\"tcp\"] |
629629
.apis.coap.tls.enabled = false |
630+
.apis.coap.requireBatchObserveEnabled = false |
630631
.apis.coap.authorization.ownerClaim = \"${OWNER_CLAIM}\" |
631632
.apis.coap.authorization.providers[0].name = \"${DEVICE_PROVIDER}\" |
632633
.apis.coap.authorization.providers[0].authority = \"https://${OAUTH_ENDPOINT}\" |
@@ -674,6 +675,7 @@ cat /configs/coap-gateway.yaml | yq e "\
674675
.log.dumpBody = ${COAP_GATEWAY_LOG_MESSAGES} |
675676
.apis.coap.address = \"${COAP_GATEWAY_ADDRESS}\" |
676677
.apis.coap.externalAddress = \"${FQDN}:${COAP_GATEWAY_PORT}\" |
678+
.apis.coap.requireBatchObserveEnabled = false |
677679
.apis.coap.tls.enabled = true |
678680
.apis.coap.tls.keyFile = \"${EXTERNAL_CERT_DIR_PATH}/${COAP_GATEWAY_FILE_CERT_KEY_NAME}\" |
679681
.apis.coap.tls.certFile = \"${EXTERNAL_CERT_DIR_PATH}/${COAP_GATEWAY_FILE_CERT_NAME}\" |

charts/plgd-hub/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ global:
182182
| certmanager.internal.issuer.name | string | `nil` | Name |
183183
| certmanager.internal.issuer.spec | string | `nil` | cert-manager issuer spec |
184184
| cluster.dns | string | `"cluster.local"` | Cluster internal DNS prefix |
185-
| coapgateway | object | `{"affinity":{},"apis":{"coap":{"authorization":{"deviceIdClaim":null,"ownerClaim":null,"providers":null},"blockwiseTransfer":{"blockSize":"1024","enabled":true},"externalAddress":"","keepAlive":{"timeout":"20s"},"maxMessageSize":262144,"messagePoolSize":1000,"ownerCacheExpiration":"1m","protocols":["tcp"],"subscriptionBufferSize":1000,"tls":{"caPool":null,"certFile":null,"clientCertificateRequired":true,"disconnectOnExpiredCertificate":false,"enabled":true,"keyFile":null}}},"clients":{"eventBus":{"nats":{"pendingLimits":{"bytesLimit":"67108864","msgLimit":"524288"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false},"url":""}},"identityStore":{"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}},"ownerClaim":null},"resourceAggregate":{"deviceStatusExpiration":{"enabled":false,"expiresIn":"0s"},"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}}},"resourceDirectory":{"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}}}},"config":{"fileName":"service.yaml","mountPath":"/config","volume":"config"},"deploymentAnnotations":{},"deploymentLabels":{},"enabled":true,"extraContainers":{},"extraVolumeMounts":{},"extraVolumes":{},"fullnameOverride":null,"hubId":null,"image":{"imagePullSecrets":{},"pullPolicy":"Always","registry":"ghcr.io/","repository":"plgd-dev/hub/coap-gateway","tag":null},"imagePullSecrets":{},"initContainersTpl":{},"livenessProbe":{},"log":{"dumpBody":false,"encoderConfig":{"timeEncoder":"rfc3339nano"},"encoding":"json","level":"info","stacktrace":{"enabled":false,"level":"warn"}},"name":"coap-gateway","nodeSelector":{},"podAnnotations":{},"podLabels":{},"podSecurityContext":{},"port":5684,"rbac":{"enabled":false,"roleBindingDefinitionTpl":null,"serviceAccountName":"coap-gateway"},"readinessProbe":{},"replicas":1,"resources":{},"restartPolicy":"Always","securityContext":{},"service":{"nodePort":null,"tcp":{"annotations":{},"labels":{},"name":"coaps-tcp","nodePort":null,"protocol":"TCP","targetPort":"coaps-tcp","type":null},"type":"LoadBalancer","udp":{"annotations":{},"labels":{},"name":"coaps-udp","nodePort":null,"protocol":"UDP","targetPort":"coaps-udp","type":null}},"taskQueue":{"goPoolSize":1600,"maxIdleTime":"10m","size":"2097152"},"tolerations":{}}` | CoAP gateway parameters |
185+
| coapgateway | object | `{"affinity":{},"apis":{"coap":{"authorization":{"deviceIdClaim":null,"ownerClaim":null,"providers":null},"blockwiseTransfer":{"blockSize":"1024","enabled":true},"externalAddress":"","keepAlive":{"timeout":"20s"},"maxMessageSize":262144,"messagePoolSize":1000,"ownerCacheExpiration":"1m","protocols":["tcp"],"requireBatchObserveEnabled":true,"subscriptionBufferSize":1000,"tls":{"caPool":null,"certFile":null,"clientCertificateRequired":true,"disconnectOnExpiredCertificate":false,"enabled":true,"keyFile":null}}},"clients":{"eventBus":{"nats":{"pendingLimits":{"bytesLimit":"67108864","msgLimit":"524288"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false},"url":""}},"identityStore":{"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}},"ownerClaim":null},"resourceAggregate":{"deviceStatusExpiration":{"enabled":false,"expiresIn":"0s"},"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}}},"resourceDirectory":{"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}}}},"config":{"fileName":"service.yaml","mountPath":"/config","volume":"config"},"deploymentAnnotations":{},"deploymentLabels":{},"enabled":true,"extraContainers":{},"extraVolumeMounts":{},"extraVolumes":{},"fullnameOverride":null,"hubId":null,"image":{"imagePullSecrets":{},"pullPolicy":"Always","registry":"ghcr.io/","repository":"plgd-dev/hub/coap-gateway","tag":null},"imagePullSecrets":{},"initContainersTpl":{},"livenessProbe":{},"log":{"dumpBody":false,"encoderConfig":{"timeEncoder":"rfc3339nano"},"encoding":"json","level":"info","stacktrace":{"enabled":false,"level":"warn"}},"name":"coap-gateway","nodeSelector":{},"podAnnotations":{},"podLabels":{},"podSecurityContext":{},"port":5684,"rbac":{"enabled":false,"roleBindingDefinitionTpl":null,"serviceAccountName":"coap-gateway"},"readinessProbe":{},"replicas":1,"resources":{},"restartPolicy":"Always","securityContext":{},"service":{"nodePort":null,"tcp":{"annotations":{},"labels":{},"name":"coaps-tcp","nodePort":null,"protocol":"TCP","targetPort":"coaps-tcp","type":null},"type":"LoadBalancer","udp":{"annotations":{},"labels":{},"name":"coaps-udp","nodePort":null,"protocol":"UDP","targetPort":"coaps-udp","type":null}},"taskQueue":{"goPoolSize":1600,"maxIdleTime":"10m","size":"2097152"},"tolerations":{}}` | CoAP gateway parameters |
186186
| coapgateway.affinity | object | `{}` | Affinity definition |
187-
| coapgateway.apis | object | `{"coap":{"authorization":{"deviceIdClaim":null,"ownerClaim":null,"providers":null},"blockwiseTransfer":{"blockSize":"1024","enabled":true},"externalAddress":"","keepAlive":{"timeout":"20s"},"maxMessageSize":262144,"messagePoolSize":1000,"ownerCacheExpiration":"1m","protocols":["tcp"],"subscriptionBufferSize":1000,"tls":{"caPool":null,"certFile":null,"clientCertificateRequired":true,"disconnectOnExpiredCertificate":false,"enabled":true,"keyFile":null}}}` | For complete coap-gateway service configuration see [plgd/coap-gateway](https://github.com/plgd-dev/hub/tree/main/coap-gateway) |
187+
| coapgateway.apis | object | `{"coap":{"authorization":{"deviceIdClaim":null,"ownerClaim":null,"providers":null},"blockwiseTransfer":{"blockSize":"1024","enabled":true},"externalAddress":"","keepAlive":{"timeout":"20s"},"maxMessageSize":262144,"messagePoolSize":1000,"ownerCacheExpiration":"1m","protocols":["tcp"],"requireBatchObserveEnabled":true,"subscriptionBufferSize":1000,"tls":{"caPool":null,"certFile":null,"clientCertificateRequired":true,"disconnectOnExpiredCertificate":false,"enabled":true,"keyFile":null}}}` | For complete coap-gateway service configuration see [plgd/coap-gateway](https://github.com/plgd-dev/hub/tree/main/coap-gateway) |
188188
| coapgateway.apis.coap.tls.disconnectOnExpiredCertificate | bool | `false` | After the certificate expires, the connection will be disconnected |
189189
| coapgateway.clients | object | `{"eventBus":{"nats":{"pendingLimits":{"bytesLimit":"67108864","msgLimit":"524288"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false},"url":""}},"identityStore":{"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}},"ownerClaim":null},"resourceAggregate":{"deviceStatusExpiration":{"enabled":false,"expiresIn":"0s"},"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}}},"resourceDirectory":{"grpc":{"address":"","keepAlive":{"permitWithoutStream":true,"time":"10s","timeout":"20s"},"tls":{"caPool":null,"certFile":null,"keyFile":null,"useSystemCAPool":false}}}}` | For complete coap-gateway service configuration see [plgd/coap-gateway](https://github.com/plgd-dev/hub/tree/main/coap-gateway) |
190190
| coapgateway.config.fileName | string | `"service.yaml"` | Service configuration file name |

0 commit comments

Comments
 (0)