From 0174ed1ba859e6764f1f9e4ef0aea23af08f96c6 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 14 Nov 2023 21:35:50 +0100 Subject: [PATCH 1/3] remove unused code Signed-off-by: Reuben Miller --- .github/workflows/test.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6d9055b..cfe85c3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -80,11 +80,6 @@ jobs: just bootstrap --no-prompt fi - # FIXME: Debug why the mapper does not start up cleanly sometimes - # Is it just waiting for the token? - #sleep 20 - #just shell systemctl restart tedge-mapper-c8y - - name: Run tests run: just IMAGE=${{matrix.job.target}} test From 8a2df0fa5aa7d632a57af23e07da3016e9c63c41 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 14 Nov 2023 21:39:06 +0100 Subject: [PATCH 2/3] remove workarounds after 0.13.1 release Signed-off-by: Reuben Miller --- .../alpine-s6/docker-compose.yaml | 6 +--- images/alpine-s6/alpine-s6.dockerfile | 2 ++ images/alpine-s6/cont-init.d/configure.sh | 35 ------------------- images/alpine-s6/docker-compose.yaml | 6 +--- 4 files changed, 4 insertions(+), 45 deletions(-) diff --git a/demos/docker-compose/alpine-s6/docker-compose.yaml b/demos/docker-compose/alpine-s6/docker-compose.yaml index d1a3034..c5778ae 100644 --- a/demos/docker-compose/alpine-s6/docker-compose.yaml +++ b/demos/docker-compose/alpine-s6/docker-compose.yaml @@ -50,12 +50,11 @@ services: restart: always environment: - TEDGE_MQTT_CLIENT_HOST=mosquitto + - TEDGE_HTTP_CLIENT_HOST=tedge - TEDGE_C8Y_URL=${C8Y_DOMAIN:-} # # Enable/disable specific services # - # Rename when https://github.com/thin-edge/thin-edge.io/issues/2391 is resolved - - FIXME_TEDGE_HTTP_CLIENT_HOST=tedge - SERVICE_TEDGE_MAPPER_C8Y=1 # FIXME: remove once c8y-firmware-plugin has been made generic # Run c8y-firmware-plugin on the mapper as it needs access to the certificates and c8y.url @@ -87,9 +86,6 @@ services: environment: <<: *device-env TEDGE_MQTT_DEVICE_TOPIC_ID: device/main// - # FIXME: Move environment variable to dockerfile once https://github.com/thin-edge/thin-edge.io/issues/2391 is resolved - # as the bind and client host addresses will be decoupled - TEDGE_HTTP_BIND_ADDRESS: "0.0.0.0" # FIXME: Remove volume once https://github.com/thin-edge/thin-edge.io/issues/2390 is resolved volumes: diff --git a/images/alpine-s6/alpine-s6.dockerfile b/images/alpine-s6/alpine-s6.dockerfile index 35c4f57..aa2ee87 100644 --- a/images/alpine-s6/alpine-s6.dockerfile +++ b/images/alpine-s6/alpine-s6.dockerfile @@ -51,6 +51,8 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2 ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=30000 ENV TEDGE_C8Y_PROXY_BIND_ADDRESS 0.0.0.0 +ENV TEDGE_HTTP_BIND_ADDRESS 0.0.0.0 + USER "tedge" ENTRYPOINT ["/init"] diff --git a/images/alpine-s6/cont-init.d/configure.sh b/images/alpine-s6/cont-init.d/configure.sh index ea6824e..e4fab70 100755 --- a/images/alpine-s6/cont-init.d/configure.sh +++ b/images/alpine-s6/cont-init.d/configure.sh @@ -1,37 +1,2 @@ #!/command/with-contenv sh set -e - -# FIXME: Remove when https://github.com/thin-edge/thin-edge.io/issues/2391 is resolved -# In the future the the bind and client host will be decoupled and the http.client.host will -# accept hostnames (removing the need to lookup the ip address) -if [ -n "$FIXME_TEDGE_HTTP_CLIENT_HOST" ]; then - # - # Configure mapper to point to correct ip address of tedge-agent http server - # - FIXME_TEDGE_HTTP_CLIENT_HOST_IP=$(getent hosts "$FIXME_TEDGE_HTTP_CLIENT_HOST" | cut -d' ' -f1) - - if [ -n "$FIXME_TEDGE_HTTP_CLIENT_HOST_IP" ]; then - echo "Setting http.bind.address address to $FIXME_TEDGE_HTTP_CLIENT_HOST_IP ($FIXME_TEDGE_HTTP_CLIENT_HOST)" >&2 - tedge config set http.bind.address "$FIXME_TEDGE_HTTP_CLIENT_HOST_IP" - fi -fi - -# FIXME: Remove once https://github.com/thin-edge/thin-edge.io/issues/2389 is resolved -# A manual registration before the service starts up seems to prevent duplicate registration messages -TOPIC_ROOT=$(tedge config get mqtt.topic_root) -TOPIC_ID=$(tedge config get mqtt.device_topic_id) - -if [ "$REGISTER_DEVICE" = 1 ]; then - case "$TOPIC_ID" in - device/main//) - # Don't register when it is the main device - ;; - *) - echo "manually registering child-device" >&2 - name=$(echo "$TOPIC_ID" | cut -d/ -f2) - body=$(printf '{"@type":"child-device","name":"%s"}' "$name") - tedge mqtt pub -r "$TOPIC_ROOT/$TOPIC_ID" "$body" - sleep 1 - ;; - esac -fi diff --git a/images/alpine-s6/docker-compose.yaml b/images/alpine-s6/docker-compose.yaml index fcc1f23..9c8528e 100644 --- a/images/alpine-s6/docker-compose.yaml +++ b/images/alpine-s6/docker-compose.yaml @@ -56,12 +56,11 @@ services: restart: always environment: - TEDGE_MQTT_CLIENT_HOST=mosquitto + - TEDGE_HTTP_CLIENT_HOST=tedge - TEDGE_C8Y_URL=${C8Y_DOMAIN:-} # # Enable/disable specific services # - # Rename when https://github.com/thin-edge/thin-edge.io/issues/2391 is resolved - - FIXME_TEDGE_HTTP_CLIENT_HOST=tedge - SERVICE_TEDGE_MAPPER_C8Y=1 # FIXME: remove once c8y-firmware-plugin has been made generic # Run c8y-firmware-plugin on the mapper as it needs access to the certificates and c8y.url @@ -96,9 +95,6 @@ services: environment: <<: *device-env TEDGE_MQTT_DEVICE_TOPIC_ID: device/main// - # FIXME: Move environment variable to dockerfile once https://github.com/thin-edge/thin-edge.io/issues/2391 is resolved - # as the bind and client host addresses will be decoupled - TEDGE_HTTP_BIND_ADDRESS: "0.0.0.0" # FIXME: Remove volume once https://github.com/thin-edge/thin-edge.io/issues/2390 is resolved volumes: From 8260181a7e80bbcf3c2ef09aa0765a01a7e48aeb Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 14 Nov 2023 21:39:57 +0100 Subject: [PATCH 3/3] remove old comments which are no longer applicable Signed-off-by: Reuben Miller --- images/child-device/connector/management/firmware.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/images/child-device/connector/management/firmware.py b/images/child-device/connector/management/firmware.py index aa83dd8..b5c0ab9 100644 --- a/images/child-device/connector/management/firmware.py +++ b/images/child-device/connector/management/firmware.py @@ -46,8 +46,6 @@ def bootstrap(config: Config, client: Client): config (Config): Connection configuration client (Client): MQTT client """ - # TODO: Currently there is no way to register the c8y_Firmware operation - # time.sleep(5) client.publish( f"te/device/{config.device_id}///cmd/firmware_update", "{}", retain=True, qos=1 )