Skip to content

Commit

Permalink
- working on the CI
Browse files Browse the repository at this point in the history
- by-the-way improve tests
  • Loading branch information
yellowhatter committed Sep 26, 2023
1 parent da58de4 commit 73824ba
Show file tree
Hide file tree
Showing 13 changed files with 300 additions and 82 deletions.
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributing to Eclipse zenoh

Thanks for your interest in this project.

## Project description

Eclipse zenoh provides is a stack designed to
1. minimize network overhead,
2. support extremely constrained devices,
3. supports devices with low duty-cycle by allowing the negotiation of data exchange modes and schedules,
4. provide a rich set of abstraction for distributing, querying and storing data along the entire system, and
5. provide extremely low latency and high throughput.

* https://projects.eclipse.org/projects/iot.zenoh

## Developer resources

Information regarding source code management, builds, coding standards, and
more.

* https://projects.eclipse.org/projects/iot.zenoh/developer

The project maintains the following source code repositories

* https://github.com/eclipse-zenoh

## Eclipse Contributor Agreement

Before your contribution can be accepted by the project team contributors must
electronically sign the Eclipse Contributor Agreement (ECA).

* http://www.eclipse.org/legal/ECA.php

Commits that are provided by non-committers must have a Signed-off-by field in
the footer indicating that the author is aware of the terms by which the
contribution has been provided to the project. The non-committer must
additionally have an Eclipse Foundation account and must have a signed Eclipse
Contributor Agreement (ECA) on file.

For more information, please see the Eclipse Committer Handbook:
https://www.eclipse.org/projects/handbook/#resources-commit

## Contact

Contact the project developers via the project's "dev" list.

* https://accounts.eclipse.org/mailing-list/zenoh-dev

Or via the Gitter channel.

* https://gitter.im/atolab/zenoh
7 changes: 7 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributors to Eclipse zenoh-plugin-ros1

These are the contributors to Eclipse zenoh (the initial contributors and the contributors listed in the Git log).


| GitHub username | Name |
| --------------- | -----------------------------|
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ categories = ["network-programming"]
[workspace.dependencies]
atoi = "2.0.0"
async-std = "=1.12.0"
async-trait = "0.1"
clap = "3.2.23"
ctrlc = "3.2.5"
env_logger = "0.9.1"
Expand Down
18 changes: 18 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[target.x86_64-unknown-linux-musl]
image = "jenoch/rust-cross:x86_64-unknown-linux-musl"

[target.arm-unknown-linux-gnueabi]
image = "jenoch/rust-cross:arm-unknown-linux-gnueabi"

[target.arm-unknown-linux-gnueabihf]
image = "jenoch/rust-cross:arm-unknown-linux-gnueabihf"

[target.armv7-unknown-linux-gnueabihf]
image = "jenoch/rust-cross:armv7-unknown-linux-gnueabihf"

[target.aarch64-unknown-linux-gnu]
image = "jenoch/rust-cross:aarch64-unknown-linux-gnu"

[target.aarch64-unknown-linux-musl]
image = "jenoch/rust-cross:aarch64-unknown-linux-musl"

55 changes: 55 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# Copyright (c) 2022 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <[email protected]>
#


###
### Build part
###
FROM rust:slim-buster as builder

WORKDIR /usr/src/zenoh-plugin-ros1

# List of installed tools:
# * for zenoh-plugin-ros1
# - git
# - clang
RUN apt-get update && apt-get -y install git clang build-essential

COPY . .
# if exists, copy .git directory to be used by git-version crate to determine the version
COPY .gi? .git/

RUN cargo install --locked --path zenoh-bridge-ros1


###
### Run part
###
FROM debian:buster-slim

COPY --from=builder /usr/local/cargo/bin/zenoh-bridge-ros1 /usr/local/bin/zenoh-bridge-ros1
RUN ldconfig -v

RUN echo '#!/bin/bash' > /entrypoint.sh
RUN echo 'echo " * Starting: zenoh-bridge-ros1 $*"' >> /entrypoint.sh
RUN echo 'exec zenoh-bridge-ros1 $*' >> /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 7446/udp
EXPOSE 7447/tcp
EXPOSE 8000/tcp

ENV RUST_LOG info

ENTRYPOINT ["/entrypoint.sh"]
41 changes: 41 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Notices for Eclipse zenoh-plugin-ros1

This content is produced and maintained by the Eclipse zenoh project.

* Project home: https://projects.eclipse.org/projects/iot.zenoh

## Trademarks

Eclipse zenoh is trademark of the Eclipse Foundation.
Eclipse, and the Eclipse Logo are registered trademarks of the Eclipse Foundation.

## Copyright

All content is the property of the respective authors or their employers.
For more information regarding authorship of content, please consult the
listed source code repository logs.

## Declared Project Licenses

This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
which is available at https://www.apache.org/licenses/LICENSE-2.0.

SPDX-License-Identifier: EPL-2.0 OR Apache-2.0

## Source Code

The project maintains the following source code repositories:

* https://github.com/eclipse-zenoh/zenoh.git
* https://github.com/eclipse-zenoh/zenoh-c.git
* https://github.com/eclipse-zenoh/zenoh-java.git
* https://github.com/eclipse-zenoh/zenoh-go.git
* https://github.com/eclipse-zenoh/zenoh-python.git
* https://github.com/eclipse-zenoh/zenoh-plugin-dds.git

## Third-party Content

*To be completed...*

1 change: 1 addition & 0 deletions zenoh-plugin-ros1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ log = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
async-global-executor = { workspace = true }
async-trait = { workspace = true }
rand = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,22 @@ use std::time::Duration;

use rosrust::{Publisher, RawMessage, Subscriber};

use super::{ros1_client::Ros1Client, test_helpers::wait};
use super::{ros1_client::Ros1Client, test_helpers::wait_sync};

pub fn wait_for_rosclient_to_connect(rosclient: &Ros1Client) -> bool {
async_std::task::block_on(wait(
|| rosclient.topic_types().is_ok(),
Duration::from_secs(10),
))
wait_sync(|| rosclient.topic_types().is_ok(), Duration::from_secs(10))
}

pub fn wait_for_publishers(subscriber: &Subscriber, count: usize) -> bool {
async_std::task::block_on(wait(
wait_sync(
|| subscriber.publisher_count() == count,
Duration::from_secs(10),
))
)
}

pub fn wait_for_subscribers(publisher: &Publisher<RawMessage>, count: usize) -> bool {
async_std::task::block_on(wait(
wait_sync(
|| publisher.subscriber_count() == count,
Duration::from_secs(10),
))
)
}
Loading

0 comments on commit 73824ba

Please sign in to comment.