From 4db779883be3f3ceef33ab61f11e8e490c3335b7 Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Wed, 28 May 2025 10:10:25 +0200 Subject: [PATCH 01/10] ci: use github runners --- .github/workflows/build-sdk.yml | 6 +++--- .github/workflows/build.yml | 6 +++--- .github/workflows/builder.yml | 6 +++--- .github/workflows/test.yml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-sdk.yml b/.github/workflows/build-sdk.yml index 35445a5..c48a491 100644 --- a/.github/workflows/build-sdk.yml +++ b/.github/workflows/build-sdk.yml @@ -35,13 +35,13 @@ jobs: matrix: include: - name: raspios-bookworm - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 platform: arm64 - name: ubuntu-noble - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 platform: arm64 - name: ubuntu-noble - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-22.04' }} + runner: ubuntu-22.04 platform: amd64 steps: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c66fc4f..949e4a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,13 +35,13 @@ jobs: matrix: include: - name: raspios-bookworm - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 platform: arm64 - name: ubuntu-noble - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 platform: arm64 - name: ubuntu-noble - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-22.04' }} + runner: ubuntu-22.04 platform: amd64 steps: - name: Checkout source diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 21af5a8..1a0f657 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -76,7 +76,7 @@ jobs: if: ${{ needs.builder-necessary.outputs.build == 'true' }} needs: - builder-necessary - runs-on: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runs-on: ubuntu-22.04-4core-arm64 steps: - name: Checkout the code @@ -111,9 +111,9 @@ jobs: matrix: include: - platform: amd64 - runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-22.04' }} + runner: ubuntu-22.04 - platform: arm64 - runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 steps: - name: Checkout the code diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f81847..e670e01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,13 +35,13 @@ jobs: matrix: include: - name: raspios-bookworm - runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 platform: arm64 - name: ubuntu-noble - runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + runner: ubuntu-22.04-4core-arm64 platform: arm64 - name: ubuntu-noble - runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-22.04' }} + runner: ubuntu-22.04 platform: amd64 steps: From cb90bae3579fca117572df68d7f2defe7250c761 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Date: Thu, 12 Jun 2025 12:20:13 +0200 Subject: [PATCH 02/10] fix(test_connection_mode.c): Replace sync with sem The in-house sync interface is redundant compared to POSIX's semaphores, so it is more sensible to rely on standard interfaces whenever possible. --- test/src/st-nohub/test_connection_mode.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/src/st-nohub/test_connection_mode.c b/test/src/st-nohub/test_connection_mode.c index a027dde..f3b6ed7 100644 --- a/test/src/st-nohub/test_connection_mode.c +++ b/test/src/st-nohub/test_connection_mode.c @@ -4,7 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include +#include #include #include #include @@ -15,7 +17,6 @@ #include "webclient/webclient.h" -#include "../sync.h" #include "agent_test.h" #include "hub.h" #include "path.h" @@ -31,7 +32,7 @@ #define PROCESS_EVENT_TIMEOUT 3000 struct test { - struct sync_ctxt sync_cons; + sem_t sem; char *filename; }; @@ -44,7 +45,7 @@ __wrap_connections_webclient_perform(FAR struct webclient_context *ctx) { // Sync point with test thread. If enabled, will wait for other // call to `sync_join` from the other thread. - sync_join(&g_test.sync_cons); + assert(!sem_post(&g_test.sem)); return __real_connections_webclient_perform(ctx); } @@ -83,9 +84,6 @@ test_disconnect_reconnect(void **state) .filename = t->filename, }; - // Start blocking blob work - sync_activate(&t->sync_cons, 2); - // test HTTP GET to file struct EVP_BlobRequestHttp request = { .url = TEST_HTTP_GET_URL, @@ -102,7 +100,7 @@ test_disconnect_reconnect(void **state) // Control race condition: wait for blob work to be started and before // http operation is performed. - sync_join(&t->sync_cons); + assert_int_equal(sem_wait(&t->sem), 0); // Expect processed blob to have failed expect_value(blob_cb, reason, EVP_BLOB_CALLBACK_REASON_DONE); @@ -151,7 +149,7 @@ setup(void **state) struct test *t = &g_test; int rv; - rv = sync_init(&t->sync_cons); + rv = sem_init(&t->sem, 0, 0); assert_int_equal(0, rv); agent_test_setup(); rv = systemf("mkdir -p %s", path_get(MODULE_INSTANCE_PATH_ID)); @@ -171,6 +169,9 @@ teardown(void **state) free(t->filename); + if (sem_destroy(&t->sem)) + return -1; + agent_test_exit(); return 0; } From ec85979da699bcb90abd14d6ebaea1faf2639986 Mon Sep 17 00:00:00 2001 From: tyoyabando Date: Wed, 16 Jul 2025 15:47:10 +0900 Subject: [PATCH 03/10] Add notification when stp error occurred. --- include/evp/agent.h | 5 +++++ src/libevp-agent/agent_event.c | 1 + src/libevp-agent/blob_type_evp_rpc.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/include/evp/agent.h b/include/evp/agent.h index 1e7b94b..36fc598 100644 --- a/include/evp/agent.h +++ b/include/evp/agent.h @@ -190,6 +190,11 @@ struct evp_agent_notification_blob_result { unsigned int http_status; }; +struct evp_agent_notification_stp_error { + int error; + const char *error_msg; +}; + typedef void (*evp_log_handler_t)(int lvl, const char *file, int line, const char *fmt, va_list ap); diff --git a/src/libevp-agent/agent_event.c b/src/libevp-agent/agent_event.c index 9314f54..5e94cc4 100644 --- a/src/libevp-agent/agent_event.c +++ b/src/libevp-agent/agent_event.c @@ -19,6 +19,7 @@ static const char(*const list[]) = { "mqtt/sync/err", "network/error", "start", + "stp/error", "wasm/stopped", }; /* clang-format on */ diff --git a/src/libevp-agent/blob_type_evp_rpc.c b/src/libevp-agent/blob_type_evp_rpc.c index f3ad301..4e1926d 100644 --- a/src/libevp-agent/blob_type_evp_rpc.c +++ b/src/libevp-agent/blob_type_evp_rpc.c @@ -21,6 +21,7 @@ #include "base64.h" #include "blob.h" #include "blob_type_evp.h" +#include "evp/agent.h" #include "hub.h" #include "mstp_schema.h" #include "path.h" @@ -494,6 +495,7 @@ complete_storage_token_request(EVP_RPC_ID id, void *cb_data, void *payload, struct evp_agent_context *agent = args->agent; JSON_Value *json = NULL; struct storagetoken_response resp = {0}; + struct evp_agent_notification_stp_error notification = {0}; xlog_debug( "complete_storage_token_request called for %s, delay=%" PRIu32 @@ -504,6 +506,9 @@ complete_storage_token_request(EVP_RPC_ID id, void *cb_data, void *payload, /* Error completing the request means timeout */ xlog_error("Timeout response: %d. Delay time is %" PRIu32, error, delay); + + notification.error = error; + goto end; } @@ -535,6 +540,10 @@ complete_storage_token_request(EVP_RPC_ID id, void *cb_data, void *payload, error = resp.status; xlog_error("Error from hub: %d (%s). Delay time is %" PRIu32, resp.status, resp.error, delay); + + notification.error = resp.status; + notification.error_msg = resp.error; + goto end; } @@ -552,6 +561,12 @@ complete_storage_token_request(EVP_RPC_ID id, void *cb_data, void *payload, if (error) { notify_done(wk, BLOB_RESULT_ERROR, error); } + + if (notification.error != 0) { + evp_agent_notification_publish(agent, "stp/error", + ¬ification); + } + storagetoken_response_dtor(&resp); json_value_free(json); free(args); From 736d58b7e4c3def45622bcca3bc04354e90c3494 Mon Sep 17 00:00:00 2001 From: Takara HIrakawa Date: Mon, 4 Aug 2025 12:37:23 +0900 Subject: [PATCH 04/10] Add network setting for wasm. --- src/libevp-agent/module_instance_impl_wasm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libevp-agent/module_instance_impl_wasm.c b/src/libevp-agent/module_instance_impl_wasm.c index a78e478..e91e6e9 100644 --- a/src/libevp-agent/module_instance_impl_wasm.c +++ b/src/libevp-agent/module_instance_impl_wasm.c @@ -58,6 +58,11 @@ #endif #define MAX_EXIT_TIME_IN_SECONDS 5 +#define POOL_SIZE 1 + +// Network access configuration for WASM modules. +static const char *g_addr_pool[POOL_SIZE] = {"0.0.0.0/0"}; +static const char *g_ns_lookup_pool[POOL_SIZE] = {"*"}; static void module_instance_set_status(struct module_instance *m, @@ -298,6 +303,14 @@ setup_fds(struct instance_start *s, const char **workspace, char **error) return ret; } +static void +setup_network_pools(wasm_module_t wasm_module) +{ + wasm_runtime_set_wasi_addr_pool(wasm_module, g_addr_pool, POOL_SIZE); + wasm_runtime_set_wasi_ns_lookup_pool(wasm_module, g_ns_lookup_pool, + POOL_SIZE); +} + static int instantiate(struct instance_start *s, char **error) { @@ -447,6 +460,7 @@ ensure_instance(struct instance_start *s, struct module *mi, } ret = setup_fds(s, workspace, error); + setup_network_pools(s->module); if (ret) { xlog_error("setup_fds failed with %d", ret); From 0fe54cbf9a83b2f009494fac13cd0ab5952f357c Mon Sep 17 00:00:00 2001 From: Takara HIrakawa Date: Mon, 4 Aug 2025 14:09:36 +0900 Subject: [PATCH 05/10] Change the call order. --- src/libevp-agent/module_instance_impl_wasm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libevp-agent/module_instance_impl_wasm.c b/src/libevp-agent/module_instance_impl_wasm.c index e91e6e9..e06f19e 100644 --- a/src/libevp-agent/module_instance_impl_wasm.c +++ b/src/libevp-agent/module_instance_impl_wasm.c @@ -460,13 +460,14 @@ ensure_instance(struct instance_start *s, struct module *mi, } ret = setup_fds(s, workspace, error); - setup_network_pools(s->module); if (ret) { xlog_error("setup_fds failed with %d", ret); return ret; } + setup_network_pools(s->module); + ret = instantiate(s, error); if (ret) { From 591db448a69ba40b3a2d6a75ffa00f3817dc3f0d Mon Sep 17 00:00:00 2001 From: Takara HIrakawa Date: Mon, 18 Aug 2025 02:09:03 +0000 Subject: [PATCH 06/10] Add defined. --- src/libevp-agent/module_instance_impl_wasm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libevp-agent/module_instance_impl_wasm.c b/src/libevp-agent/module_instance_impl_wasm.c index e06f19e..cd401f9 100644 --- a/src/libevp-agent/module_instance_impl_wasm.c +++ b/src/libevp-agent/module_instance_impl_wasm.c @@ -58,11 +58,13 @@ #endif #define MAX_EXIT_TIME_IN_SECONDS 5 +#if defined(CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS) #define POOL_SIZE 1 // Network access configuration for WASM modules. static const char *g_addr_pool[POOL_SIZE] = {"0.0.0.0/0"}; static const char *g_ns_lookup_pool[POOL_SIZE] = {"*"}; +#endif // CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS static void module_instance_set_status(struct module_instance *m, @@ -303,6 +305,7 @@ setup_fds(struct instance_start *s, const char **workspace, char **error) return ret; } +#if defined(CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS) static void setup_network_pools(wasm_module_t wasm_module) { @@ -310,6 +313,7 @@ setup_network_pools(wasm_module_t wasm_module) wasm_runtime_set_wasi_ns_lookup_pool(wasm_module, g_ns_lookup_pool, POOL_SIZE); } +#endif // CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS static int instantiate(struct instance_start *s, char **error) @@ -466,7 +470,9 @@ ensure_instance(struct instance_start *s, struct module *mi, return ret; } +#if defined(CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS) setup_network_pools(s->module); +#endif // CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS ret = instantiate(s, error); From 959f35152947c2e9690e3925490f38ea4a6832da Mon Sep 17 00:00:00 2001 From: Takara HIrakawa Date: Mon, 18 Aug 2025 02:13:16 +0000 Subject: [PATCH 07/10] clang-format. --- src/libevp-agent/module_instance_impl_wasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libevp-agent/module_instance_impl_wasm.c b/src/libevp-agent/module_instance_impl_wasm.c index cd401f9..a3441ed 100644 --- a/src/libevp-agent/module_instance_impl_wasm.c +++ b/src/libevp-agent/module_instance_impl_wasm.c @@ -59,7 +59,7 @@ #define MAX_EXIT_TIME_IN_SECONDS 5 #if defined(CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS) -#define POOL_SIZE 1 +#define POOL_SIZE 1 // Network access configuration for WASM modules. static const char *g_addr_pool[POOL_SIZE] = {"0.0.0.0/0"}; From cd6390190e9e7ee0a6ba72eb17e23201747745ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Sep 2025 01:27:56 +0000 Subject: [PATCH 08/10] Implement change: Default hub type from EVP1 to EVP2 in get_hub_type() Co-authored-by: Ryota-Bando <206490475+Ryota-Bando@users.noreply.github.com> --- src/libevp-agent/evp_hub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libevp-agent/evp_hub.c b/src/libevp-agent/evp_hub.c index 05dee04..5840e78 100644 --- a/src/libevp-agent/evp_hub.c +++ b/src/libevp-agent/evp_hub.c @@ -113,12 +113,12 @@ evp_hub_setup(const char *iot_platform) enum evp_hub_type get_hub_type(const char *iot_platform) { - /* Assume EVP1 TB by default, even for invalid 'iot_platform' */ - enum evp_hub_type hub_type = EVP_HUB_TYPE_EVP1_TB; + /* Assume EVP2 TB by default, even for invalid 'iot_platform' */ + enum evp_hub_type hub_type = EVP_HUB_TYPE_EVP2_TB; if (iot_platform != NULL) { - if (strcasecmp(iot_platform, HUB_TB_NAME) == 0) { - hub_type = EVP_HUB_TYPE_EVP2_TB; + if (strcasecmp(iot_platform, HUB_EVP1_NAME) == 0) { + hub_type = EVP_HUB_TYPE_EVP1_TB; } } From e7b0684ffa9feb092feda483dc5a64260c17e90f Mon Sep 17 00:00:00 2001 From: Seimizu Joukan Date: Wed, 17 Sep 2025 19:00:23 +0900 Subject: [PATCH 09/10] Add CODEOWNERS. Signed-off-by: Seimizu Joukan --- .github/CODEOWNERS | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..6260ce5 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2023-2025 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# All files +* @JSeimizu @MasayaKabuto @oka-r @ShinsukeTashiro + From c3e83969068d38988f4f8eb9e330d4b0da1a689a Mon Sep 17 00:00:00 2001 From: Seimizu Joukan Date: Wed, 17 Sep 2025 19:17:43 +0900 Subject: [PATCH 10/10] Bump version to v1.48.4 Signed-off-by: Seimizu Joukan --- scripts/rules.mk | 2 +- version.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rules.mk b/scripts/rules.mk index 2bbd51e..151ef65 100644 --- a/scripts/rules.mk +++ b/scripts/rules.mk @@ -7,7 +7,7 @@ all: # Macros related to the version of the agent -VERSION = 1.48.1 +VERSION = 1.48.4 SDK_VERSION = 1.0.0 # Default value for configuration macros diff --git a/version.mk b/version.mk index 0858b37..5fb97eb 100644 --- a/version.mk +++ b/version.mk @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -VERSION = 1.48.1 +VERSION = 1.48.4 COMMIT_HASH = $(shell git describe --always --abbrev=0 --dirty --match "NOT A TAG") define VERSION_BODY