Skip to content

Commit

Permalink
Merge pull request #56 from thin-edge/update-0.13.1
Browse files Browse the repository at this point in the history
update to thin-edge.io 0.13.1
  • Loading branch information
reubenmiller authored Nov 14, 2023
2 parents df6054b + 8260181 commit bf24044
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 52 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions demos/docker-compose/alpine-s6/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions images/alpine-s6/alpine-s6.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
35 changes: 0 additions & 35 deletions images/alpine-s6/cont-init.d/configure.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions images/alpine-s6/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions images/child-device/connector/management/firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

10 comments on commit bf24044

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 0 1 12 100 2m37.29s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
11 0 2 11 100 51.263s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 0 1 12 100 2m37.483s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
11 0 2 11 100 49.36s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 0 1 12 100 2m37.62s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
11 0 2 11 100 48.742s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 0 1 12 100 2m36.937s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
11 0 2 11 100 56.223s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 0 1 12 100 2m35.939s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
11 0 2 11 100 56.729s

Please sign in to comment.