diff --git a/CHANGELOG.md b/CHANGELOG.md index cc1a8e6..df4d5f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ # Izuma Edge 2.x.x - 2024 -- Base LmP release updated to v91. +- Base LmP release updated to v94.1. - Update `pe-utils` to version 2.3.7. - `edge-testnet` is now detecting issues more accurately & more robustly. - Update `edge-proxy` to latest version (v.1.4.0). -- UPdate `pe-terminal` to latest version (v1.2.0). +- Update `pe-terminal` to latest version (v1.2.0). +- Replace maestro with edge-resource-manager. # Izuma Edge 2.6.1 - 3rd Oct 2023 diff --git a/conf/machine/include/lmp-factory-custom.inc b/conf/machine/include/lmp-factory-custom.inc index e0d6347..2fd6cf0 100644 --- a/conf/machine/include/lmp-factory-custom.inc +++ b/conf/machine/include/lmp-factory-custom.inc @@ -2,6 +2,9 @@ # Use sdcard as root device by default OSTREE_KERNEL_ARGS:imx8mm-lpddr4-evk = "console=tty1 console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 root=/dev/mmcblk1p2 rootfstype=ext4" +# Enable legacy cgroups because our version of kubelet needs them +OSTREE_KERNEL_ARGS:append = " systemd.unified_cgroup_hierarchy=0" + # Add edge PREFERRED_RPROVIDER_kubelet = "kubelet" @@ -29,7 +32,7 @@ edge-info \ edge-testnet \ edge-terminal \ fluentbit \ -maestro \ +edge-resource-manager \ " EDGE_CONTAINER_ORCHESTRATION = " \ diff --git a/recipes-edge/edge-resource-manager/edge-resource-manager.bb b/recipes-edge/edge-resource-manager/edge-resource-manager.bb new file mode 100644 index 0000000..4cb5696 --- /dev/null +++ b/recipes-edge/edge-resource-manager/edge-resource-manager.bb @@ -0,0 +1,84 @@ +DESCRIPTION = "edge-resource-manager is a resource manager for edge devices" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" + +GO_IMPORT = "github.com/PelionIoT/edge-resource-manager" + +PROVIDES += " edge-resource-manager " +RPROVIDES:${PN} += " edge-resource-manager " + +DEPENDS = "libuv" +RDEPENDS:${PN} += "bash" + +# avoid the `-linkshared` option in this recipe as it causes a panic +GO_LINKSHARED="" + +inherit pkgconfig systemd go gitpkgv edge + +RT_SERVICE_FILE = "edge-resource-manager.service" +PR = "r0" + +SRC_URI = "git://${GO_IMPORT};protocol=https;branch=main \ +file://${RT_SERVICE_FILE} \ +file://edge-resource-manager-watcher.service \ +file://edge-resource-manager-watcher.path \ +file://edge-resource-manager-config.yaml \ +" + +INSANE_SKIP_${PN} = "textrel" + +SRCREV = "v1.0.0" +PV = "${SRCPV}" + + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE:${PN} = "edge-resource-manager.service \ +edge-resource-manager-watcher.path \ +edge-resource-manager-watcher.service" + +SYSTEMD_AUTO_ENABLE:${PN} = "enable" + +FILESEXTRAPATHS:prepend := "${THISDIR}/edge-resource-manager:" +FILES:${PN} += "\ + ${EDGE_BIN}/edge-resource-manager \ + ${EDGE_CONFIG}/edge-resource-manager-config.yaml\ + ${EDGE_LOG}\ + ${systemd_system_unitdir}/edge-resource-manager.service\ + ${systemd_system_unitdir}/edge-resource-manager-watcher.service\ + ${systemd_system_unitdir}/edge-resource-manager-watcher.path\ + " +do_compile[network] = "1" +do_compile() { + # Try not to have any read-only files in the build area (they make cleanup difficult if build fails) + ${GO} env -w GOFLAGS=-modcacherw + cd src/${GO_IMPORT} + ${GO} build -o bin/edge-resource-manager edge-resource-manager.go + #next 2 lines: workaround for permission error during yocto cleanup + cd ${B} + chmod -R u+w * + cd ${S}/../ + + edge_replace_vars ${RT_SERVICE_FILE} edge-resource-manager-watcher.path +} + +do_install:append() { + # Maestro configuration management + install -d ${D}/${EDGE_CONFIG} + install -m 0644 ${WORKDIR}/edge-resource-manager-config.yaml ${D}/${EDGE_CONFIG}/edge-resource-manager-config.yaml +} + +do_install() { + + install -d ${D}${EDGE_BIN} + install -d ${D}${systemd_system_unitdir} + install -d ${D}/${bindir} + install -d ${D}/${libdir} + install -d ${D}/${EDGE_LOG} + install -m 0755 ${S}/src/${GO_IMPORT}/bin/edge-resource-manager ${D}${EDGE_BIN}/edge-resource-manager + ln -sf /${EDGE_BIN}/edge-resource-manager ${D}/${bindir}/edge-resource-manager + + install -m 0644 ${S}/../${RT_SERVICE_FILE} ${D}${systemd_system_unitdir}/${RT_SERVICE_FILE} + install -m 0644 ${S}/../edge-resource-manager-watcher.path ${D}${systemd_system_unitdir}/edge-resource-manager-watcher.path + install -m 0644 ${S}/../edge-resource-manager-watcher.service ${D}${systemd_system_unitdir}/edge-resource-manager-watcher.service + +} diff --git a/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-config.yaml b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-config.yaml new file mode 100644 index 0000000..c666c8a --- /dev/null +++ b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-config.yaml @@ -0,0 +1,14 @@ +edge_capabilities: + edge_core_socketpath: "/tmp/edge.sock" + lwm2m_objectid: 33457 + edge_resources: + - name: "urn:fid:pelion.com:log:1.0.0" + enable: true + config_filepath: "/etc/td-agent-bit/td-agent-bit.conf" + - name: "urn:fid:pelion.com:terminal:1.0.0" + enable: true + config_filepath: "/edge/system/etc/edge-terminal/config.json" + - name: "urn:fid:pelion.com:kaas:1.0.0" + enable: true + config_filepath: "/edge/system/var/lib/kubelet/kubeconfig" +config_end: true diff --git a/recipes-edge/maestro/maestro/maestro-watcher.path b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-watcher.path similarity index 71% rename from recipes-edge/maestro/maestro/maestro-watcher.path rename to recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-watcher.path index c8ac011..4d3e43e 100644 --- a/recipes-edge/maestro/maestro/maestro-watcher.path +++ b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-watcher.path @@ -1,9 +1,9 @@ [Unit] -Description=Monitor the changes to identity.json file and restart maestro +Description=Monitor the changes to identity.json file and restart edge-resource-manager [Path] PathChanged=EDGE_DATA/edge_gw_config/identity.json -Unit=maestro-watcher.service +Unit=edge-resource-manager-watcher.service [Install] WantedBy=multi-user.target diff --git a/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-watcher.service b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-watcher.service new file mode 100644 index 0000000..de9c436 --- /dev/null +++ b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager-watcher.service @@ -0,0 +1,10 @@ +[Unit] +Description=edge-resource-manager restarter + +[Service] +Type=oneshot +ExecStart=/bin/systemctl restart edge-resource-manager.service + +[Install] +WantedBy=multi-user.target + diff --git a/recipes-edge/maestro/maestro/maestro.service b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager.service similarity index 58% rename from recipes-edge/maestro/maestro/maestro.service rename to recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager.service index 3241a24..c2accf8 100644 --- a/recipes-edge/maestro/maestro/maestro.service +++ b/recipes-edge/edge-resource-manager/edge-resource-manager/edge-resource-manager.service @@ -1,5 +1,5 @@ [Unit] -Description=Maestro: Network, Config, DeviceJS manager +Description=edge-resource-manager: Config manager Wants=edge-proxy.service After=edge-proxy.service @@ -8,7 +8,7 @@ Restart=always RestartSec=5s ExecCondition=sh -c '[ -f EDGE_DATA/edge_gw_config/identity.json ]' ExecStartPre=mkdir -p EDGE_DATA/etc/ -ExecStart=env GODEBUG=madvdontneed=1 EDGE_BIN/maestro -config EDGE_CONFIG/maestro-config.yaml +ExecStart=env GODEBUG=madvdontneed=1 EDGE_BIN/edge-resource-manager -config EDGE_CONFIG/edge-resource-manager-config.yaml [Install] RequiredBy=multi-user.target diff --git a/recipes-edge/maestro/maestro.bb b/recipes-edge/maestro/maestro.bb deleted file mode 100644 index 52ed519..0000000 --- a/recipes-edge/maestro/maestro.bb +++ /dev/null @@ -1,82 +0,0 @@ -DESCRIPTION = "maestro is a runtime / container manager for deviceOS" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" - -GO_IMPORT = "github.com/PelionIoT/maestro" - -PROVIDES += " maestro " -RPROVIDES:${PN} += " maestro " - -DEPENDS = "libuv" -RDEPENDS:${PN} += "bash" - -# avoid the `-linkshared` option in this recipe as it causes a panic -GO_LINKSHARED="" - -inherit pkgconfig systemd go gitpkgv edge - -RT_SERVICE_FILE = "maestro.service" -PR = "r0" - -SRC_URI = "git://${GO_IMPORT};protocol=https;branch=master \ -file://${RT_SERVICE_FILE} \ -file://maestro-watcher.service \ -file://maestro-watcher.path \ -file://maestro-config.yaml \ -" - -SRCREV = "v3.0.0" -PV = "${SRCPV}" - - -SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE:${PN} = "maestro.service \ -maestro-watcher.path \ -maestro-watcher.service" - -SYSTEMD_AUTO_ENABLE:${PN} = "enable" - -FILESEXTRAPATHS:prepend := "${THISDIR}/maestro:" -FILES:${PN} += "\ - ${EDGE_BIN}/maestro \ - ${EDGE_CONFIG}/maestro-config.yaml\ - ${EDGE_LOG}\ - ${systemd_system_unitdir}/maestro.service\ - ${systemd_system_unitdir}/maestro-watcher.service\ - ${systemd_system_unitdir}/maestro-watcher.path\ - " -do_compile[network] = "1" -do_compile() { - # Try not to have any read-only files in the build area (they make cleanup difficult if build fails) - ${GO} env -w GOFLAGS=-modcacherw - cd src/${GO_IMPORT} - ${GO} build -o bin/maestro maestro/main.go - #next 2 lines: workaround for permission error during yocto cleanup - cd ${B} - chmod -R u+w * - cd ${S}/../ - - edge_replace_vars ${RT_SERVICE_FILE} maestro-watcher.path -} - -do_install:append() { - # Maestro configuration management - install -d ${D}/${EDGE_CONFIG} - install -m 0644 ${WORKDIR}/maestro-config.yaml ${D}/${EDGE_CONFIG}/maestro-config.yaml -} - -do_install() { - - install -d ${D}${EDGE_BIN} - install -d ${D}${systemd_system_unitdir} - install -d ${D}/${bindir} - install -d ${D}/${libdir} - install -d ${D}/${EDGE_LOG} - install -m 0755 ${S}/src/${GO_IMPORT}/bin/maestro ${D}${EDGE_BIN}/maestro - ln -sf /${EDGE_BIN}/maestro ${D}/${bindir}/maestro - - install -m 0644 ${S}/../${RT_SERVICE_FILE} ${D}${systemd_system_unitdir}/${RT_SERVICE_FILE} - install -m 0644 ${S}/../maestro-watcher.path ${D}${systemd_system_unitdir}/maestro-watcher.path - install -m 0644 ${S}/../maestro-watcher.service ${D}${systemd_system_unitdir}/maestro-watcher.service - -} diff --git a/recipes-edge/maestro/maestro/maestro-config.yaml b/recipes-edge/maestro/maestro/maestro-config.yaml deleted file mode 100644 index 2b15077..0000000 --- a/recipes-edge/maestro/maestro/maestro-config.yaml +++ /dev/null @@ -1,79 +0,0 @@ -unixLogSocket: /tmp/grease.socket -sysLogSocket: /dev/log -linuxKernelLog: true -httpUnixSocket: /tmp/maestroapi.sock -configDBPath: /userdata/etc/maestroConfig.db -clientId: "{{ARCH_SERIAL_NUMBER}}" -network: - disable: true -platform_readers: - - platform: "fsonly" - params: - identityPath: "/userdata/edge_gw_config/identity.json" -gateway_capabilities: - edge_core_socketpath: "/tmp/edge.sock" - lwm2m_objectid: 33457 - gateway_resources: - - name: "urn:fid:pelion.com:log:1.0.0" - enable: true - config_filepath: "/etc/td-agent-bit/td-agent-bit.conf" - - name: "urn:fid:pelion.com:terminal:1.0.0" - enable: true - config_filepath: "{{EDGE_ETC}}/edge-terminal/config.json" - - name: "urn:fid:pelion.com:kaas:1.0.0" - enable: true - config_filepath: "/edge/system/var/lib/kubelet/kubeconfig" -var_defs: - - key: "TMP_DIR" - value: "/tmp" - - key: "FOG_PROXY_ADDR" - value: "gateways.local:8080" - - key: "EDGE_ETC" - value: "/edge/system/etc" -mdns: - static_records: - - name: "WigWagRelay" - service: "_wwservices._tcp" # normally something like https or ftp - interfaces: "eth0" - not_interfaces: "Witap0" - port: 3131 - text: - - "wwid={{ARCH_SERIAL_NUMBER}}" - hostname: "wigwaggateway" - - name: "WigWagRelay_{{ARCH_SERIAL_NUMBER}}" - service: "_wwservices._tcp" # normally something like https or ftp - interfaces: "eth0" - not_interfaces: "Witap0" - port: 3131 - text: - - "wwid={{ARCH_SERIAL_NUMBER}}" - hostname: "{{ARCH_SERIAL_NUMBER}}" -symphony: # symphony system management APIs - disable_sys_stats: true - sys_stats_count_threshold: 15 # send if you have 15 or more stats queued - sys_stats_time_threshold: 120000 # every 120 seconds send stuff, no matter what - no_tls: true - host: "gateways.local" - url_logs: "http://{{FOG_PROXY_ADDR}}/relay-logs/logs" - url_stats: "http://{{FOG_PROXY_ADDR}}/relay-stats/stats_obj" - send_time_threshold: 120000 # set the send time threshold to 2 minutes -targets: - - file: "/tmp/log/maestro_gw.log" - rotate: - max_files: 4 - max_file_size: 10000000 # 10MB max file size - max_total_size: 42000000 - rotate_on_start: true - delim: "\n" - format_time: "[%ld:%d] " - format_level: "<%s> " - format_tag: "{%s} " - format_origin: "(%s) " - filters: - - levels: warn - format_pre: "\u001B[33m" # yellow - format_post: "\u001B[39m" - - levels: error - format_pre: "\u001B[31m" # red - format_post: "\u001B[39m" -config_end: true diff --git a/recipes-edge/maestro/maestro/maestro-runtime b/recipes-edge/maestro/maestro/maestro-runtime deleted file mode 100644 index 9650f6f..0000000 --- a/recipes-edge/maestro/maestro/maestro-runtime +++ /dev/null @@ -1,8 +0,0 @@ -/tmp/log/maestro-runtime.log { - rotate 10 - size 4M - nodateext - copytruncate - missingok -} - diff --git a/recipes-edge/maestro/maestro/maestro-watcher.service b/recipes-edge/maestro/maestro/maestro-watcher.service deleted file mode 100644 index 9a4da8c..0000000 --- a/recipes-edge/maestro/maestro/maestro-watcher.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Maestro restarter - -[Service] -Type=oneshot -ExecStart=/bin/systemctl restart maestro.service - -[Install] -WantedBy=multi-user.target -