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

Initial implementation of up-streamer-rust - UTransport Non-thread-safe version #7

Closed
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
da372d7
Initial implementation of up-streamer-rust
PLeVasseur Jan 11, 2024
ea577aa
swapping in and out since we need to register on in and give the out_…
PLeVasseur Mar 22, 2024
23e573c
began to put in place what's needed for logging
PLeVasseur Mar 22, 2024
e49549b
Began converting println!() usages to proper logging.
PLeVasseur Mar 22, 2024
5c34d8c
fleshed out remainder of moving println!() to logging.
PLeVasseur Mar 22, 2024
e865d7d
Small amout of reorganization and renaming.
PLeVasseur Mar 23, 2024
b1c652f
started roughing in an example
PLeVasseur Mar 23, 2024
ed0aad5
fleshed example out more, need to get working
PLeVasseur Mar 23, 2024
486a6ff
very basic example to prove that the UStreamer can route
PLeVasseur Mar 24, 2024
bb353aa
roughing in request
PLeVasseur Mar 24, 2024
a662b92
fleshed out example showing two-way communication. key was to use asy…
PLeVasseur Mar 25, 2024
ee6f4d2
moved example code around and commented it a bit
PLeVasseur Mar 25, 2024
e71d2cd
incorporating feedback on needing to register 2 x listeners -- one fo…
PLeVasseur Mar 25, 2024
8b32c9d
got the example working! :)
PLeVasseur Mar 25, 2024
d6ab29f
cleaning up some straggler names from before re-org
PLeVasseur Mar 25, 2024
0280c37
added another spot i should add logging
PLeVasseur Mar 25, 2024
588e6da
addressing PR comments on docs & organization
PLeVasseur Mar 25, 2024
a1d1895
roll back 'hack' for Publish messages and wait on future looking uSub…
PLeVasseur Mar 26, 2024
5b104b7
General cleanup, improving logging
PLeVasseur Mar 26, 2024
22e564c
Experiment to see if we can add a diagram.
PLeVasseur Mar 26, 2024
de6b4a0
Adding diagram + description of the architecture.
PLeVasseur Mar 26, 2024
207a164
Adding notification to the example
PLeVasseur Mar 26, 2024
6eb2e1a
added hooks to get elements received and sent out
PLeVasseur Mar 26, 2024
5121e61
documenting function to get Receiver to listend for in/out messages.
PLeVasseur Mar 26, 2024
03ac7ec
added missing copyright headers
PLeVasseur Mar 26, 2024
f093fa1
missed making recording message queue size configurable
PLeVasseur Mar 26, 2024
183388b
updated README with implementation status
PLeVasseur Mar 26, 2024
448c1e8
clarify docs on which types of messages add_forwarding_rule() and del…
PLeVasseur Mar 26, 2024
58a68df
Adding more logging to happy path
PLeVasseur Mar 26, 2024
79d6d26
added an optimization s.t. we only have to copy the message once when…
PLeVasseur Mar 26, 2024
cf2f9ab
Got basic CI/CD working.
PLeVasseur Apr 1, 2024
e3045e6
remove log_enabled!() around most debug!() calls except for two that …
PLeVasseur Apr 1, 2024
9f40001
Attempt at a cleaner sequence diagram
PLeVasseur Apr 2, 2024
fa7b2e2
Updated sequence diagram to focus on the three threads' activities
PLeVasseur Apr 3, 2024
3698561
Adding design concepts
PLeVasseur Apr 3, 2024
87b9fdf
Rudimentary benchmarking
PLeVasseur Apr 5, 2024
62831f4
Updated test rig
PLeVasseur 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
109 changes: 109 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# ********************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************/

name: Build checks and tests

on:
push:
branches: [ main ]
pull_request:
paths:
- "src/**"
- "Cargo.*"
workflow_call:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: cargo fmt
working-directory: ${{github.workspace}}
run: cargo fmt -- --check
- name: cargo clippy
working-directory: ${{github.workspace}}
run: cargo clippy --all-targets -- -W warnings -D warnings

test:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
cargo install cargo-all-features
- name: Show toolchain information
working-directory: ${{github.workspace}}
run: |
rustup toolchain list
cargo --version
- name: cargo-check all possible feature combinations
run: |
cargo check-all-features
- name: cargo-test all possible feature combinations
run: |
cargo test-all-features

coverage:
name: Collect coverage info
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
cargo install cargo-tarpaulin
- name: Show toolchain information
working-directory: ${{github.workspace}}
run: |
rustup toolchain list
cargo --version
- name: Run tests to collect code coverage information
run: |
# enable nightly features so that we can also include Doctests
RUSTC_BOOTSTRAP=1 cargo tarpaulin -o xml -o lcov -o html --doc --tests --all-features
- name: Upload coverage report (xml)
uses: actions/upload-artifact@v4
with:
name: Test Coverage Results (xml)
path: cobertura.xml
- name: Upload coverage report (lcov)
uses: actions/upload-artifact@v4
with:
name: Test Coverage Results (lcov)
path: lcov.info
- name: Upload coverage report (html)
uses: actions/upload-artifact@v4
with:
name: Test Coverage Results (html)
path: tarpaulin-report.html

build-docs:
name: Build documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Create Documentation
working-directory: ${{github.workspace}}
run: RUSTDOCFLAGS=-Dwarnings cargo doc -p up-rust --no-deps
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# cargo-tarpaulin
cobertura.xml
lcov.info
tarpaulin-report.html

.idea/
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Contributing to Eclipse uProtocol
PLeVasseur marked this conversation as resolved.
Show resolved Hide resolved

Thanks for your interest in this project. Contributions are welcome!

Please refer to the main [CONTRIBUTING](https://github.com/eclipse-uprotocol/.github/blob/main/CONTRIBUTING.adoc) resource for Eclipse uProtocol to get most of the general overview.

The following is from [`up-rust`](https://github.com/eclipse-uprotocol/up-rust) project and is specific to Rust development for uProtocol.

## Setting up a development environment

You can use any development environment you like to contribute to `up-streamer-rust`. However, it is mandatory to use the Rust linter ('[clippy](<https://github.com/rust-lang/rust-clippy>)') for any pull requests you do.
To set up VSCode to run clippy per default every time you save your code, have a look here: [How to use Clippy in VS Code with rust-analyzer?](https://users.rust-lang.org/t/how-to-use-clippy-in-vs-code-with-rust-analyzer/41881)

Similarly, the project requests that markdown is formatted and linted properly - to help with this, it is recommended to use [markdown linters](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint).

During development, before submitting a PR, you can use `./tools/fmt_clippy_doc.sh` to run these checks on the workspace.

There also exists a helper script in ./tools to generate test results and test code coverage reports. These reports are placed in the `./target/tarpaulin` directory. If you use VSCode with the [Coverage Gutters](https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters) extension, you can enable display of code coverage information with these settings:

``` json
"coverage-gutters.coverageBaseDir": "**",
"coverage-gutters.coverageFileNames": [
"target/tarpaulin/lcov.info",
],
```

## DevContainer

All of these prerequisites are made available as a VSCode devcontainer, configured at the usual place (`.devcontainer`).

## Contact

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

<https://accounts.eclipse.org/mailing-list/uprotocol-dev>
Loading