Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI failures #394

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
84b11ad
add support for qos settings in sample
DenisBiryukov91 Feb 15, 2024
d356881
- silence cpp compiler regading compound literals and type conversions,
DenisBiryukov91 Feb 15, 2024
cb554fd
fix _z_qos_t definition and doc
DenisBiryukov91 Feb 16, 2024
f0545eb
fix z_qos_t definition and doc
DenisBiryukov91 Feb 16, 2024
6e10617
- replace binary literals (non-core C) with hexadecimal ones
DenisBiryukov91 Feb 16, 2024
29fca01
make _z_n_qos_unmake static inline to prevent linking errors
DenisBiryukov91 Feb 16, 2024
bb65bc8
fix format
DenisBiryukov91 Feb 16, 2024
39cfc82
reduce qos size to 1 byte; use getters to extract individual qos sett…
DenisBiryukov91 Feb 20, 2024
245aade
fix _z_n_qos_make to no longer use compund literals to avoid warnings…
DenisBiryukov91 Feb 20, 2024
790bd62
fix z_qos_default() signature
DenisBiryukov91 Feb 20, 2024
3bab290
Add Flipper platform (#351)
sashacmc Feb 22, 2024
2ac04a2
Merge pull request #348 from DenisBiryukov91/feature/priority-in-sample
milyin Feb 23, 2024
b5c702b
move z_n_qos_t related functions into .c (to hide designated initiali…
DenisBiryukov91 Feb 24, 2024
8e37ab8
z_sample_t docs update to include qos
DenisBiryukov91 Feb 24, 2024
cac8b3d
move qos functions back to header and remove usage of designated init…
DenisBiryukov91 Feb 24, 2024
54c291e
format
DenisBiryukov91 Feb 24, 2024
a657a1d
Merge pull request #354 from DenisBiryukov91/fix/remove-qos-designate…
milyin Feb 26, 2024
e3707c1
fix: Bump sphinx doc build dep to `7.2.6` (#361)
fuzzypixelz Mar 4, 2024
a16d84c
replac zp_ prefix for platform functions that are also available in z…
DenisBiryukov91 Mar 4, 2024
5216d7a
fix format
DenisBiryukov91 Mar 4, 2024
b21b11d
replace zp_ prefix with z_ for zp_random_u64
DenisBiryukov91 Mar 4, 2024
1f45c9d
put back previously removed zp_ functions as deprecated
DenisBiryukov91 Mar 4, 2024
c51ffe2
added missing new line at the end of the file
DenisBiryukov91 Mar 5, 2024
d9ed7eb
typo fix
DenisBiryukov91 Mar 5, 2024
1c3bfa0
move deprecated platform header to a separate folder
DenisBiryukov91 Mar 5, 2024
9c2cf4c
Merge pull request #365 from DenisBiryukov91/feature/platform-api-syn…
milyin Mar 5, 2024
95506c9
Add config endpoint in raweth locator (#364)
jean-roland Mar 14, 2024
9f7925b
Fix bug reading from ws (#370)
OlivierHecart Mar 15, 2024
0d9f25b
Expose timeout option in z_get_options_t (#375)
sashacmc Mar 21, 2024
7c724c3
Align examples and remove reading from stdin (#359)
oteffahi Mar 21, 2024
2f44c57
fix: remove unused variable warning (#379)
jean-roland Mar 21, 2024
4432e1c
Changing references to zenoh:master to zenoh:main. (#381)
gmartin82 Mar 23, 2024
2e813e7
correct unsigned atomic in refcount.h (#382)
vortex314 Mar 23, 2024
3e42741
Fix refcount cast (#384)
Mallets Mar 25, 2024
22bf428
Fix esp32 CI (#386)
jean-roland Mar 26, 2024
8e01007
Serial timeout (#383)
vortex314 Mar 27, 2024
ecb919a
Run clang-format (#388)
Mallets Mar 27, 2024
27b9189
Fix misra violations (#390)
jean-roland Mar 27, 2024
3511b3d
ci: Allow building zenoh from arbitrary branch in build-check workflo…
fuzzypixelz Mar 28, 2024
24877da
Merge branch 'main' into protocol_changes
jean-roland Apr 2, 2024
4d5177e
build: point ci to zenoh protocol_changes branch
jean-roland Apr 2, 2024
8101af7
fix: check declare <I> flag at declare level
jean-roland Apr 2, 2024
31e28a4
fix: missing function prototype warning
jean-roland Apr 2, 2024
2269b96
build: switch zenoh branch to interests
jean-roland Apr 2, 2024
2f495ad
fix: ignore unknown final interest
jean-roland Apr 2, 2024
83310d7
fix: missing argument in tigger_local_subs
jean-roland Apr 2, 2024
ade5a2b
fix: add wait join step in z_pub for raweth testing
jean-roland Apr 3, 2024
22d35de
fix: raweth memory leaks
jean-roland Apr 3, 2024
f46217b
feat: add message number option to z_sub
jean-roland Apr 3, 2024
d55a0d1
fix: null malloc when cloning rc list
jean-roland Apr 3, 2024
fc49c87
doc: remove obsolete types
jean-roland Apr 3, 2024
90082b4
fix: encoding option made fragment test fail
jean-roland Apr 3, 2024
6542757
fix: replace all deprecated system calls
jean-roland Apr 5, 2024
3baef3e
fix: improve raweth test stability
jean-roland Apr 5, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/arduino_esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:

mkdir -p $ARDUINO_BASE
cd $ARDUINO_BASE
platformio init -b esp32thing_plus --project-option="build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3 -DZENOH_COMPILER_GCC"
platformio init -b esp32thing_plus -O "build_flags=-DZ_FEATURE_LINK_BLUETOOTH=1 -DZENOH_DEBUG=3 -DZENOH_COMPILER_GCC" -O "lib_ldf_mode=deep+"

cd $ARDUINO_BASE/lib
ln -s $ZENOH_PICO_BASE
Expand Down
83 changes: 65 additions & 18 deletions .github/workflows/build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,25 @@ jobs:
sudo apt install -y ninja-build
FORCE_C99=ON CMAKE_GENERATOR=Ninja make

zenoh_build:
name: Build Zenoh from source
runs-on: ubuntu-latest
outputs:
artifact-name: ${{ steps.main.outputs.artifact-name }}
steps:
- id: main
name: Build Zenoh
uses: eclipse-zenoh/ci/build-crates-standalone@main
with:
repo: eclipse-zenoh/zenoh
branch: interests
artifact-patterns: |
^zenohd$
^libzenoh_plugin_rest.so$
^libzenoh_plugin_storage_manager.so$

modular_build:
needs: zenoh_build
name: Modular build on ubuntu-latest
runs-on: ubuntu-latest
strategy:
Expand All @@ -67,8 +85,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Run docker image
run: docker run --name zenoh_router --init --net host -d eclipse/zenoh:latest
- name: Download Zenoh artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.zenoh_build.outputs.artifact-name }}

- name: Unzip Zenoh artifacts
run: unzip ${{ needs.zenoh_build.outputs.artifact-name }} -d zenoh-standalone

- id: run-zenoh
name: Run Zenoh router
run: |
RUST_LOG=debug ./zenoh-standalone/zenohd &
echo "zenohd-pid=$!" >> $GITHUB_OUTPUT

- name: Build project
run: |
Expand All @@ -82,11 +111,9 @@ jobs:
Z_FEATURE_QUERYABLE: ${{ matrix.feature_queryable }}
Z_FEATURE_QUERY: ${{ matrix.feature_query }}

- name: Stop docker image
- name: Kill Zenoh router
if: always()
run: |
docker stop zenoh_router
docker rm zenoh_router
run: kill ${{ steps.run-zenoh.outputs.zenohd-pid }}

raweth_build:
name: Build and test raweth transport on ubuntu-latest
Expand All @@ -108,14 +135,26 @@ jobs:
Z_FEATURE_RAWETH_TRANSPORT: ${{ matrix.feature_reth }}

st_build:
needs: zenoh_build
name: Build and test in single thread on ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run docker image
run: docker run --name zenoh_router --init --net host -d eclipse/zenoh:latest
- name: Download Zenoh artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.zenoh_build.outputs.artifact-name }}

- name: Unzip Zenoh artifacts
run: unzip ${{ needs.zenoh_build.outputs.artifact-name }} -d zenoh-standalone

- id: run-zenoh
name: Run Zenoh router
run: |
RUST_LOG=debug ./zenoh-standalone/zenohd &
echo "zenohd-pid=$!" >> $GITHUB_OUTPUT

- name: Build project and run test
run: |
Expand All @@ -126,21 +165,31 @@ jobs:
env:
Z_FEATURE_MULTI_THREAD: 0

- name: Stop docker image
- name: Kill Zenoh router
if: always()
run: |
docker stop zenoh_router
docker rm zenoh_router
run: kill ${{ steps.run-zenoh.outputs.zenohd-pid }}

fragment_test:
needs: zenoh_build
name: Test multicast and unicast fragmentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run docker image
run: docker run --name zenoh_router --init --net host -d eclipse/zenoh:latest
- name: Download Zenoh artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.zenoh_build.outputs.artifact-name }}

- name: Unzip Zenoh artifacts
run: unzip ${{ needs.zenoh_build.outputs.artifact-name }} -d zenoh-standalone

- id: run-zenoh
name: Run Zenoh router
run: |
RUST_LOG=debug ./zenoh-standalone/zenohd &
echo "zenohd-pid=$!" >> $GITHUB_OUTPUT

- name: Build project and run test
run: |
Expand All @@ -150,8 +199,6 @@ jobs:
python3 ./build/tests/fragment.py
timeout-minutes: 5

- name: Stop docker image
- name: Kill Zenoh router
if: always()
run: |
docker stop zenoh_router
docker rm zenoh_router
run: kill ${{ steps.run-zenoh.outputs.zenohd-pid }}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ target_include_directories(${Libname} PUBLIC ${PROJECT_SOURCE_DIR}/include)
file(GLOB_RECURSE Sources
"src/api/*.c"
"src/collections/*.c"
"src/deprecated/*.c"
"src/link/*.c"
"src/net/*.c"
"src/protocol/*.c"
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Z_FEATURE_SUBSCRIPTION?=1
Z_FEATURE_QUERY?=1
Z_FEATURE_QUERYABLE?=1
Z_FEATURE_ATTACHMENT?=1
Z_FEATURE_INTEREST?=0
Z_FEATURE_INTEREST?=1
Z_FEATURE_RAWETH_TRANSPORT?=0

# zenoh-pico/ directory
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ The simplest way to run some of the example is to get a Docker image of the **ze
### 3.1. Starting the Zenoh Router
Assuming you've pulled the Docker image of the **zenoh** router on a Linux host (to leverage UDP multicast scouting as explained [here](https://zenoh.io/docs/getting-started/quick-test/#run-zenoh-router-in-a-docker-container), then simply do:
```bash
$ docker run --init --net host eclipse/zenoh:master
$ docker run --init --net host eclipse/zenoh:main
```

To see the zenoh manual page, simply do:
```bash
$ docker run --init --net host eclipse/zenoh:master --help
$ docker run --init --net host eclipse/zenoh:main --help
```

:warning: **Please notice that the `--net host` option in Docker is restricted to Linux only.**
:warning: **Please notice that the `--net host` option in Docker is restricted to Linux only.**
The cause is that Docker doesn't support UDP multicast between a container and its host (see cases [moby/moby#23659](https://github.com/moby/moby/issues/23659), [moby/libnetwork#2397](https://github.com/moby/libnetwork/issues/2397) or [moby/libnetwork#552](https://github.com/moby/libnetwork/issues/552)). The only known way to make it work is to use the `--net host` option that is [only supported on Linux hosts](https://docs.docker.com/network/host/).

### 3.2. Basic Pub/Sub Example
Expand Down Expand Up @@ -385,7 +385,7 @@ where `lo0` is the network interface you want to use for multicast communication
### 3.4. Basic Pub/Sub Example - Mixing Client and P2P communication
To allow Zenoh-Pico unicast clients to talk to Zenoh-Pico multicast peers, as well as with any other Zenoh client/peer, you need to start a Zenoh Router that listens on both multicast and unicast:
```bash
$ docker run --init --net host eclipse/zenoh:master -l udp/224.0.0.123:7447#iface=lo0 -l tcp/127.0.0.1:7447
$ docker run --init --net host eclipse/zenoh:main -l udp/224.0.0.123:7447#iface=lo0 -l tcp/127.0.0.1:7447
```

Assuming that (1) you are running the **zenoh** router as indicated above, and (2) you are under the build directory, do:
Expand Down
11 changes: 0 additions & 11 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Enums
.. autocenum:: constants.h::z_reply_tag_t
.. autocenum:: constants.h::z_congestion_control_t
.. autocenum:: constants.h::z_priority_t
.. autocenum:: constants.h::z_submode_t
.. autocenum:: constants.h::z_query_target_t

Data Structures
Expand All @@ -45,13 +44,11 @@ Data Structures
.. autoctype:: types.h::z_config_t
.. autoctype:: types.h::z_session_t
.. autoctype:: types.h::z_subscriber_t
.. autoctype:: types.h::z_pull_subscriber_t
.. autoctype:: types.h::z_publisher_t
.. autoctype:: types.h::z_queryable_t
.. autoctype:: types.h::z_encoding_t
.. autoctype:: types.h::z_value_t
.. autoctype:: types.h::z_subscriber_options_t
.. autoctype:: types.h::z_pull_subscriber_options_t
.. autoctype:: types.h::z_query_consolidation_t
.. autoctype:: types.h::z_publisher_options_t
.. autoctype:: types.h::z_queryable_options_t
Expand Down Expand Up @@ -118,10 +115,6 @@ To check if ``val`` is still valid, you may use ``z_X_check(&val)`` or ``z_check

A zenoh-allocated :c:type:`z_subscriber_t`.

.. c:type:: z_owned_pull_subscriber_t

A zenoh-allocated :c:type:`z_pull_subscriber_t`.

.. c:type:: z_owned_publisher_t

A zenoh-allocated :c:type:`z_publisher_t`.
Expand Down Expand Up @@ -239,10 +232,6 @@ Primitives
.. autocfunction:: primitives.h::z_subscriber_options_default
.. autocfunction:: primitives.h::z_declare_subscriber
.. autocfunction:: primitives.h::z_undeclare_subscriber
.. autocfunction:: primitives.h::z_pull_subscriber_options_default
.. autocfunction:: primitives.h::z_declare_pull_subscriber
.. autocfunction:: primitives.h::z_undeclare_pull_subscriber
.. autocfunction:: primitives.h::z_subscriber_pull
.. autocfunction:: primitives.h::z_queryable_options_default
.. autocfunction:: primitives.h::z_declare_queryable
.. autocfunction:: primitives.h::z_undeclare_queryable
Expand Down
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sphinx==4.5.0
sphinx_c_autodoc
sphinx_rtd_theme
clang==14
sphinx==7.2.6
sphinx_c_autodoc==1.3.0
sphinx_rtd_theme==2.0.0
clang==14.0
3 changes: 1 addition & 2 deletions examples/arduino/z_pub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void setup() {
}

void loop() {
delay(1000);
char buf[256];
sprintf(buf, "[%4d] %s", idx++, VALUE);
Serial.print("Writing Data ('");
Expand All @@ -105,8 +106,6 @@ void loop() {
if (z_publisher_put(z_publisher_loan(&pub), (const uint8_t *)buf, strlen(buf), NULL) < 0) {
Serial.println("Error while publishing data");
}

delay(1000);
}
#else
void setup() {
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_queryable.ino
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void setup() {
delay(300);
}

void loop() { delay(5000); }
void loop() { delay(1000); }

#else
void setup() {
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/z_sub.ino
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void setup() {
delay(300);
}

void loop() { delay(5000); }
void loop() { delay(1000); }

#else
void setup() {
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void app_main() {
printf("Zenoh setup finished!\n");

while (1) {
sleep(5);
sleep(1);
Mallets marked this conversation as resolved.
Show resolved Hide resolved
}

printf("Closing Zenoh Session...");
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void app_main() {
printf("OK!\n");

while (1) {
sleep(5);
sleep(1);
}

printf("Closing Zenoh Session...");
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void app_main(void) {
}

while (1) {
zp_sleep_s(5);
z_sleep_s(5);
printf("Sending Query '%s'...\n", KEYEXPR);
z_get_options_t opts = z_get_options_default();
if (strcmp(VALUE, "") != 0) {
Expand Down
6 changes: 3 additions & 3 deletions examples/freertos_plus_tcp/z_pub.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void app_main(void) {
static StackType_t read_task_stack[1000];
static StaticTask_t read_task_buffer;

zp_task_attr_t read_task_attr = {
z_task_attr_t read_task_attr = {
.name = "ZenohReadTask",
.priority = 10,
.stack_depth = 1000,
Expand All @@ -62,7 +62,7 @@ void app_main(void) {
static StackType_t lease_task_stack[1000];
static StaticTask_t lease_task_buffer;

zp_task_attr_t lease_task_attr = {
z_task_attr_t lease_task_attr = {
.name = "ZenohLeaseTask",
.priority = 10,
.stack_depth = 1000,
Expand All @@ -89,7 +89,7 @@ void app_main(void) {

char *buf = (char *)pvPortMalloc(256);
for (int idx = 0; 1; ++idx) {
zp_sleep_s(1);
z_sleep_s(1);
snprintf(buf, 256, "[%4d] %s", idx, VALUE);
printf("Putting Data ('%s': '%s')...\n", KEYEXPR, buf);

Expand Down
9 changes: 5 additions & 4 deletions examples/freertos_plus_tcp/z_pub_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#define KEYEXPR "demo/example/zenoh-pico-pub"
#define VALUE "[FreeRTOS-Plus-TCP] Pub from Zenoh-Pico!"
#define N 2147483647 // max int value by default
Copy link
Member

Choose a reason for hiding this comment

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

It's safer to use int n = ~0; in such a way we always have the guarantee n is max(int) regardless the actual size of int.

Copy link
Contributor Author

@jean-roland jean-roland Apr 5, 2024

Choose a reason for hiding this comment

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

With a signed integer ~0 will be interpreted as -1. As this is also an example thing, I suggest we fix this with the z_sleep later.

Copy link
Member

Choose a reason for hiding this comment

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

You are right. Technically it should be an unsigned int and not an int.


void app_main(void) {
z_owned_config_t config = z_config_default();
Expand All @@ -53,15 +54,15 @@ void app_main(void) {
}

char *buf = (char *)pvPortMalloc(256);
zp_clock_t now = zp_clock_now();
for (int idx = 0; 1;) {
if (zp_clock_elapsed_ms(&now) > 1000) {
z_clock_t now = z_clock_now();
for (int idx = 0; idx < N;) {
if (z_clock_elapsed_ms(&now) > 1000) {
snprintf(buf, 256, "[%4d] %s", idx, VALUE);
printf("Putting Data ('%s': '%s')...\n", KEYEXPR, buf);
z_publisher_put(z_loan(pub), (const uint8_t *)buf, strlen(buf), NULL);
++idx;

now = zp_clock_now();
now = z_clock_now();
}

zp_read(z_loan(s), NULL);
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void app_main(void) {
// }

// while (1) {
// zp_sleep_s(5);
// z_sleep_s(5);
// printf("Pulling data from '%s'...\n", KEYEXPR);
// z_subscriber_pull(z_loan(sub));
// }
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_put.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void app_main(void) {
}

while (1) {
zp_sleep_s(1);
z_sleep_s(1);
}

// Clean up
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void app_main(void) {
}

while (1) {
zp_sleep_s(5);
z_sleep_s(1);
}

z_undeclare_queryable(z_move(qable));
Expand Down
2 changes: 1 addition & 1 deletion examples/freertos_plus_tcp/z_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void app_main(void) {
}

while (1) {
zp_sleep_s(5);
z_sleep_s(1);
}

z_undeclare_subscriber(z_move(sub));
Expand Down
Loading
Loading