Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions .github/workflows/build-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions include/evp/agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion scripts/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/libevp-agent/agent_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static const char(*const list[]) = {
"mqtt/sync/err",
"network/error",
"start",
"stp/error",
"wasm/stopped",
};
/* clang-format on */
Expand Down
15 changes: 15 additions & 0 deletions src/libevp-agent/blob_type_evp_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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",
&notification);
}

storagetoken_response_dtor(&resp);
json_value_free(json);
free(args);
Expand Down
8 changes: 4 additions & 4 deletions src/libevp-agent/evp_hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
21 changes: 21 additions & 0 deletions src/libevp-agent/module_instance_impl_wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +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,
Expand Down Expand Up @@ -298,6 +305,16 @@ 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)
{
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);
}
#endif // CONFIG_EVP_MODULE_IMPL_WASM_ENABLE_DNS_ACCESS

static int
instantiate(struct instance_start *s, char **error)
{
Expand Down Expand Up @@ -453,6 +470,10 @@ 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);

if (ret) {
Expand Down
17 changes: 9 additions & 8 deletions test/src/st-nohub/test_connection_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <assert.h>
#include <errno.h>
#include <semaphore.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Expand All @@ -15,7 +17,6 @@

#include "webclient/webclient.h"

#include "../sync.h"
#include "agent_test.h"
#include "hub.h"
#include "path.h"
Expand All @@ -31,7 +32,7 @@
#define PROCESS_EVENT_TIMEOUT 3000

struct test {
struct sync_ctxt sync_cons;
sem_t sem;
char *filename;
};

Expand All @@ -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);
}

Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand Down Expand Up @@ -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));
Expand All @@ -171,6 +169,9 @@ teardown(void **state)

free(t->filename);

if (sem_destroy(&t->sem))
return -1;

agent_test_exit();
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading