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

Server updates #17

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

rgallor
Copy link
Collaborator

@rgallor rgallor commented Nov 27, 2024

Give the possibility to change the math function, the scale and the interval between 2 samples by handling server-owned datastream data.

Closes #4

The interface allows generic sensors to stream samples data in double
format.
The interface is the same as the one defined in the
stream-qt5-test astarte-platform repository

Signed-off-by: Riccardo Gallo <[email protected]>
Introduce:
- `color_eyre` to have a structured report handler
- `tracing_subscriber` to collect scoped, structured and async-aware log data

Signed-off-by: Riccardo Gallo <[email protected]>
This required also the introduction of some environment variables and
structures to handle the generation of the samples to be sent to
Astarte.
For simplicity, the math functions are the same as the ones used in the
stream-qt5-test repository.

Signed-off-by: Riccardo Gallo <[email protected]>
Use clap to start the application, also taking into account possible
environment variables set by the user.

Signed-off-by: Riccardo Gallo <[email protected]>
Now the configuration information to connect a device to Astarte are
provided inside a `astarte-device-DEVICE_ID_HERE-conf` directory, in
a `config.toml` file. Instead, all the information necessary to generate
samples to be sent to Astarte are provided via CLI or environment
variables.
Also the README have been update to explain how to configure the
application and build/run it.

Signed-off-by: Riccardo Gallo <[email protected]>
Signed-off-by: Riccardo Gallo <[email protected]>
Provide the Atsarte configuration via environment variables or config.toml file, prioritizing env vars

Signed-off-by: Riccardo Gallo <[email protected]>
Give more flexibility to choose the mqtt or grpc Astarte connection
configuration by using the CLI, environment variables and a config.toml
file

Signed-off-by: Riccardo Gallo <[email protected]>
Now it is only possible to specify the type of connection (mqtt or grpc)
through the ASTARTE_CONNECTION env variable. The application will first
try to retrieve the config from env; if an error occurs, it tries to
retrieve them from a config.toml (if a path has beem specified). The
merge operation for the 2 sources of config has been removed.

Signed-off-by: Riccardo Gallo <[email protected]>
In this commit:
- Define scripts, env file and Dockerfile to build and run the container
- Get astarte config from env vars
- Add dependabot checks for docker
- Update Readme with the information to build and run a docker container

Signed-off-by: Riccardo Gallo <[email protected]>
Gracefully shut down all the active tasks when SIGINT or SIGTERM
signals are received.

Signed-off-by: Riccardo Gallo <[email protected]>
Update the math function, the scale and the interval between two samples
through a server-owned datastream interface

Signed-off-by: Riccardo Gallo <[email protected]>
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 3.77358% with 204 lines in your changes missing coverage. Please review.

Project coverage is 3.7%. Comparing base (a072d9f) to head (08a76c4).

Files with missing lines Patch % Lines
src/astarte.rs 7.5% 98 Missing ⚠️
src/math.rs 0.0% 67 Missing ⚠️
src/config.rs 0.0% 29 Missing ⚠️
src/shutdown.rs 0.0% 10 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/shutdown.rs 0.0% <0.0%> (ø)
src/config.rs 0.0% <0.0%> (ø)
src/math.rs 0.0% <0.0%> (ø)
src/astarte.rs 7.5% <7.5%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support server commands to pause/resume and change streaming parameters
1 participant